OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_process_control_impl.h" | 5 #include "content/gpu/gpu_process_control_impl.h" |
6 | 6 |
7 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 7 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "content/common/mojo/static_loader.h" | 10 #include "content/common/mojo/static_loader.h" |
| 11 #include "content/public/common/content_client.h" |
11 #include "media/mojo/services/mojo_media_application_factory.h" | 12 #include "media/mojo/services/mojo_media_application_factory.h" |
| 13 #if defined(OS_ANDROID) |
| 14 #include "media/base/android/media_client_android.h" |
| 15 #endif |
12 #endif | 16 #endif |
13 | 17 |
14 namespace content { | 18 namespace content { |
15 | 19 |
16 GpuProcessControlImpl::GpuProcessControlImpl() {} | 20 GpuProcessControlImpl::GpuProcessControlImpl() {} |
17 | 21 |
18 GpuProcessControlImpl::~GpuProcessControlImpl() {} | 22 GpuProcessControlImpl::~GpuProcessControlImpl() {} |
19 | 23 |
20 void GpuProcessControlImpl::RegisterLoaders( | 24 void GpuProcessControlImpl::RegisterLoaders( |
21 NameToLoaderMap* name_to_loader_map) { | 25 NameToLoaderMap* name_to_loader_map) { |
22 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 26 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
| 27 #if defined(OS_ANDROID) |
| 28 // Only set once per process instance. |
| 29 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); |
| 30 #endif |
| 31 |
23 (*name_to_loader_map)["mojo:media"] = new StaticLoader( | 32 (*name_to_loader_map)["mojo:media"] = new StaticLoader( |
24 base::Bind(&media::CreateMojoMediaApplication), | 33 base::Bind(&media::CreateMojoMediaApplication), |
25 base::Bind(&base::DoNothing)); | 34 base::Bind(&base::DoNothing)); |
26 #endif | 35 #endif |
27 } | 36 } |
28 | 37 |
29 } // namespace content | 38 } // namespace content |
OLD | NEW |