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

Unified Diff: chrome/browser/extensions/api/declarative/rules_registry_service.cc

Issue 13825014: Change RulesRegistryService to use ProfileKeyedAPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Took out rules_registry() from TestExtensionSystem Created 7 years, 8 months 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/declarative/rules_registry_service.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service.cc b/chrome/browser/extensions/api/declarative/rules_registry_service.cc
index 011a91a72cb96f33acacaba41a46b59fb2793eca..28648ca1831f41a27dd161b8c16a4d837dd8de3c 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_service.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/api/declarative/rules_registry_service.h"
#include "base/bind.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "chrome/browser/extensions/api/declarative/initializing_rules_registry.h"
#include "chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.h"
@@ -47,6 +48,7 @@ RulesRegistryService::RulesRegistryService(Profile* profile)
if (profile) {
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
content::Source<Profile>(profile->GetOriginalProfile()));
+ RegisterDefaultRulesRegistries();
}
}
@@ -99,6 +101,15 @@ void RulesRegistryService::Shutdown() {
profile_, scoped_refptr<WebRequestRulesRegistry>(NULL)));
}
+static base::LazyInstance<ProfileKeyedAPIFactory<RulesRegistryService> >
+g_factory = LAZY_INSTANCE_INITIALIZER;
+
+// static
+ProfileKeyedAPIFactory<RulesRegistryService>* RulesRegistryService::
Devlin 2013/04/26 01:07:09 prefer line-wrapping of: ProfileKeyedAPIFactory<Ru
Patrick Riordan 2013/04/26 01:44:55 Done.
+ GetFactoryInstance() {
+ return &g_factory.Get();
+}
+
void RulesRegistryService::RegisterRulesRegistry(
const std::string& event_name,
scoped_refptr<RulesRegistry> rule_registry) {

Powered by Google App Engine
This is Rietveld 408576698