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

Unified Diff: chrome/renderer/renderer_main.cc

Issue 155944: Switch the first thread in a child process to be the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 11 years, 5 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/renderer/renderer_main.cc
===================================================================
--- chrome/renderer/renderer_main.cc (revision 21342)
+++ chrome/renderer/renderer_main.cc (working copy)
@@ -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"
@@ -96,8 +97,11 @@
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());
@@ -128,6 +132,7 @@
{
RenderProcess render_process;
+ render_process.set_main_thread(new RenderThread());
bool run_loop = true;
if (!no_sandbox) {
run_loop = platform.EnableSandbox();

Powered by Google App Engine
This is Rietveld 408576698