| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/gpu/gpu_child_thread.h" | 5 #include "content/gpu/gpu_child_thread.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 builder.AddStartupFilter( | 128 builder.AddStartupFilter( |
| 129 new GpuMemoryBufferMessageFilter(gpu_memory_buffer_factory)); | 129 new GpuMemoryBufferMessageFilter(gpu_memory_buffer_factory)); |
| 130 | 130 |
| 131 #if defined(USE_OZONE) | 131 #if defined(USE_OZONE) |
| 132 IPC::MessageFilter* message_filter = ui::OzonePlatform::GetInstance() | 132 IPC::MessageFilter* message_filter = ui::OzonePlatform::GetInstance() |
| 133 ->GetGpuPlatformSupport() | 133 ->GetGpuPlatformSupport() |
| 134 ->GetMessageFilter(); | 134 ->GetMessageFilter(); |
| 135 if (message_filter) | 135 if (message_filter) |
| 136 builder.AddStartupFilter(message_filter); | 136 builder.AddStartupFilter(message_filter); |
| 137 #endif | 137 #endif |
| 138 builder.UseMojoShellConnection(true); | |
| 139 | 138 |
| 140 return builder.Build(); | 139 return builder.Build(); |
| 141 } | 140 } |
| 142 | 141 |
| 143 } // namespace | 142 } // namespace |
| 144 | 143 |
| 145 // static | 144 // static |
| 146 GpuChildThread* GpuChildThread::current() { | 145 GpuChildThread* GpuChildThread::current() { |
| 147 return g_lazy_tls.Pointer()->Get(); | 146 return g_lazy_tls.Pointer()->Get(); |
| 148 } | 147 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 168 } | 167 } |
| 169 | 168 |
| 170 GpuChildThread::GpuChildThread( | 169 GpuChildThread::GpuChildThread( |
| 171 const gpu::GpuPreferences& gpu_preferences, | 170 const gpu::GpuPreferences& gpu_preferences, |
| 172 const InProcessChildThreadParams& params, | 171 const InProcessChildThreadParams& params, |
| 173 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory) | 172 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory) |
| 174 : ChildThreadImpl(ChildThreadImpl::Options::Builder() | 173 : ChildThreadImpl(ChildThreadImpl::Options::Builder() |
| 175 .InBrowserProcess(params) | 174 .InBrowserProcess(params) |
| 176 .AddStartupFilter(new GpuMemoryBufferMessageFilter( | 175 .AddStartupFilter(new GpuMemoryBufferMessageFilter( |
| 177 gpu_memory_buffer_factory)) | 176 gpu_memory_buffer_factory)) |
| 178 .UseMojoShellConnection(true) | |
| 179 .Build()), | 177 .Build()), |
| 180 gpu_preferences_(gpu_preferences), | 178 gpu_preferences_(gpu_preferences), |
| 181 dead_on_arrival_(false), | 179 dead_on_arrival_(false), |
| 182 in_browser_process_(true), | 180 in_browser_process_(true), |
| 183 gpu_memory_buffer_factory_(gpu_memory_buffer_factory) { | 181 gpu_memory_buffer_factory_(gpu_memory_buffer_factory) { |
| 184 #if defined(OS_WIN) | 182 #if defined(OS_WIN) |
| 185 target_services_ = NULL; | 183 target_services_ = NULL; |
| 186 #endif | 184 #endif |
| 187 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 185 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 188 switches::kSingleProcess) || | 186 switches::kSingleProcess) || |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 570 |
| 573 void GpuChildThread::BindProcessControlRequest( | 571 void GpuChildThread::BindProcessControlRequest( |
| 574 mojo::InterfaceRequest<mojom::ProcessControl> request) { | 572 mojo::InterfaceRequest<mojom::ProcessControl> request) { |
| 575 DVLOG(1) << "GPU: Binding ProcessControl request"; | 573 DVLOG(1) << "GPU: Binding ProcessControl request"; |
| 576 DCHECK(process_control_); | 574 DCHECK(process_control_); |
| 577 process_control_bindings_.AddBinding(process_control_.get(), | 575 process_control_bindings_.AddBinding(process_control_.get(), |
| 578 std::move(request)); | 576 std::move(request)); |
| 579 } | 577 } |
| 580 | 578 |
| 581 } // namespace content | 579 } // namespace content |
| OLD | NEW |