Make VizCompositorThread TYPE_DEFAULT on Windows.
When Chrome is launched by a service in a console session, which seems
to how Chrome is launched from some automation frameworks, creating a
message only window for MessagePumpForUI fails in the GPU process. As a
result VizCompositorThread fails to run any tasks and nothing is ever
drawn, see https://crbug.com/942023.
The display compositor thread was originally made TYPE_UI on Windows in
https://crrev.com/c/1025954. This was to allow using a child HWND
created in the GPU process for software composited output. That code was
deleted in https://crrev.com/c/1450399 so the thread shouldn't need to
be TYPE_UI anymore.
Bug: 942023
Change-Id: I2a7dbf46a3a772b5ab1a9a20367d3e7f08116cbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549763
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#647967}(cherry picked from commit 200abd62a22a433cc155d6718c2718693654aa61)
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559912
Reviewed-by: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/branch-heads/3729@{#739}
Cr-Branched-From: d4a8972e30b604f090aeda5dfff68386ae656267-refs/heads/master@{#638880}
diff --git a/components/viz/service/main/viz_compositor_thread_runner.cc b/components/viz/service/main/viz_compositor_thread_runner.cc
index 9585baf..6e0a544 100644
--- a/components/viz/service/main/viz_compositor_thread_runner.cc
+++ b/components/viz/service/main/viz_compositor_thread_runner.cc
@@ -49,10 +49,7 @@
auto thread = std::make_unique<base::Thread>(kThreadName);
base::Thread::Options thread_options;
-#if defined(OS_WIN)
- // Windows needs a UI message loop for child HWND.
- thread_options.message_loop_type = base::MessageLoop::TYPE_UI;
-#elif defined(USE_OZONE)
+#if defined(USE_OZONE)
// We may need a non-default message loop type for the platform surface.
thread_options.message_loop_type =
ui::OzonePlatform::GetInstance()->GetMessageLoopTypeForGpu();