Index: chrome/browser/extensions/api/preference/preference_api.cc |
diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc |
index e3e8ce58441ef45c34daec2aaa0c67c9584fd70c..0b7b3b1df9afa84d84c83172cad71555a1a2d941 100644 |
--- a/chrome/browser/extensions/api/preference/preference_api.cc |
+++ b/chrome/browser/extensions/api/preference/preference_api.cc |
@@ -7,6 +7,7 @@ |
#include <map> |
#include <utility> |
+#include "base/lazy_instance.h" |
#include "base/memory/singleton.h" |
#include "base/stl_util.h" |
#include "base/stringprintf.h" |
@@ -321,6 +322,14 @@ void PreferenceAPI::Shutdown() { |
ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
} |
+static base::LazyInstance<ProfileKeyedAPIFactory<PreferenceAPI> > |
+g_factory = LAZY_INSTANCE_INITIALIZER; |
+ |
+// static |
+ProfileKeyedAPIFactory<PreferenceAPI>* PreferenceAPI::GetFactoryInstance() { |
+ return &g_factory.Get(); |
+} |
+ |
void PreferenceAPI::OnListenerAdded(const EventListenerInfo& details) { |
preference_event_router_.reset(new PreferenceEventRouter(profile_)); |
ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |