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

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

Issue 52743002: Declarative rules should be removed on uninstalling, not unloading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further comments addressed 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_service.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service.h b/chrome/browser/extensions/api/declarative/rules_registry_service.h
index af4ce2be237d8f73a7ec0864e735d7f7a2153ab6..058367a7c4e7ffc90215cbbb63dfeb1537acacd3 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_service.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service.h
@@ -89,7 +89,8 @@ class RulesRegistryService : public ProfileKeyedAPI,
void RemoveWebViewRulesRegistries(int process_id);
// For testing.
- void SimulateExtensionUnloaded(const std::string& extension_id);
+ void SimulateExtensionUninstalled(const std::string& extension_id);
+
private:
friend class ProfileKeyedAPIFactory<RulesRegistryService>;
@@ -98,16 +99,19 @@ class RulesRegistryService : public ProfileKeyedAPI,
typedef std::map<RulesRegistryKey, scoped_refptr<RulesRegistry> >
RulesRegistryMap;
- // Notifies all RulesRegistries that |extension_id| was unloaded.
- // It is not guaranteed that this notification is processed synchronously.
- // If extensions live on another thread, the notification is posted.
- void OnExtensionUnloaded(const std::string& extension_id);
-
// Implementation of content::NotificationObserver.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Iterates over all registries, and calls |notification_callback| on them
+ // with |extension_id| as the argument. If a registry lives on a different
+ // thread, the call is posted to that thread, so no guarantee of synchronous
+ // processing.
+ void NotifyRegistriesHelper(
+ void (RulesRegistry::*notification_callback)(const std::string&),
+ const std::string& extension_id);
+
// ProfileKeyedAPI implementation.
static const char* service_name() {
return "RulesRegistryService";

Powered by Google App Engine
This is Rietveld 408576698