diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-20 22:20:20 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-20 22:20:20 +0000 |
commit | f717ea6403554cc60a5dd9312fe585cdf64a8815 (patch) | |
tree | 523186875fe4c36bcc1c6905b3da36943a174318 /chrome/renderer/renderer_main.cc | |
parent | e74b81de4f2785b5cff5cb0cc85e76b3d434248e (diff) | |
download | chromium_src-f717ea6403554cc60a5dd9312fe585cdf64a8815.zip chromium_src-f717ea6403554cc60a5dd9312fe585cdf64a8815.tar.gz chromium_src-f717ea6403554cc60a5dd9312fe585cdf64a8815.tar.bz2 |
Switch the first thread in a child process to be the main thread, and make the IO thread be the second thread. The change is needed for plugins on mac.
Review URL: http://codereview.chromium.org/149558
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_main.cc')
-rw-r--r-- | chrome/renderer/renderer_main.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc index 2dfe061..f0980bd 100644 --- a/chrome/renderer/renderer_main.cc +++ b/chrome/renderer/renderer_main.cc @@ -22,6 +22,7 @@ #include "chrome/common/main_function_params.h" #include "chrome/renderer/renderer_main_platform_delegate.h" #include "chrome/renderer/render_process.h" +#include "chrome/renderer/render_thread.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -84,8 +85,11 @@ int RendererMain(const MainFunctionParams& parameters) { StatsScope<StatsCounterTimer> startup_timer(chrome::Counters::renderer_main()); - // The main thread of the renderer services IO. - MessageLoopForIO main_message_loop; + // The main message loop of the renderer services doesn't have IO or UI tasks, + // unless in-process-plugins is used. + MessageLoop main_message_loop(RenderProcess::InProcessPlugins() ? + MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); + std::wstring app_name = chrome::kBrowserAppName; PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); @@ -116,6 +120,7 @@ int RendererMain(const MainFunctionParams& parameters) { { RenderProcess render_process; + render_process.set_main_thread(new RenderThread()); bool run_loop = true; if (!no_sandbox) { run_loop = platform.EnableSandbox(); |