| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 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 power_monitor_(base::MakeUnique<base::PowerMonitorDeviceSource>()), | |
| 54 binding_(this) { | 53 binding_(this) { |
| 54 // TODO: crbug.com/609317: Remove this when Mus Window Server and GPU are |
| 55 // split into separate processes. Until then this is necessary to be able to |
| 56 // run Mushrome (chrome --mus) with Mus running in the browser process. |
| 57 if (!base::PowerMonitor::Get()) { |
| 58 power_monitor_ = base::MakeUnique<base::PowerMonitor>( |
| 59 base::MakeUnique<base::PowerMonitorDeviceSource>()); |
| 60 } |
| 61 |
| 55 base::Thread::Options thread_options; | 62 base::Thread::Options thread_options; |
| 56 | 63 |
| 57 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
| 58 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 65 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
| 59 #elif defined(USE_X11) | 66 #elif defined(USE_X11) |
| 60 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); | 67 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); |
| 61 #elif defined(USE_OZONE) | 68 #elif defined(USE_OZONE) |
| 62 // The MessageLoop type required depends on the Ozone platform selected at | 69 // The MessageLoop type required depends on the Ozone platform selected at |
| 63 // runtime. | 70 // runtime. |
| 64 thread_options.message_loop_type = | 71 thread_options.message_loop_type = |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // TODO(sad): https://crbug.com/645602 | 227 // TODO(sad): https://crbug.com/645602 |
| 221 } | 228 } |
| 222 | 229 |
| 223 bool GpuMain::EnsureSandboxInitialized( | 230 bool GpuMain::EnsureSandboxInitialized( |
| 224 gpu::GpuWatchdogThread* watchdog_thread) { | 231 gpu::GpuWatchdogThread* watchdog_thread) { |
| 225 // TODO(sad): https://crbug.com/645602 | 232 // TODO(sad): https://crbug.com/645602 |
| 226 return true; | 233 return true; |
| 227 } | 234 } |
| 228 | 235 |
| 229 } // namespace ui | 236 } // namespace ui |
| OLD | NEW |