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) { |