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

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

Issue 7328029: Use process-per-app-instance for hosted apps without background permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update tests. Created 9 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: chrome/browser/extensions/extension_process_manager.cc
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 4be0f74e962643568eceed30095aa89af5179832..2ef8e63e90b66fad41c092cee463192d77f4bba0 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -95,10 +95,6 @@ ExtensionProcessManager::ExtensionProcessManager(Profile* profile)
Source<Profile>(original_profile));
registrar_.Add(this, NotificationType::EXTENSION_HOST_DESTROYED,
Source<Profile>(profile));
- registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED,
- NotificationService::AllSources());
- registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED,
- NotificationService::AllSources());
registrar_.Add(this, NotificationType::APP_TERMINATING,
NotificationService::AllSources());
}
@@ -220,30 +216,6 @@ ExtensionHost* ExtensionProcessManager::GetBackgroundHostForExtension(
return NULL;
}
-void ExtensionProcessManager::RegisterExtensionProcess(
- const std::string& extension_id, int process_id) {
- // TODO(mpcomplete): This is the only place we actually read process_ids_.
- // Is it necessary?
- ProcessIDMap::const_iterator it = process_ids_.find(extension_id);
- if (it != process_ids_.end() && (*it).second == process_id)
- return;
-
- // Extension ids should get removed from the map before the process ids get
- // reused from a dead renderer.
- DCHECK(it == process_ids_.end());
- process_ids_[extension_id] = process_id;
-}
-
-void ExtensionProcessManager::UnregisterExtensionProcess(int process_id) {
- ProcessIDMap::iterator it = process_ids_.begin();
- while (it != process_ids_.end()) {
- if (it->second == process_id)
- process_ids_.erase(it++);
- else
- ++it;
- }
-}
-
RenderProcessHost* ExtensionProcessManager::GetExtensionProcess(
const GURL& url) {
if (!browsing_instance_->HasSiteInstance(url))
@@ -312,13 +284,6 @@ void ExtensionProcessManager::Observe(NotificationType type,
break;
}
- case NotificationType::RENDERER_PROCESS_TERMINATED:
- case NotificationType::RENDERER_PROCESS_CLOSED: {
- RenderProcessHost* host = Source<RenderProcessHost>(source).ptr();
- UnregisterExtensionProcess(host->id());
- break;
- }
-
case NotificationType::APP_TERMINATING: {
// Close background hosts when the last browser is closed so that they
// have time to shutdown various objects on different threads. Our

Powered by Google App Engine
This is Rietveld 408576698