From ebb866e63d90fc44168f2b9c97ea2378d4c17831 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 10 Oct 2022 07:48:44 -0700 Subject: [PATCH] fix: override `content::ContentMainDelegate::CreateContentClient()` (#35932) --- shell/app/electron_main_delegate.cc | 8 +++++--- shell/app/electron_main_delegate.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/shell/app/electron_main_delegate.cc b/shell/app/electron_main_delegate.cc index 46a3bcc1d605..b70ace445c95 100644 --- a/shell/app/electron_main_delegate.cc +++ b/shell/app/electron_main_delegate.cc @@ -317,9 +317,6 @@ absl::optional ElectronMainDelegate::BasicStartupComplete() { ::switches::kDisableGpuMemoryBufferCompositorResources); #endif - content_client_ = std::make_unique(); - SetContentClient(content_client_.get()); - return absl::nullopt; } @@ -440,6 +437,11 @@ base::StringPiece ElectronMainDelegate::GetBrowserV8SnapshotFilename() { return ContentMainDelegate::GetBrowserV8SnapshotFilename(); } +content::ContentClient* ElectronMainDelegate::CreateContentClient() { + content_client_ = std::make_unique(); + return content_client_.get(); +} + content::ContentBrowserClient* ElectronMainDelegate::CreateContentBrowserClient() { browser_client_ = std::make_unique(); diff --git a/shell/app/electron_main_delegate.h b/shell/app/electron_main_delegate.h index 4b51f5ba2a95..15cff1cc76ce 100644 --- a/shell/app/electron_main_delegate.h +++ b/shell/app/electron_main_delegate.h @@ -38,6 +38,7 @@ class ElectronMainDelegate : public content::ContentMainDelegate { void PreSandboxStartup() override; void SandboxInitialized(const std::string& process_type) override; absl::optional PreBrowserMain() override; + content::ContentClient* CreateContentClient() override; content::ContentBrowserClient* CreateContentBrowserClient() override; content::ContentGpuClient* CreateContentGpuClient() override; content::ContentRendererClient* CreateContentRendererClient() override;