Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 2864603002: Provide callback to create mojo AndroidOverlays to AVDA. (Closed)
Patch Set: rebased Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | media/base/android_overlay_mojo_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 18 matching lines...) Expand all
29 #include "services/service_manager/public/cpp/binder_registry.h" 29 #include "services/service_manager/public/cpp/binder_registry.h"
30 #include "services/service_manager/public/cpp/connector.h" 30 #include "services/service_manager/public/cpp/connector.h"
31 #include "services/ui/gpu/interfaces/gpu_service.mojom.h" 31 #include "services/ui/gpu/interfaces/gpu_service.mojom.h"
32 32
33 #if defined(USE_OZONE) 33 #if defined(USE_OZONE)
34 #include "ui/ozone/public/ozone_platform.h" 34 #include "ui/ozone/public/ozone_platform.h"
35 #endif 35 #endif
36 36
37 #if defined(OS_ANDROID) 37 #if defined(OS_ANDROID)
38 #include "media/base/android/media_drm_bridge_client.h" 38 #include "media/base/android/media_drm_bridge_client.h"
39 #include "media/mojo/clients/mojo_android_overlay.h"
39 #endif 40 #endif
40 41
41 namespace content { 42 namespace content {
42 namespace { 43 namespace {
43 44
44 ChildThreadImpl::Options GetOptions() { 45 ChildThreadImpl::Options GetOptions() {
45 ChildThreadImpl::Options::Builder builder; 46 ChildThreadImpl::Options::Builder builder;
46 47
47 #if defined(USE_OZONE) 48 #if defined(USE_OZONE)
48 IPC::MessageFilter* message_filter = 49 IPC::MessageFilter* message_filter =
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 gpu_service_->InitializeWithHost( 278 gpu_service_->InitializeWithHost(
278 std::move(gpu_host), 279 std::move(gpu_host),
279 gpu::GpuProcessActivityFlags(std::move(activity_flags)), 280 gpu::GpuProcessActivityFlags(std::move(activity_flags)),
280 sync_point_manager, ChildProcess::current()->GetShutDownEvent()); 281 sync_point_manager, ChildProcess::current()->GetShutDownEvent());
281 CHECK(gpu_service_->media_gpu_channel_manager()); 282 CHECK(gpu_service_->media_gpu_channel_manager());
282 283
283 // Only set once per process instance. 284 // Only set once per process instance.
284 service_factory_.reset(new GpuServiceFactory( 285 service_factory_.reset(new GpuServiceFactory(
285 gpu_service_->media_gpu_channel_manager()->AsWeakPtr())); 286 gpu_service_->media_gpu_channel_manager()->AsWeakPtr()));
286 287
288 #if defined(OS_ANDROID)
289 gpu_service_->media_gpu_channel_manager()->SetOverlayFactory(
290 base::Bind(&GpuChildThread::CreateAndroidOverlay));
291 #endif
292
287 if (GetContentClient()->gpu()) // NULL in tests. 293 if (GetContentClient()->gpu()) // NULL in tests.
288 GetContentClient()->gpu()->GpuServiceInitialized(gpu_preferences); 294 GetContentClient()->gpu()->GpuServiceInitialized(gpu_preferences);
289 295
290 release_pending_requests_closure_.Run(); 296 release_pending_requests_closure_.Run();
291 } 297 }
292 298
293 void GpuChildThread::CreateFrameSinkManager( 299 void GpuChildThread::CreateFrameSinkManager(
294 cc::mojom::FrameSinkManagerRequest request, 300 cc::mojom::FrameSinkManagerRequest request,
295 cc::mojom::FrameSinkManagerClientPtr client) { 301 cc::mojom::FrameSinkManagerClientPtr client) {
296 NOTREACHED(); 302 NOTREACHED();
297 } 303 }
298 304
299 void GpuChildThread::BindServiceFactoryRequest( 305 void GpuChildThread::BindServiceFactoryRequest(
300 const service_manager::BindSourceInfo& source_info, 306 const service_manager::BindSourceInfo& source_info,
301 service_manager::mojom::ServiceFactoryRequest request) { 307 service_manager::mojom::ServiceFactoryRequest request) {
302 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; 308 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest";
303 DCHECK(service_factory_); 309 DCHECK(service_factory_);
304 service_factory_bindings_.AddBinding(service_factory_.get(), 310 service_factory_bindings_.AddBinding(service_factory_.get(),
305 std::move(request)); 311 std::move(request));
306 } 312 }
307 313
314 #if defined(OS_ANDROID)
315 // static
316 std::unique_ptr<media::AndroidOverlay> GpuChildThread::CreateAndroidOverlay(
317 const base::UnguessableToken& routing_token,
318 media::AndroidOverlayConfig config) {
319 media::mojom::AndroidOverlayProviderPtr provider_ptr;
320 ChildThread::Get()->GetConnector()->BindInterface(
321 content::mojom::kBrowserServiceName, &provider_ptr);
322 return base::MakeUnique<media::MojoAndroidOverlay>(
323 std::move(provider_ptr), std::move(config), routing_token);
324 }
325 #endif
326
308 } // namespace content 327 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | media/base/android_overlay_mojo_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698