fix: override content::ContentMainDelegate::CreateContentClient() (#35965)

* fix: override content::ContentMainDelegate::CreateContentClient()

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: remove extra call

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2022-10-11 02:37:18 -07:00
committed by GitHub
parent cef4f6a8e7
commit 9048de7cab
2 changed files with 6 additions and 3 deletions

View File

@@ -316,9 +316,6 @@ absl::optional<int> ElectronMainDelegate::BasicStartupComplete() {
::switches::kDisableGpuMemoryBufferCompositorResources);
#endif
content_client_ = std::make_unique<ElectronContentClient>();
SetContentClient(content_client_.get());
return absl::nullopt;
}
@@ -437,6 +434,11 @@ base::StringPiece ElectronMainDelegate::GetBrowserV8SnapshotFilename() {
return ContentMainDelegate::GetBrowserV8SnapshotFilename();
}
content::ContentClient* ElectronMainDelegate::CreateContentClient() {
content_client_ = std::make_unique<ElectronContentClient>();
return content_client_.get();
}
content::ContentBrowserClient*
ElectronMainDelegate::CreateContentBrowserClient() {
browser_client_ = std::make_unique<ElectronBrowserClient>();

View File

@@ -38,6 +38,7 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
void PreSandboxStartup() override;
void SandboxInitialized(const std::string& process_type) override;
absl::optional<int> PreBrowserMain() override;
content::ContentClient* CreateContentClient() override;
content::ContentBrowserClient* CreateContentBrowserClient() override;
content::ContentGpuClient* CreateContentGpuClient() override;
content::ContentRendererClient* CreateContentRendererClient() override;