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

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

Issue 15688010: Detach the RulesRegistryWithCache::weak_ptr_factory_ on destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make sure WRRR is deleted by ExtensionWebRequestEventRouter 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/rules_registry_service.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service.cc b/chrome/browser/extensions/api/declarative/rules_registry_service.cc
index 614712c2edfa1ee2c83822766f00ae024bf492dc..0824561792b401c19d4c66983ed33fa2b5df0302 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_service.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service.cc
@@ -64,6 +64,13 @@ void RulesRegistryService::RegisterDefaultRulesRegistries() {
}
void RulesRegistryService::Shutdown() {
+ // Release the references to all registries. This would happen soon during
+ // destruction of |*this|, but we need the ExtensionWebRequestEventRouter to
+ // be the last to reference the WebRequestRulesRegistry objects, so that
+ // the posted task below causes their destruction on the IO thread, not on UI
+ // where the destruction of |*this| takes place.
+ // TODO(vabr): Remove once http://crbug.com/218451#c6 gets addressed.
+ rule_registries_.clear();
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698