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:
parent
6bbe996f62
commit
65a7dddd4a
2 changed files with 3 additions and 30 deletions
|
@ -365,10 +365,10 @@ ElectronBrowserContext::ElectronBrowserContext(
|
||||||
BrowserContextDependencyManager::GetInstance()
|
BrowserContextDependencyManager::GetInstance()
|
||||||
->CreateBrowserContextServices(this);
|
->CreateBrowserContextServices(this);
|
||||||
|
|
||||||
extension_system_ = static_cast<extensions::ElectronExtensionSystem*>(
|
auto* extension_system = static_cast<extensions::ElectronExtensionSystem*>(
|
||||||
extensions::ExtensionSystem::Get(this));
|
extensions::ExtensionSystem::Get(this));
|
||||||
extension_system_->InitForRegularProfile(true /* extensions_enabled */);
|
extension_system->InitForRegularProfile(true /* extensions_enabled */);
|
||||||
extension_system_->FinishInitialization();
|
extension_system->FinishInitialization();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -377,11 +377,6 @@ ElectronBrowserContext::~ElectronBrowserContext() {
|
||||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||||
NotifyWillBeDestroyed();
|
NotifyWillBeDestroyed();
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
|
||||||
// the DestroyBrowserContextServices() call below frees this.
|
|
||||||
extension_system_ = nullptr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Notify any keyed services of browser context destruction.
|
// Notify any keyed services of browser context destruction.
|
||||||
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
|
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
|
||||||
this);
|
this);
|
||||||
|
|
|
@ -13,12 +13,10 @@
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/memory/raw_ptr.h"
|
|
||||||
#include "base/memory/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "content/public/browser/browser_context.h"
|
#include "content/public/browser/browser_context.h"
|
||||||
#include "content/public/browser/media_stream_request.h"
|
#include "content/public/browser/media_stream_request.h"
|
||||||
#include "content/public/browser/resource_context.h"
|
#include "content/public/browser/resource_context.h"
|
||||||
#include "electron/buildflags/buildflags.h"
|
|
||||||
#include "electron/shell/browser/media/media_device_id_salt.h"
|
#include "electron/shell/browser/media/media_device_id_salt.h"
|
||||||
#include "mojo/public/cpp/bindings/remote.h"
|
#include "mojo/public/cpp/bindings/remote.h"
|
||||||
#include "services/network/public/mojom/ssl_config.mojom.h"
|
#include "services/network/public/mojom/ssl_config.mojom.h"
|
||||||
|
@ -43,12 +41,6 @@ namespace storage {
|
||||||
class SpecialStoragePolicy;
|
class SpecialStoragePolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
|
||||||
namespace extensions {
|
|
||||||
class ElectronExtensionSystem;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
class ElectronDownloadManagerDelegate;
|
class ElectronDownloadManagerDelegate;
|
||||||
|
@ -154,15 +146,6 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||||
return weak_factory_.GetWeakPtr();
|
return weak_factory_.GetWeakPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
|
||||||
extensions::ElectronExtensionSystem* extension_system() {
|
|
||||||
// Guard usages of extension_system() with !IsOffTheRecord()
|
|
||||||
// There is no extension system for in-memory sessions
|
|
||||||
DCHECK(!IsOffTheRecord());
|
|
||||||
return extension_system_;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ProtocolRegistry* protocol_registry() const {
|
ProtocolRegistry* protocol_registry() const {
|
||||||
return protocol_registry_.get();
|
return protocol_registry_.get();
|
||||||
}
|
}
|
||||||
|
@ -237,11 +220,6 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||||
bool use_cache_ = true;
|
bool use_cache_ = true;
|
||||||
int max_cache_size_ = 0;
|
int max_cache_size_ = 0;
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
|
||||||
// Owned by the KeyedService system.
|
|
||||||
raw_ptr<extensions::ElectronExtensionSystem> extension_system_;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Shared URLLoaderFactory.
|
// Shared URLLoaderFactory.
|
||||||
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
|
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue