refactor: use base::NoDestructor instead of base::LazyInstance (#40947)
* refactor: use NoDestructor for g_io_thread_application_locale * refactor: use NoDestructor for ExtensionActionAPI::GetFactoryInstance() * refactor: use NoDestructor for ElectronExtensionsClient::GetPermissionMessageProvider() * refactor: use NoDestructor for feat_add_support_for_overriding_the_base_spellchecker_download_url.patch * chore: remove unused #include * fixup! refactor: use NoDestructor for ElectronExtensionsClient::GetPermissionMessageProvider() make sure instance is static * chore: remove unused #include "base/lazy_instance.h"
This commit is contained in:
parent
57b29903e3
commit
80b220d214
6 changed files with 28 additions and 27 deletions
|
@ -10,7 +10,7 @@
|
|||
#include <utility>
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "extensions/browser/event_router.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
|
@ -38,9 +38,6 @@ ExtensionActionAPI::Observer::~Observer() {}
|
|||
// ExtensionActionAPI
|
||||
//
|
||||
|
||||
static base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionActionAPI>>::
|
||||
DestructorAtExit g_extension_action_api_factory = LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
ExtensionActionAPI::ExtensionActionAPI(content::BrowserContext* context)
|
||||
: browser_context_(context), extension_prefs_(nullptr) {}
|
||||
|
||||
|
@ -49,7 +46,9 @@ ExtensionActionAPI::~ExtensionActionAPI() {}
|
|||
// static
|
||||
BrowserContextKeyedAPIFactory<ExtensionActionAPI>*
|
||||
ExtensionActionAPI::GetFactoryInstance() {
|
||||
return g_extension_action_api_factory.Pointer();
|
||||
static base::NoDestructor<BrowserContextKeyedAPIFactory<ExtensionActionAPI>>
|
||||
instance;
|
||||
return instance.get();
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue