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:
trop[bot] 2024-02-28 11:38:49 +09:00 committed by GitHub
parent a55f23979e
commit 7331e5dfb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 44 additions and 18 deletions

View file

@ -21,7 +21,8 @@ BadgeManager* BadgeManagerFactory::GetForBrowserContext(
// static
BadgeManagerFactory* BadgeManagerFactory::GetInstance() {
return base::Singleton<BadgeManagerFactory>::get();
static base::NoDestructor<BadgeManagerFactory> instance;
return instance.get();
}
BadgeManagerFactory::BadgeManagerFactory()