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

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

Issue 53273002: Decouple RulesCacheDelegate from RulesRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_rules_registry_with_cache
Patch Set: Updated Created 7 years, 1 month 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 fd2a4abceb1f8a4d70038a531d74a3c90f5be585..a0685d07e717b3997fba969a0468d2c111716baf 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_service.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service.cc
@@ -45,10 +45,11 @@ RulesRegistryService::RulesRegistryService(Profile* profile)
RulesRegistryService::~RulesRegistryService() {}
void RulesRegistryService::RegisterDefaultRulesRegistries() {
- scoped_ptr<RulesCacheDelegate> ui_part;
+ scoped_ptr<RulesCacheDelegate> web_request_cache_delegate(
+ new RulesCacheDelegate(true /*log_storage_init_delay*/));
scoped_refptr<WebRequestRulesRegistry> web_request_rules_registry(
- new WebRequestRulesRegistry(profile_, &ui_part));
- ui_parts_of_registries_.push_back(ui_part.release());
+ new WebRequestRulesRegistry(profile_, web_request_cache_delegate.get()));
+ cache_delegates_.push_back(web_request_cache_delegate.release());
RegisterRulesRegistry(web_request_rules_registry);
content::BrowserThread::PostTask(
@@ -57,9 +58,11 @@ void RulesRegistryService::RegisterDefaultRulesRegistries() {
profile_, web_request_rules_registry));
#if defined(ENABLE_EXTENSIONS)
+ scoped_ptr<RulesCacheDelegate> content_rules_cache_delegate(
+ new RulesCacheDelegate(false /*log_storage_init_delay*/));
scoped_refptr<ContentRulesRegistry> content_rules_registry(
- new ContentRulesRegistry(profile_, &ui_part));
- ui_parts_of_registries_.push_back(ui_part.release());
+ new ContentRulesRegistry(profile_, content_rules_cache_delegate.get()));
+ cache_delegates_.push_back(content_rules_cache_delegate.release());
RegisterRulesRegistry(content_rules_registry);
content_rules_registry_ = content_rules_registry.get();

Powered by Google App Engine
This is Rietveld 408576698