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

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

Issue 15911005: RulesRegistryWithCache::ProcessChangedRules postponed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
index 09a31273d71e82fa7def790a6ca8cb6d70da0267..e85190c1915ecdb42885310904851aaa0c8227bc 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.h
@@ -176,10 +176,19 @@ class RulesRegistryWithCache : public RulesRegistry {
typedef std::pair<ExtensionId, RuleId> RulesDictionaryKey;
typedef std::map<RulesDictionaryKey, linked_ptr<RulesRegistry::Rule> >
RulesDictionary;
+ enum ProcessChangedRulesState {
+ NEVER_PROCESS,
+ SCHEDULED_FOR_PROCESSING,
+ NOT_SCHEDULED_FOR_PROCESSING
+ };
// Common processing after extension's rules have changed.
void ProcessChangedRules(const std::string& extension_id);
+ // Calls ProcessChangedRules if |process_changed_rules_requested_| ==
+ // NOT_SCHEDULED_FOR_PROCESSING.
+ void MaybeProcessChangedRules(const std::string& extension_id);
+
// Process the callbacks once the registry gets ready.
void MarkReady(base::Time storage_init_time);
@@ -207,6 +216,15 @@ class RulesRegistryWithCache : public RulesRegistry {
// safe. The registry only ever associates with one RuleStorageOnUI instance.
const base::WeakPtr<RuleStorageOnUI> storage_on_ui_;
+ // Possible values:
+ // NEVER_PROCESS -- ProcessChangedRules can never be called, because
+ // |storage_on_ui_| is NULL.
+ // SCHEDULED_FOR_PROCESSING -- a task to call ProcessChangedRules is scheduled
+ // for execution in the future.
+ // NOT_SCHEDULED_FOR_PROCESSING -- no task to call ProcessChangedRules is
+ // scheduled yet, but it is possible to schedule one.
battre 2013/06/04 08:22:34 nit: I think this should go to the typedef above.
+ ProcessChangedRulesState process_changed_rules_requested_;
+
DISALLOW_COPY_AND_ASSIGN(RulesRegistryWithCache);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698