summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_service.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-23 17:12:21 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-23 17:12:21 +0000
commitda5683db1bbf401694c72f7d4216f38249ac2c13 (patch)
tree458e91e25e3c033bf1296de4b58e24cb1b7022d9 /chrome/browser/extensions/extension_service.cc
parent77a6970c962882244b57219681acd109acd9f3fc (diff)
downloadchromium_src-da5683db1bbf401694c72f7d4216f38249ac2c13.zip
chromium_src-da5683db1bbf401694c72f7d4216f38249ac2c13.tar.gz
chromium_src-da5683db1bbf401694c72f7d4216f38249ac2c13.tar.bz2
Don't hold the installed app in BrowserProcessRenderHost, since that's in content layer now. ExtensionService keeps a map from renderer child ids to installed extensions instead.
Review URL: http://codereview.chromium.org/6880089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_service.cc')
-rw-r--r--chrome/browser/extensions/extension_service.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 00f1800..0462912 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -377,6 +377,19 @@ bool ExtensionService::IsInstalledApp(const GURL& url) {
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
@@ -440,6 +453,8 @@ ExtensionService::ExtensionService(Profile* profile,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED,
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);
@@ -2062,6 +2077,11 @@ void ExtensionService::Observe(NotificationType type,
}
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 ||