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

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: Type description for ProcessChangedRulesState moved to the enum's def Created 7 years, 6 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..6c55c75e665a0ad9ca1f29ebcb47146588679bf9 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,23 @@ class RulesRegistryWithCache : public RulesRegistry {
typedef std::pair<ExtensionId, RuleId> RulesDictionaryKey;
typedef std::map<RulesDictionaryKey, linked_ptr<RulesRegistry::Rule> >
RulesDictionary;
+ enum ProcessChangedRulesState {
+ // ProcessChangedRules can never be called, |storage_on_ui_| is NULL.
+ NEVER_PROCESS,
+ // A task to call ProcessChangedRules is scheduled for future execution.
+ SCHEDULED_FOR_PROCESSING,
+ // No task to call ProcessChangedRules is scheduled yet, but it is possible
+ // to schedule one.
+ 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 +220,8 @@ class RulesRegistryWithCache : public RulesRegistry {
// safe. The registry only ever associates with one RuleStorageOnUI instance.
const base::WeakPtr<RuleStorageOnUI> storage_on_ui_;
+ 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