Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6190)

Unified Diff: chrome/browser/extensions/api/cookies/cookies_api.cc

Issue 11719004: Remove Profile-keyed factory boilerplate: cookies, managed_mode & web_navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/cookies/cookies_api.cc
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc
index f5e10fd4d9925da84e17661aed921cec04cc4cb2..a0e54ad849ec0d2f176203a89932212a192ec46e 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/json/json_writer.h"
+#include "base/lazy_instance.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
@@ -561,4 +562,13 @@ void CookiesAPI::OnListenerAdded(
ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
}
+static base::LazyInstance<ProfileKeyedAPIFactory<CookiesAPI> >
+g_factory = LAZY_INSTANCE_INITIALIZER;
+
+template <>
+ProfileKeyedAPIFactory<CookiesAPI>*
+ProfileKeyedAPIFactory<CookiesAPI>::GetInstance() {
+ return &g_factory.Get();
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698