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

Unified Diff: chrome/browser/extensions/extension_system.cc

Issue 11359081: Lazy initialization for ProcessesEventRouter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month 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/extension_system.cc
diff --git a/chrome/browser/extensions/extension_system.cc b/chrome/browser/extensions/extension_system.cc
index cf5b5d451641efe65d414bd09684c4c30aefa38b..45b166c55188216dc2f6a4b4f06dcfe877310149 100644
--- a/chrome/browser/extensions/extension_system.cc
+++ b/chrome/browser/extensions/extension_system.cc
@@ -71,6 +71,7 @@ ExtensionSystem* ExtensionSystem::Get(Profile* profile) {
ExtensionSystemImpl::Shared::Shared(Profile* profile)
: profile_(profile) {
+ event_router_.reset(new EventRouter(profile_));
Aaron Boodman 2012/11/07 23:51:28 Why not make it part of the initializer list?
Yoyo Zhou 2012/11/08 00:18:16 See below.
}
ExtensionSystemImpl::Shared::~Shared() {
@@ -85,6 +86,8 @@ void ExtensionSystemImpl::Shared::InitPrefs() {
profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName),
ExtensionPrefValueMapFactory::GetForProfile(profile_)));
extension_prefs_->Init(extensions_disabled);
+ // Tell the EventRouter that ExtensionPrefs are ready.
+ event_router_->InitWithPrefs(extension_prefs_.get());
Aaron Boodman 2012/11/07 23:51:28 Shared::InitPrefs() is called in the constructor.
Yoyo Zhou 2012/11/08 00:18:16 Yes, I was misinterpreting what was going on. I'll
state_store_.reset(new StateStore(
profile_,
@@ -104,8 +107,6 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
lazy_background_task_queue_.reset(new LazyBackgroundTaskQueue(profile_));
message_service_.reset(new MessageService(lazy_background_task_queue_.get()));
- extension_event_router_.reset(new EventRouter(profile_,
- extension_prefs_.get()));
navigation_observer_.reset(new NavigationObserver(profile_));
ExtensionErrorReporter::Init(true); // allow noisy errors.
@@ -237,7 +238,7 @@ MessageService* ExtensionSystemImpl::Shared::message_service() {
}
EventRouter* ExtensionSystemImpl::Shared::event_router() {
- return extension_event_router_.get();
+ return event_router_.get();
}
//

Powered by Google App Engine
This is Rietveld 408576698