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

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

Issue 108193008: Don't post tasks from RulesRegistry c-tor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Creating event as signalled 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
« no previous file with comments | « no previous file | extensions/common/one_shot_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/rules_registry.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_registry.cc b/chrome/browser/extensions/api/declarative/rules_registry.cc
index 306266e3e219e97f5f7759bd1ff264cd12f51161..d5b5de5d6847071fad2480ab3437088a9cc1358f 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry.cc
@@ -73,26 +73,22 @@ namespace extensions {
// RulesRegistry
-RulesRegistry::RulesRegistry(
- Profile* profile,
- const std::string& event_name,
- content::BrowserThread::ID owner_thread,
- RulesCacheDelegate* cache_delegate,
- const WebViewKey& webview_key)
+RulesRegistry::RulesRegistry(Profile* profile,
+ const std::string& event_name,
+ content::BrowserThread::ID owner_thread,
+ RulesCacheDelegate* cache_delegate,
+ const WebViewKey& webview_key)
: profile_(profile),
owner_thread_(owner_thread),
event_name_(event_name),
webview_key_(webview_key),
+ ready_(/*signaled=*/!cache_delegate), // Immediately ready if no cache
+ // delegate to wait for.
weak_ptr_factory_(profile ? this : NULL),
last_generated_rule_identifier_id_(0) {
if (cache_delegate) {
cache_delegate_ = cache_delegate->GetWeakPtr();
cache_delegate->Init(this);
- } else {
- content::BrowserThread::PostTask(
- owner_thread,
- FROM_HERE,
- base::Bind(&RulesRegistry::MarkReady, this, base::Time::Now()));
}
}
« no previous file with comments | « no previous file | extensions/common/one_shot_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698