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

Unified Diff: extensions/browser/process_manager.cc

Issue 415933003: Remove chrome::NOTIFICATION_PROFILE_DESTROYED usage from src/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 5 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: extensions/browser/process_manager.cc
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index 72fbd2c686f5613723e0fe4e0010223b85d6e447..d111d629b5a460cb38c4065c78ac39cded566d98 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -263,12 +263,6 @@ ProcessManager::ProcessManager(BrowserContext* context,
content::NotificationService::AllSources());
registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
content::NotificationService::AllSources());
- registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
- content::Source<BrowserContext>(context));
- if (context->IsOffTheRecord()) {
- registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
- content::Source<BrowserContext>(original_context));
- }
// Note: event_page_idle_time_ must be sufficiently larger (e.g. 2x) than
// kKeepaliveThrottleIntervalInSeconds in ppapi/proxy/plugin_globals.
@@ -633,6 +627,14 @@ void ProcessManager::CancelSuspend(const Extension* extension) {
}
}
+void ProcessManager::CloseBackgroundHosts() {
James Cook 2014/07/24 18:27:54 Moved unchanged from below to match declaration or
+ for (ExtensionHostSet::iterator iter = background_hosts_.begin();
+ iter != background_hosts_.end();) {
+ ExtensionHostSet::iterator current = iter++;
+ delete *current;
+ }
+}
+
content::BrowserContext* ProcessManager::GetBrowserContext() const {
return site_instance_->GetBrowserContext();
}
@@ -745,14 +747,6 @@ void ProcessManager::Observe(int type,
break;
}
- case chrome::NOTIFICATION_PROFILE_DESTROYED: {
- // Close background hosts when the last browser is closed so that they
- // have time to shutdown various objects on different threads. Our
- // destructor is called too late in the shutdown sequence.
- CloseBackgroundHosts();
- break;
- }
-
default:
NOTREACHED();
}
@@ -854,14 +848,6 @@ void ProcessManager::CloseBackgroundHost(ExtensionHost* host) {
CHECK(background_hosts_.find(host) == background_hosts_.end());
}
-void ProcessManager::CloseBackgroundHosts() {
- for (ExtensionHostSet::iterator iter = background_hosts_.begin();
- iter != background_hosts_.end(); ) {
- ExtensionHostSet::iterator current = iter++;
- delete *current;
- }
-}
-
void ProcessManager::UnregisterExtension(const std::string& extension_id) {
// The lazy_keepalive_count may be greater than zero at this point because
// RenderViewHosts are still alive. During extension reloading, they will

Powered by Google App Engine
This is Rietveld 408576698