2015-11-26 04:45:19 +01:00
|
|
|
diff --git prefs_tab_helper.cc prefs_tab_helper.cc
|
2016-10-17 20:14:44 +02:00
|
|
|
index 448bb72..aa98dda 100644
|
2015-11-26 04:45:19 +01:00
|
|
|
--- prefs_tab_helper.cc
|
|
|
|
+++ prefs_tab_helper.cc
|
2016-03-16 03:55:59 +01:00
|
|
|
@@ -11,8 +11,8 @@
|
|
|
|
#include <string>
|
2015-11-26 04:45:19 +01:00
|
|
|
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "base/command_line.h"
|
2016-03-16 03:55:59 +01:00
|
|
|
+#include "base/lazy_instance.h"
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "base/macros.h"
|
2015-11-26 04:45:19 +01:00
|
|
|
-#include "base/memory/singleton.h"
|
2016-02-05 01:49:19 +01:00
|
|
|
#include "base/strings/string_number_conversions.h"
|
|
|
|
#include "base/strings/string_util.h"
|
2016-03-16 03:55:59 +01:00
|
|
|
#include "base/strings/stringprintf.h"
|
2016-10-17 20:14:44 +02:00
|
|
|
@@ -422,12 +422,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
|
2015-11-26 04:45:19 +01:00
|
|
|
GetInstance()->GetServiceForBrowserContext(profile, true));
|
|
|
|
}
|
|
|
|
|
|
|
|
- static PrefWatcherFactory* GetInstance() {
|
|
|
|
- return base::Singleton<PrefWatcherFactory>::get();
|
|
|
|
- }
|
|
|
|
+ static PrefWatcherFactory* GetInstance();
|
|
|
|
|
|
|
|
private:
|
|
|
|
- friend struct base::DefaultSingletonTraits<PrefWatcherFactory>;
|
|
|
|
+ friend struct base::DefaultLazyInstanceTraits<PrefWatcherFactory>;
|
|
|
|
|
|
|
|
PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
|
|
|
|
"PrefWatcher",
|
2016-10-17 20:14:44 +02:00
|
|
|
@@ -448,6 +446,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
|
2015-11-26 04:45:19 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
+namespace {
|
|
|
|
+
|
|
|
|
+base::LazyInstance<PrefWatcherFactory>::Leaky g_pref_watcher_factory =
|
|
|
|
+ LAZY_INSTANCE_INITIALIZER;
|
|
|
|
+
|
|
|
|
+} // namespace
|
|
|
|
+
|
|
|
|
+// static
|
|
|
|
+PrefWatcherFactory* PrefWatcherFactory::GetInstance() {
|
|
|
|
+ return g_pref_watcher_factory.Pointer();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
// static
|
|
|
|
PrefWatcher* PrefWatcher::Get(Profile* profile) {
|
|
|
|
return PrefWatcherFactory::GetForProfile(profile);
|