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

Side by Side Diff: services/ui/gpu/gpu_main.cc

Issue 2629983002: Fix the MessageLoop type in case more than one ozone platform is built (Closed)
Patch Set: addressed kbr's feedback Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | ui/ozone/platform/x11/ozone_platform_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/gpu/gpu_main.h" 5 #include "services/ui/gpu/gpu_main.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
11 #include "gpu/ipc/gpu_in_process_thread_service.h" 11 #include "gpu/ipc/gpu_in_process_thread_service.h"
12 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 12 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
13 #include "gpu/ipc/service/gpu_watchdog_thread.h" 13 #include "gpu/ipc/service/gpu_watchdog_thread.h"
14 #include "services/ui/common/server_gpu_memory_buffer_manager.h" 14 #include "services/ui/common/server_gpu_memory_buffer_manager.h"
15 #include "services/ui/gpu/gpu_service.h" 15 #include "services/ui/gpu/gpu_service.h"
16 16
17 #if defined(USE_OZONE)
18 #include "ui/ozone/public/ozone_platform.h"
19 #endif
20
17 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
18 #include "base/message_loop/message_pump_mac.h" 22 #include "base/message_loop/message_pump_mac.h"
19 #endif 23 #endif
20 24
21 namespace { 25 namespace {
22 26
23 #if defined(USE_X11) 27 #if defined(USE_X11)
24 std::unique_ptr<base::MessagePump> CreateMessagePumpX11() { 28 std::unique_ptr<base::MessagePump> CreateMessagePumpX11() {
25 // TODO(sad): This should create a TYPE_UI message pump, and create a 29 // TODO(sad): This should create a TYPE_UI message pump, and create a
26 // PlatformEventSource when gpu process split happens. 30 // PlatformEventSource when gpu process split happens.
(...skipping 17 matching lines...) Expand all
44 io_thread_("GpuIOThread"), 48 io_thread_("GpuIOThread"),
45 compositor_thread_("DisplayCompositorThread"), 49 compositor_thread_("DisplayCompositorThread"),
46 binding_(this, std::move(request)) { 50 binding_(this, std::move(request)) {
47 base::Thread::Options thread_options; 51 base::Thread::Options thread_options;
48 52
49 #if defined(OS_WIN) 53 #if defined(OS_WIN)
50 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; 54 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
51 #elif defined(USE_X11) 55 #elif defined(USE_X11)
52 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); 56 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11);
53 #elif defined(USE_OZONE) 57 #elif defined(USE_OZONE)
54 thread_options.message_loop_type = base::MessageLoop::TYPE_UI; 58 // The MessageLoop type required depends on the Ozone platform selected at
59 // runtime.
60 thread_options.message_loop_type =
61 ui::OzonePlatform::EnsureInstance()->GetMessageLoopTypeForGpu();
55 #elif defined(OS_LINUX) 62 #elif defined(OS_LINUX)
56 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; 63 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
57 #elif defined(OS_MACOSX) 64 #elif defined(OS_MACOSX)
58 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpMac); 65 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpMac);
59 #else 66 #else
60 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; 67 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
61 #endif 68 #endif
62 69
63 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 70 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
64 thread_options.priority = base::ThreadPriority::DISPLAY; 71 thread_options.priority = base::ThreadPriority::DISPLAY;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // TODO(sad): https://crbug.com/645602 245 // TODO(sad): https://crbug.com/645602
239 } 246 }
240 247
241 bool GpuMain::EnsureSandboxInitialized( 248 bool GpuMain::EnsureSandboxInitialized(
242 gpu::GpuWatchdogThread* watchdog_thread) { 249 gpu::GpuWatchdogThread* watchdog_thread) {
243 // TODO(sad): https://crbug.com/645602 250 // TODO(sad): https://crbug.com/645602
244 return true; 251 return true;
245 } 252 }
246 253
247 } // namespace ui 254 } // namespace ui
OLDNEW
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | ui/ozone/platform/x11/ozone_platform_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698