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); |
}; |