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

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

Issue 1899363002: Finish plumbing MojoVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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_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/memory/ptr_util.h"
10 #include "media/mojo/services/mojo_media_application_factory.h" 10 #include "media/mojo/services/gpu_mojo_media_client.h"
11 #endif 11 #include "media/mojo/services/mojo_media_application.h"
12 #include "services/shell/public/cpp/shell_client.h"
13 #endif // defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
12 14
13 namespace content { 15 namespace content {
14 16
15 GpuProcessControlImpl::GpuProcessControlImpl() {} 17 namespace {
18 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
19 std::unique_ptr<shell::ShellClient> CreateMojoMediaApplication(
20 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner) {
21 return base::WrapUnique(new media::MojoMediaApplication(
22 base::WrapUnique(new media::GpuMojoMediaClient(gpu_task_runner))));
23 }
24 #endif // defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
25 } // namespace
26
27 GpuProcessControlImpl::GpuProcessControlImpl(
28 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner)
29 : gpu_task_runner_(gpu_task_runner) {}
16 30
17 GpuProcessControlImpl::~GpuProcessControlImpl() {} 31 GpuProcessControlImpl::~GpuProcessControlImpl() {}
18 32
19 void GpuProcessControlImpl::RegisterApplicationFactories( 33 void GpuProcessControlImpl::RegisterApplicationFactories(
20 ApplicationFactoryMap* factories) { 34 ApplicationFactoryMap* factories) {
21 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 35 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
22 factories->insert(std::make_pair( 36 factories->insert(std::make_pair(
23 "mojo:media", base::Bind(&media::CreateMojoMediaApplication))); 37 "mojo:media", base::Bind(&CreateMojoMediaApplication, gpu_task_runner_)));
24 #endif 38 #endif // defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
25 } 39 }
26 40
27 } // namespace content 41 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698