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

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

Issue 147051: Clean up a few startup and shutdown dependencies which should fix some of the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
Index: chrome/browser/extensions/extensions_service.cc
===================================================================
--- chrome/browser/extensions/extensions_service.cc (revision 19016)
+++ chrome/browser/extensions/extensions_service.cc (working copy)
@@ -215,6 +215,7 @@
MessageLoop* frontend_loop,
MessageLoop* backend_loop)
: extension_prefs_(new ExtensionPrefs(profile->GetPrefs())),
+ extension_process_manager_(new ExtensionProcessManager(profile)),
backend_loop_(backend_loop),
install_directory_(profile->GetPath().AppendASCII(kInstallDirectoryName)),
extensions_enabled_(false),
@@ -244,6 +245,7 @@
}
void ExtensionsService::Init() {
+ DCHECK(!ready_);
DCHECK(extensions_.size() == 0);
// Start up the extension event routers.
@@ -325,7 +327,7 @@
// Tell other services the extension is gone.
NotificationService::current()->Notify(NotificationType::EXTENSION_UNLOADED,
- NotificationService::AllSources(),
+ Source<ExtensionsService>(this),
Details<Extension>(extension));
delete extension;
@@ -333,14 +335,13 @@
void ExtensionsService::UnloadAllExtensions() {
ExtensionList::iterator iter;
- for (iter = extensions_.begin(); iter != extensions_.end(); ++iter) {
- // Tell other services the extension is gone.
- NotificationService::current()->Notify(NotificationType::EXTENSION_UNLOADED,
- NotificationService::AllSources(),
- Details<Extension>(*iter));
+ for (iter = extensions_.begin(); iter != extensions_.end(); ++iter)
delete *iter;
- }
extensions_.clear();
+
+ // TODO(erikkay) should there be a notification for this? We can't use
+ // EXTENSION_UNLOADED since that implies that the extension has been disabled
+ // or uninstalled, and UnloadAll is just part of shutdown.
}
void ExtensionsService::ReloadExtensions() {
@@ -399,7 +400,7 @@
if (enabled_extensions.size()) {
NotificationService::current()->Notify(
NotificationType::EXTENSIONS_LOADED,
- NotificationService::AllSources(),
+ Source<ExtensionsService>(this),
Details<ExtensionList>(&enabled_extensions));
}
}
@@ -413,12 +414,12 @@
if (extension->IsTheme()) {
NotificationService::current()->Notify(
NotificationType::THEME_INSTALLED,
- NotificationService::AllSources(),
+ Source<ExtensionsService>(this),
Details<Extension>(extension));
} else {
NotificationService::current()->Notify(
NotificationType::EXTENSION_INSTALLED,
- NotificationService::AllSources(),
+ Source<ExtensionsService>(this),
Details<Extension>(extension));
}
}
@@ -428,7 +429,7 @@
if (extension && extension->IsTheme()) {
NotificationService::current()->Notify(
NotificationType::THEME_INSTALLED,
- NotificationService::AllSources(),
+ Source<ExtensionsService>(this),
Details<Extension>(extension));
}
}

Powered by Google App Engine
This is Rietveld 408576698