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

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

Issue 6880089: Don't hold the installed app in BrowserProcessRenderHost, since that's in content layer now. Ext... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browser tests Created 9 years, 8 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
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/isolated_app_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
===================================================================
--- chrome/browser/extensions/extension_service.cc (revision 82593)
+++ chrome/browser/extensions/extension_service.cc (working copy)
@@ -68,6 +68,7 @@
#include "content/browser/browser_thread.h"
#include "content/browser/plugin_process_host.h"
#include "content/browser/plugin_service.h"
+#include "content/browser/renderer_host/render_process_host.h"
#include "content/common/json_value_serializer.h"
#include "content/common/notification_service.h"
#include "content/common/notification_type.h"
@@ -387,6 +388,19 @@
return !!GetInstalledApp(url);
}
+void ExtensionService::SetInstalledAppForRenderer(int renderer_child_id,
+ const Extension* app) {
+ installed_app_hosts_[renderer_child_id] = app;
+}
+
+const Extension* ExtensionService::GetInstalledAppForRenderer(
+ int renderer_child_id) {
+ InstalledAppMap::iterator i = installed_app_hosts_.find(renderer_child_id);
+ if (i == installed_app_hosts_.end())
+ return NULL;
+ return i->second;
+}
+
// static
// This function is used to implement the command-line switch
// --uninstall-extension. The LOG statements within this function are used to
@@ -448,6 +462,8 @@
registrar_.Add(this, NotificationType::EXTENSION_PROCESS_TERMINATED,
NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED,
+ NotificationService::AllSources());
pref_change_registrar_.Init(profile->GetPrefs());
pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, this);
pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, this);
@@ -1990,7 +2006,11 @@
UnloadedExtensionInfo::DISABLE));
break;
}
-
+ case NotificationType::RENDERER_PROCESS_TERMINATED: {
+ RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
+ installed_app_hosts_.erase(process->id());
+ break;
+ }
case NotificationType::PREF_CHANGED: {
std::string* pref_name = Details<std::string>(details).ptr();
if (*pref_name == prefs::kExtensionInstallAllowList ||
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/isolated_app_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698