| 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 "gpu/ipc/common/gpu_memory_buffer_support.h" | 8 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 9 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 9 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| 10 #include "gpu/ipc/service/gpu_watchdog_thread.h" | 10 #include "gpu/ipc/service/gpu_watchdog_thread.h" |
| 11 #include "services/ui/gpu/gpu_service_internal.h" | 11 #include "services/ui/gpu/gpu_service_internal.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 GpuMain::GpuMain() { | 15 GpuMain::GpuMain(shell::Connector* connector) { |
| 16 gpu_init_.set_sandbox_helper(this); | 16 gpu_init_.set_sandbox_helper(this); |
| 17 bool success = gpu_init_.InitializeAndStartSandbox( | 17 bool success = gpu_init_.InitializeAndStartSandbox( |
| 18 *base::CommandLine::ForCurrentProcess()); | 18 *base::CommandLine::ForCurrentProcess(), connector); |
| 19 if (success) { | 19 if (success) { |
| 20 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) { | 20 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) { |
| 21 gpu_memory_buffer_factory_ = | 21 gpu_memory_buffer_factory_ = |
| 22 gpu::GpuMemoryBufferFactory::CreateNativeType(); | 22 gpu::GpuMemoryBufferFactory::CreateNativeType(); |
| 23 } | 23 } |
| 24 gpu_service_internal_.reset(new GpuServiceInternal( | 24 gpu_service_internal_.reset(new GpuServiceInternal( |
| 25 gpu_init_.gpu_info(), gpu_init_.watchdog_thread(), | 25 gpu_init_.gpu_info(), gpu_init_.watchdog_thread(), |
| 26 gpu_memory_buffer_factory_.get())); | 26 gpu_memory_buffer_factory_.get())); |
| 27 } | 27 } |
| 28 } | 28 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 40 void GpuMain::PreSandboxStartup() { | 40 void GpuMain::PreSandboxStartup() { |
| 41 // TODO(sad): https://crbug.com/645602 | 41 // TODO(sad): https://crbug.com/645602 |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool GpuMain::EnsureSandboxInitialized() { | 44 bool GpuMain::EnsureSandboxInitialized() { |
| 45 // TODO(sad): https://crbug.com/645602 | 45 // TODO(sad): https://crbug.com/645602 |
| 46 return true; | 46 return true; |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace ui | 49 } // namespace ui |
| OLD | NEW |