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

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

Issue 52743002: Declarative rules should be removed on uninstalling, not unloading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rewritten and rebased off https://codereview.chromium.org/64093010/ 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.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry.h b/chrome/browser/extensions/api/declarative/rules_registry.h
index a4ef26b44a8068f4d447908c5e552d279cf41d65..f7185f99df0c8cd03153d0a3217df7b1b76ad750 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry.h
@@ -120,9 +120,11 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
void GetAllRules(const std::string& extension_id,
std::vector<linked_ptr<RulesRegistry::Rule> >* out);
- // Called to notify the RulesRegistry that an extension has been unloaded
- // and all rules of this extension need to be removed.
+ // Called to notify the RulesRegistry that the extension availability has
+ // changed, so that the registry can update which rules are active.
void OnExtensionUnloaded(const std::string& extension_id);
+ void OnExtensionUninstalled(const std::string& extension_id);
+ void OnExtensionLoaded(const std::string& extension_id);
// Returns the number of entries in used_rule_identifiers_ for leak detection.
// Every ExtensionId counts as one entry, even if it contains no rules.
@@ -213,6 +215,13 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
void DeserializeAndAddRules(const std::string& extension_id,
scoped_ptr<base::Value> rules);
+ // These functions are responsible for removing rules from RulesRegistry
+ // storage (as opposed to the storage of the inheriting registries, handled by
Jeffrey Yasskin 2013/11/20 05:55:28 This isn't clear. Maybe "These functions remove ru
vabr (Chromium) 2013/11/20 17:46:07 I was also unhappy about the naming. However, fol
+ // Remove(All)RulesImpl).
+ void CommitRemoveRules(const std::string& extension_id,
+ const std::vector<std::string>& rule_identifiers);
+ void CommitRemoveAllRules(const std::string& extension_id);
+
// The profile to which this rules registry belongs.
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698