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

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

Issue 2382103002: media: Add GpuMojoMediaClient. (Closed)
Patch Set: Address nits. Created 4 years 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_service_factory.h ('k') | media/gpu/ipc/service/media_gpu_channel_manager.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 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_service_factory.h" 5 #include "content/gpu/gpu_service_factory.h"
6 6
7 #include <memory>
8
9 #include "base/threading/thread_task_runner_handle.h"
10
7 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 11 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
8 #include "base/bind.h" 12 #include "base/bind.h"
9 #include "base/bind_helpers.h" 13 #include "media/mojo/services/media_service_factory.h"
xhwang 2016/11/29 00:12:18 We had // nogncheck because gn isn't smart enough
10 #include "media/mojo/services/media_service_factory.h" // nogncheck
11 #endif 14 #endif
12 15
13 namespace content { 16 namespace content {
14 17
15 GpuServiceFactory::GpuServiceFactory() {} 18 GpuServiceFactory::GpuServiceFactory(
19 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager) {
20 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
21 task_runner_ = base::ThreadTaskRunnerHandle::Get();
22 media_gpu_channel_manager_ = std::move(media_gpu_channel_manager);
23 #endif
24 }
16 25
17 GpuServiceFactory::~GpuServiceFactory() {} 26 GpuServiceFactory::~GpuServiceFactory() {}
18 27
19 void GpuServiceFactory::RegisterServices(ServiceMap* services) { 28 void GpuServiceFactory::RegisterServices(ServiceMap* services) {
20 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 29 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
21 ServiceInfo info; 30 ServiceInfo info;
22 info.factory = base::Bind(&media::CreateMediaService); 31 info.factory = base::Bind(&media::CreateGpuMediaService, task_runner_,
32 media_gpu_channel_manager_);
23 info.use_own_thread = true; 33 info.use_own_thread = true;
24 services->insert(std::make_pair("media", info)); 34 services->insert(std::make_pair("media", info));
25 #endif 35 #endif
26 } 36 }
27 37
28 } // namespace content 38 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_service_factory.h ('k') | media/gpu/ipc/service/media_gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698