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

Unified Diff: chrome/browser/extensions/api/declarative/rules_cache_delegate.h

Issue 53273002: Decouple RulesCacheDelegate from RulesRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_rules_registry_with_cache
Patch Set: Merge with ToT Created 7 years, 2 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_cache_delegate.h
diff --git a/chrome/browser/extensions/api/declarative/rules_cache_delegate.h b/chrome/browser/extensions/api/declarative/rules_cache_delegate.h
index c778091dfecd60d8d9a81548d09bdae8e450078b..cf942757e70dc0d8f04cae70f95bd27680ff6256 100644
--- a/chrome/browser/extensions/api/declarative/rules_cache_delegate.h
+++ b/chrome/browser/extensions/api/declarative/rules_cache_delegate.h
@@ -27,14 +27,12 @@ class RulesRegistry;
// If |log_storage_init_delay| is set, the delay caused by loading and
// registering rules on initialization will be logged with UMA.
class RulesCacheDelegate : public content::NotificationObserver {
- public:
+ public:
+
// |event_name| identifies the JavaScript event for which rules are
// registered. For example, for WebRequestRulesRegistry the name is
// "declarativeWebRequest.onRequest".
- RulesCacheDelegate(Profile* profile,
- const std::string& event_name,
- content::BrowserThread::ID rules_registry_thread,
- base::WeakPtr<RulesRegistry> registry,
+ RulesCacheDelegate(base::WeakPtr<RulesRegistry> registry,
bool log_storage_init_delay);
virtual ~RulesCacheDelegate();
@@ -91,6 +89,12 @@ class RulesCacheDelegate : public content::NotificationObserver {
void SetDeclarativeRulesStored(const std::string& extension_id,
bool rules_stored);
+ // Deserialize the rules from the given Value object and add them to the
+ // RulesRegistry.
+ static void DeserializeAndAddRules(base::WeakPtr<RulesRegistry> registry,
+ const std::string& extension_id,
+ scoped_ptr<base::Value> rules);
+
content::NotificationRegistrar registrar_;
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698