refactor: prefer using base::NoDestructor
to base::{Singleton,LazyInstance}
(#41424)
refactor: prefer using base::NoDestructor to base::{Singleton,LazyInstance} 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:
parent
a55f23979e
commit
7331e5dfb1
12 changed files with 44 additions and 18 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "shell/browser/extensions/electron_extension_system_factory.h"
|
||||
|
||||
#include "base/no_destructor.h"
|
||||
#include "components/keyed_service/content/browser_context_dependency_manager.h"
|
||||
#include "extensions/browser/extension_prefs_factory.h"
|
||||
#include "extensions/browser/extension_registry_factory.h"
|
||||
|
@ -21,7 +22,8 @@ ExtensionSystem* ElectronExtensionSystemFactory::GetForBrowserContext(
|
|||
|
||||
// static
|
||||
ElectronExtensionSystemFactory* ElectronExtensionSystemFactory::GetInstance() {
|
||||
return base::Singleton<ElectronExtensionSystemFactory>::get();
|
||||
static base::NoDestructor<ElectronExtensionSystemFactory> instance;
|
||||
return instance.get();
|
||||
}
|
||||
|
||||
ElectronExtensionSystemFactory::ElectronExtensionSystemFactory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue