Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions shell/app/electron_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
#include "base/apple/bundle_locations.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/debug/leak_annotations.h"
#include "base/debug/stack_trace.h"
#include "base/environment.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/metrics/field_trial.h"
#include "base/path_service.h"
#include "base/strings/cstring_view.h"
#include "base/strings/string_number_conversions.cc"
Expand Down Expand Up @@ -419,6 +421,11 @@ std::optional<int> ElectronMainDelegate::PreBrowserMain() {
// This is initialized early because the service manager reads some feature
// flags and we need to make sure the feature list is initialized before the
// service manager reads the features.
if (!base::FieldTrialList::GetInstance()) {
base::FieldTrialList* leaked_field_trial_list = new base::FieldTrialList();
ANNOTATE_LEAKING_OBJECT_PTR(leaked_field_trial_list);
std::ignore = leaked_field_trial_list;
}
InitializeFeatureList();
// Initialize mojo core as soon as we have a valid feature list
content::InitializeMojoCore();
Expand Down
2 changes: 0 additions & 2 deletions shell/browser/electron_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/i18n/rtl.h"
#include "base/metrics/field_trial.h"
#include "base/nix/xdg_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
Expand Down Expand Up @@ -205,7 +204,6 @@ int ElectronBrowserMainParts::GetExitCode() const {
}

int ElectronBrowserMainParts::PreEarlyInitialization() {
field_trial_list_ = std::make_unique<base::FieldTrialList>();
#if BUILDFLAG(IS_POSIX)
HandleSIGCHLD();
#endif
Expand Down
5 changes: 0 additions & 5 deletions shell/browser/electron_browser_main_parts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
class BrowserProcessImpl;
class IconManager;

namespace base {
class FieldTrialList;
}

namespace display {
class Screen;
class ScopedNativeScreen;
Expand Down Expand Up @@ -171,7 +167,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
std::unique_ptr<Browser> browser_;

std::unique_ptr<IconManager> icon_manager_;
std::unique_ptr<base::FieldTrialList> field_trial_list_;

#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
std::unique_ptr<ElectronExtensionsClient> extensions_client_;
Expand Down