diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-19 00:55:01 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-19 00:55:01 +0000 |
commit | 687ae4f97e99640cfd8e5bf913587015357c4c82 (patch) | |
tree | eb4b58298482fd33ca9162e1675c40feb8af7516 | |
parent | c47b7300a746a237d5641476132636f1ad0cc43c (diff) | |
download | chromium_src-687ae4f97e99640cfd8e5bf913587015357c4c82.zip chromium_src-687ae4f97e99640cfd8e5bf913587015357c4c82.tar.gz chromium_src-687ae4f97e99640cfd8e5bf913587015357c4c82.tar.bz2 |
Fix single process mode in content_shell.
Review URL: https://chromiumcodereview.appspot.com/10115048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132907 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/chrome_main_delegate.cc | 9 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main.cc | 8 | ||||
-rw-r--r-- | content/browser/browser_main_runner.cc | 4 | ||||
-rw-r--r-- | content/shell/shell_main_delegate.cc | 5 |
4 files changed, 17 insertions, 9 deletions
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index 813b99d..83a1b6c 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -30,7 +30,6 @@ #include "chrome/renderer/chrome_content_renderer_client.h" #include "chrome/utility/chrome_content_utility_client.h" #include "content/common/content_counters.h" -#include "content/public/browser/render_process_host.h" #include "content/public/common/content_client.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" @@ -580,14 +579,8 @@ void ChromeMainDelegate::PreSandboxStartup() { if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) MessageLoop::EnableHistogrammer(true); - // Single-process is an unsupported and not fully tested mode, so - // don't enable it for official Chrome builds. -#if !defined(GOOGLE_CHROME_BUILD) - if (command_line.HasSwitch(switches::kSingleProcess)) { - content::RenderProcessHost::set_run_renderer_in_process(true); + if (command_line.HasSwitch(switches::kSingleProcess)) InitializeChromeContentRendererClient(); - } -#endif // GOOGLE_CHROME_BUILD logging::OldFileDeletionState file_state = logging::APPEND_TO_OLD_LOG_FILE; diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 1b4dcef..957c1be 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -98,6 +98,7 @@ #include "chrome/installer/util/google_update_settings.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/gpu_data_manager.h" +#include "content/public/browser/render_process_host.h" #include "content/public/common/content_client.h" #include "content/public/common/main_function_params.h" #include "grit/app_locale_settings.h" @@ -1111,6 +1112,13 @@ DLLEXPORT void __cdecl RelaunchChromeBrowserWithNewCommandLineIfNeeded() { // content::BrowserMainParts implementation ------------------------------------ void ChromeBrowserMainParts::PreEarlyInitialization() { + // Single-process is an unsupported and not fully tested mode, so + // don't enable it for official Chrome builds (by not setting the client, the +#if defined(GOOGLE_CHROME_BUILD) + if (content::RenderProcessHost::run_renderer_in_process()) + content::RenderProcessHost::set_run_renderer_in_process(false); +#endif // GOOGLE_CHROME_BUILD + for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) chrome_extra_parts_[i]->PreEarlyInitialization(); } diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index 05a2cb2..f859683 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc @@ -13,6 +13,7 @@ #include "content/browser/browser_main_loop.h" #include "content/browser/notification_service_impl.h" #include "content/common/child_process.h" +#include "content/public/browser/render_process_host.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" @@ -47,6 +48,9 @@ class BrowserMainRunnerImpl : public content::BrowserMainRunner { if (parameters.command_line.HasSwitch(switches::kWaitForDebugger)) ChildProcess::WaitForDebugger("Browser"); + if (parameters.command_line.HasSwitch(switches::kSingleProcess)) + content::RenderProcessHost::set_run_renderer_in_process(true); + statistics_.reset(new base::StatisticsRecorder); notification_service_.reset(new NotificationServiceImpl); diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc index 01157ab..031f031 100644 --- a/content/shell/shell_main_delegate.cc +++ b/content/shell/shell_main_delegate.cc @@ -97,7 +97,10 @@ void ShellMainDelegate::InitializeShellContentClient( if (process_type.empty()) { browser_client_.reset(new content::ShellContentBrowserClient); content::GetContentClient()->set_browser(browser_client_.get()); - } else if (process_type == switches::kRendererProcess) { + } + + if (process_type == switches::kRendererProcess || + CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { renderer_client_.reset(new content::ShellContentRendererClient); content::GetContentClient()->set_renderer(renderer_client_.get()); } else if (process_type == switches::kPluginProcess) { |