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

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

Issue 15688010: Detach the RulesRegistryWithCache::weak_ptr_factory_ on destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Always initialise the factory with |this| 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_with_cache.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
index ab0003bfcc8c39a777954122575676430741e548..db79f17dddea803bc2e6dd3e39688b931498733a 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
@@ -80,7 +80,7 @@ RulesRegistryWithCache::RulesRegistryWithCache(
bool log_storage_init_delay,
scoped_ptr<RuleStorageOnUI>* ui_part)
: RulesRegistry(owner_thread, event_name),
- weak_ptr_factory_((profile) ? this : NULL),
+ weak_ptr_factory_(this),
storage_on_ui_((profile
? (new RuleStorageOnUI(profile,
GetDeclarativeRuleStorageKey(
@@ -217,6 +217,7 @@ void RulesRegistryWithCache::OnExtensionUnloaded(
}
RulesRegistryWithCache::~RulesRegistryWithCache() {
+ weak_ptr_factory_.DetachFromThread();
Jeffrey Yasskin 2013/05/28 22:37:10 This isn't safe, according to the thread-safety ru
Jeffrey Yasskin 2013/05/28 22:48:49 One way to work around this would be to add a meth
}
void RulesRegistryWithCache::MarkReady(base::Time storage_init_time) {
« 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