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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "ui/gl/gl_switches.h" | 45 #include "ui/gl/gl_switches.h" |
46 #include "ui/gl/gpu_switching_manager.h" | 46 #include "ui/gl/gpu_switching_manager.h" |
47 #include "ui/gl/init/gl_factory.h" | 47 #include "ui/gl/init/gl_factory.h" |
48 #include "url/gurl.h" | 48 #include "url/gurl.h" |
49 | 49 |
50 #if defined(USE_OZONE) | 50 #if defined(USE_OZONE) |
51 #include "ui/ozone/public/ozone_platform.h" | 51 #include "ui/ozone/public/ozone_platform.h" |
52 #endif | 52 #endif |
53 | 53 |
54 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
55 #include "media/base/android/media_client_android.h" | 55 #include "media/base/android/media_drm_bridge_client.h" |
56 #endif | 56 #endif |
57 | 57 |
58 namespace content { | 58 namespace content { |
59 namespace { | 59 namespace { |
60 | 60 |
61 static base::LazyInstance<scoped_refptr<ThreadSafeSender>>::DestructorAtExit | 61 static base::LazyInstance<scoped_refptr<ThreadSafeSender>>::DestructorAtExit |
62 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; | 62 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; |
63 | 63 |
64 bool GpuProcessLogMessageHandler(int severity, | 64 bool GpuProcessLogMessageHandler(int severity, |
65 const char* file, int line, | 65 const char* file, int line, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 logging::SetLogMessageHandler(NULL); | 206 logging::SetLogMessageHandler(NULL); |
207 } | 207 } |
208 | 208 |
209 void GpuChildThread::Init(const base::Time& process_start_time) { | 209 void GpuChildThread::Init(const base::Time& process_start_time) { |
210 process_start_time_ = process_start_time; | 210 process_start_time_ = process_start_time; |
211 | 211 |
212 #if defined(OS_ANDROID) | 212 #if defined(OS_ANDROID) |
213 // When running in in-process mode, this has been set in the browser at | 213 // When running in in-process mode, this has been set in the browser at |
214 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). | 214 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). |
215 if (!in_browser_process_) | 215 if (!in_browser_process_) |
216 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); | 216 media::SetMediaDrmBridgeClient( |
| 217 GetContentClient()->GetMediaDrmBridgeClient()); |
217 #endif | 218 #endif |
218 // We don't want to process any incoming interface requests until | 219 // We don't want to process any incoming interface requests until |
219 // OnInitialize() is invoked. | 220 // OnInitialize() is invoked. |
220 GetInterfaceRegistry()->PauseBinding(); | 221 GetInterfaceRegistry()->PauseBinding(); |
221 | 222 |
222 if (GetContentClient()->gpu()) // NULL in tests. | 223 if (GetContentClient()->gpu()) // NULL in tests. |
223 GetContentClient()->gpu()->Initialize(this); | 224 GetContentClient()->gpu()->Initialize(this); |
224 AssociatedInterfaceRegistry* registry = &associated_interfaces_; | 225 AssociatedInterfaceRegistry* registry = &associated_interfaces_; |
225 registry->AddInterface(base::Bind( | 226 registry->AddInterface(base::Bind( |
226 &GpuChildThread::CreateGpuMainService, base::Unretained(this))); | 227 &GpuChildThread::CreateGpuMainService, base::Unretained(this))); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 421 |
421 void GpuChildThread::BindServiceFactoryRequest( | 422 void GpuChildThread::BindServiceFactoryRequest( |
422 service_manager::mojom::ServiceFactoryRequest request) { | 423 service_manager::mojom::ServiceFactoryRequest request) { |
423 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; | 424 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; |
424 DCHECK(service_factory_); | 425 DCHECK(service_factory_); |
425 service_factory_bindings_.AddBinding(service_factory_.get(), | 426 service_factory_bindings_.AddBinding(service_factory_.get(), |
426 std::move(request)); | 427 std::move(request)); |
427 } | 428 } |
428 | 429 |
429 } // namespace content | 430 } // namespace content |
OLD | NEW |