| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #endif // defined(OS_MACOSX) | 45 #endif // defined(OS_MACOSX) |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 namespace ui { | 49 namespace ui { |
| 50 | 50 |
| 51 GpuMain::GpuMain(mojom::GpuMainRequest request) | 51 GpuMain::GpuMain(mojom::GpuMainRequest request) |
| 52 : gpu_thread_("GpuThread"), | 52 : gpu_thread_("GpuThread"), |
| 53 io_thread_("GpuIOThread"), | 53 io_thread_("GpuIOThread"), |
| 54 compositor_thread_("DisplayCompositorThread"), | 54 compositor_thread_("DisplayCompositorThread"), |
| 55 power_monitor_(base::MakeUnique<base::PowerMonitorDeviceSource>()), | |
| 56 binding_(this) { | 55 binding_(this) { |
| 56 // TODO: OK? |
| 57 if (!base::PowerMonitor::Get()) |
| 58 power_monitor_.reset(new base::PowerMonitor( |
| 59 base::MakeUnique<base::PowerMonitorDeviceSource>())); |
| 60 |
| 57 base::Thread::Options thread_options; | 61 base::Thread::Options thread_options; |
| 58 | 62 |
| 59 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
| 60 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 64 thread_options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
| 61 #elif defined(USE_X11) | 65 #elif defined(USE_X11) |
| 62 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); | 66 thread_options.message_pump_factory = base::Bind(&CreateMessagePumpX11); |
| 63 #elif defined(USE_OZONE) | 67 #elif defined(USE_OZONE) |
| 64 // The MessageLoop type required depends on the Ozone platform selected at | 68 // The MessageLoop type required depends on the Ozone platform selected at |
| 65 // runtime. | 69 // runtime. |
| 66 thread_options.message_loop_type = | 70 thread_options.message_loop_type = |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // TODO(sad): https://crbug.com/645602 | 253 // TODO(sad): https://crbug.com/645602 |
| 250 } | 254 } |
| 251 | 255 |
| 252 bool GpuMain::EnsureSandboxInitialized( | 256 bool GpuMain::EnsureSandboxInitialized( |
| 253 gpu::GpuWatchdogThread* watchdog_thread) { | 257 gpu::GpuWatchdogThread* watchdog_thread) { |
| 254 // TODO(sad): https://crbug.com/645602 | 258 // TODO(sad): https://crbug.com/645602 |
| 255 return true; | 259 return true; |
| 256 } | 260 } |
| 257 | 261 |
| 258 } // namespace ui | 262 } // namespace ui |
| OLD | NEW |