Skip to content

Commit 660bf67

Browse files
stamphobbandix
authored andcommitted
<chromium> Fix Renderer and GPU threads on windows
These threads are using the UI message loop on Windows per default. This won't work since the UI message loop is handled by Qt and the Renderer and GPU threads won't work with it properly. Force these threads for using the default message loop as they use it on Linux platform. Reviewed-by: Andras Becsi <[email protected]> Reviewed-by: Jocelyn Turcotte <[email protected]> Change-Id: I8b04ba9070912378cf1d13173ddff48e98f9a49b Reviewed-by: Zeno Albisser <[email protected]>
1 parent 5beb9a3 commit 660bf67

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

chromium/content/browser/browser_main_loop.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ int BrowserMainLoop::CreateThreads() {
654654
"BrowserMainLoop::CreateThreads:start",
655655
"Thread", "BrowserThread::FILE");
656656
thread_to_start = &file_thread_;
657-
#if defined(OS_WIN)
657+
#if defined(OS_WIN) && !defined(TOOLKIT_QT)
658658
// On Windows, the FILE thread needs to be have a UI message loop
659659
// which pumps messages in such a way that Google Update can
660660
// communicate back to us.

chromium/content/browser/gpu/gpu_process_host.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,13 @@ bool GpuProcessHost::Init() {
577577
switches::kDisableGpuWatchdog);
578578

579579
in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id));
580+
#if defined(OS_WIN) && defined(TOOLKIT_QT)
581+
base::Thread::Options options;
582+
options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
583+
in_process_gpu_thread_->StartWithOptions(options);
584+
#else
580585
in_process_gpu_thread_->Start();
586+
#endif
581587

582588
OnProcessLaunched(); // Fake a callback that the process is ready.
583589
} else if (!LaunchGpuProcess(channel_id)) {

chromium/content/browser/renderer_host/render_process_host_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ bool RenderProcessHostImpl::Init() {
512512
in_process_renderer_.reset(g_renderer_main_thread_factory(channel_id));
513513

514514
base::Thread::Options options;
515-
#if defined(OS_WIN) && !defined(OS_MACOSX)
515+
#if defined(OS_WIN) && !defined(OS_MACOSX) && !defined(TOOLKIT_QT)
516516
// In-process plugins require this to be a UI message loop.
517517
options.message_loop_type = base::MessageLoop::TYPE_UI;
518518
#else

chromium/content/renderer/renderer_main.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ int RendererMain(const MainFunctionParams& parameters) {
161161
// As long as we use Cocoa in the renderer (for the forseeable future as of
162162
// now; see http://crbug.com/306348 for info) we need to have a UI loop.
163163
base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
164+
#elif defined(OS_WIN) && defined(TOOLKIT_QT)
165+
base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
164166
#else
165167
// The main message loop of the renderer services doesn't have IO or UI tasks,
166168
// unless in-process-plugins is used.

0 commit comments

Comments
 (0)