fix: ElectronBrowserContext raw_ptr bug + remove dead code (#46053)

refactor: remove unused ElectronBrowserContext::extension_system()

Last use removed on Jul 21, 2020 by 2fb14f5 in PR #24575

This fixes a raw_ptr warning by letting us remove the raw_ptr field
`ElectronBrowserContext::extension_system_`.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2025-03-15 11:39:34 -05:00 committed by GitHub
parent 6bbe996f62
commit 65a7dddd4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 30 deletions

View file

@ -365,10 +365,10 @@ ElectronBrowserContext::ElectronBrowserContext(
BrowserContextDependencyManager::GetInstance()
->CreateBrowserContextServices(this);
extension_system_ = static_cast<extensions::ElectronExtensionSystem*>(
auto* extension_system = static_cast<extensions::ElectronExtensionSystem*>(
extensions::ExtensionSystem::Get(this));
extension_system_->InitForRegularProfile(true /* extensions_enabled */);
extension_system_->FinishInitialization();
extension_system->InitForRegularProfile(true /* extensions_enabled */);
extension_system->FinishInitialization();
}
#endif
}
@ -377,11 +377,6 @@ ElectronBrowserContext::~ElectronBrowserContext() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
NotifyWillBeDestroyed();
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
// the DestroyBrowserContextServices() call below frees this.
extension_system_ = nullptr;
#endif
// Notify any keyed services of browser context destruction.
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
this);