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

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

Issue 108193008: Don't post tasks from RulesRegistry c-tor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix weak pointer dereference on a wrong thread Created 7 years 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 4357d6b5b0599d87f26a19fbfaebfbcc34ab9c79..6f5e4ea4cceeae437a5c93d5efc64309b0c1591c 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry.h
@@ -65,8 +65,10 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
RulesCacheDelegate* cache_delegate,
const WebViewKey& webview_key);
- const OneShotEvent& ready() const {
- return ready_;
+ // If |ready()| returns NULL, the registry does not wait for the
+ // |cache_delegate_| to initialize and can be considered ready.
+ const OneShotEvent* ready() const {
+ return ready_.get();
}
// RulesRegistry implementation:
@@ -239,7 +241,7 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
// Signaled when we have finished reading from storage for all extensions that
// are loaded on startup.
- OneShotEvent ready_;
+ scoped_ptr<OneShotEvent> ready_;
// The factory needs to be declared before |cache_delegate_|, so that it can
// produce a pointer as a construction argument for |cache_delegate_|.

Powered by Google App Engine
This is Rietveld 408576698