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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 8113035: Remove RenderProcessHost::is_extension_process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4709e327f89d2f5602a9fcc1afc94f195fef5454..b07e9b39e611f3d26144d2d68959da47ff47b876 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -266,9 +266,7 @@ bool ChromeContentBrowserClient::IsSuitableHost(
return true;
bool is_extension_host =
- process_host->is_extension_process() ||
- extension_process_manager->AreBindingsEnabledForProcess(
- process_host->id());
+ extension_process_manager->IsExtensionProcess(process_host->id());
return site_url.SchemeIs(chrome::kExtensionScheme) == is_extension_host;
}
@@ -297,8 +295,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
std::string process_type =
command_line->GetSwitchValueASCII(switches::kProcessType);
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- if (process_type == switches::kExtensionProcess ||
- process_type == switches::kRendererProcess) {
+ if (process_type == switches::kRendererProcess) {
FilePath user_data_dir =
browser_command_line.GetSwitchValuePath(switches::kUserDataDir);
if (!user_data_dir.empty())
@@ -313,6 +310,14 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
RenderProcessHost* process = RenderProcessHost::FromID(child_process_id);
Profile* profile = Profile::FromBrowserContext(process->browser_context());
+
+ ExtensionProcessManager* extension_process_manager =
+ profile->GetExtensionProcessManager();
+ if (extension_process_manager->IsExtensionProcess(
+ process->id())) {
+ command_line->AppendSwitch(switches::kExtensionProcess);
+ }
+
PrefService* prefs = profile->GetPrefs();
// Currently this pref is only registered if applied via a policy.
if (prefs->HasPrefPath(prefs::kDisable3DAPIs) &&
@@ -795,16 +800,20 @@ FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
#if defined(OS_LINUX)
int ChromeContentBrowserClient::GetCrashSignalFD(
- const std::string& process_type) {
- if (process_type == switches::kRendererProcess)
- return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
-
- if (process_type == switches::kExtensionProcess) {
+ const CommandLine* command_line) {
+ if (command_line->HasSwitch(switches::kExtensionProcess)) {
ExtensionCrashHandlerHostLinux* crash_handler =
ExtensionCrashHandlerHostLinux::GetInstance();
return crash_handler->GetDeathSignalSocket();
}
+ std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+
+ if (process_type == switches::kRendererProcess)
+ return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
+
+
jam 2011/10/04 16:59:22 nit: extra line
jochen (gone - plz use gerrit) 2011/10/04 18:50:19 Done.
if (process_type == switches::kPluginProcess)
return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();

Powered by Google App Engine
This is Rietveld 408576698