OLD | NEW |
---|---|
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 "base/power_monitor/power_monitor_device_source.h" | 10 #include "base/power_monitor/power_monitor_device_source.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 #endif // defined(OS_MACOSX) | 44 #endif // defined(OS_MACOSX) |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 namespace ui { | 48 namespace ui { |
49 | 49 |
50 GpuMain::GpuMain(mojom::GpuMainRequest request) | 50 GpuMain::GpuMain(mojom::GpuMainRequest request) |
51 : gpu_thread_("GpuThread"), | 51 : gpu_thread_("GpuThread"), |
52 io_thread_("GpuIOThread"), | 52 io_thread_("GpuIOThread"), |
53 compositor_thread_("DisplayCompositorThread"), | 53 compositor_thread_("DisplayCompositorThread"), |
54 power_monitor_(base::MakeUnique<base::PowerMonitorDeviceSource>()), | |
55 binding_(this) { | 54 binding_(this) { |
55 // TODO: crbug.com/609317: Remove this when Mus Window Server and GPU are | |
56 // split into separate processes. Until then this is necessary to be able to | |
57 // run Mushrome (chrome --mus) with Mus running in the browser process. | |
58 if (!base::PowerMonitor::Get()) { | |
59 power_monitor_.reset(new base::PowerMonitor( | |
sky
2017/06/27 19:58:56
MakeUnique for PowerMonitor too?
mfomitchev
2017/07/11 21:46:59
Done.
| |
60 base::MakeUnique<base::PowerMonitorDeviceSource>())); | |
61 } | |
62 | |
56 base::Thread::Options thread_options; | 63 base::Thread::Options thread_options; |
57 | 64 |
58 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
59 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 66 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
60 #elif defined(USE_X11) | 67 #elif defined(USE_X11) |
61 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); | 68 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); |
62 #elif defined(USE_OZONE) | 69 #elif defined(USE_OZONE) |
63 // The MessageLoop type required depends on the Ozone platform selected at | 70 // The MessageLoop type required depends on the Ozone platform selected at |
64 // runtime. | 71 // runtime. |
65 thread_options.message_loop_type = | 72 thread_options.message_loop_type = |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 // TODO(sad): https://crbug.com/645602 | 236 // TODO(sad): https://crbug.com/645602 |
230 } | 237 } |
231 | 238 |
232 bool GpuMain::EnsureSandboxInitialized( | 239 bool GpuMain::EnsureSandboxInitialized( |
233 gpu::GpuWatchdogThread* watchdog_thread) { | 240 gpu::GpuWatchdogThread* watchdog_thread) { |
234 // TODO(sad): https://crbug.com/645602 | 241 // TODO(sad): https://crbug.com/645602 |
235 return true; | 242 return true; |
236 } | 243 } |
237 | 244 |
238 } // namespace ui | 245 } // namespace ui |
OLD | NEW |