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

This commit is contained in:
Shelley Vohr 2022-10-10 07:48:44 -07:00 committed by GitHub
parent ef00a2a1da
commit ebb866e63d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

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

View file

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