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

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

Issue 2756793002: RELAND: Shape Detection: move the Mac service to the sandboxed GPU process (Closed)
Patch Set: moved shapedetection-security-test.html to non-fast LayoutTests to use the mock mojo service Created 3 years, 9 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_service_factory.h" 5 #include "content/gpu/gpu_service_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "services/shape_detection/public/interfaces/constants.mojom.h"
11 #include "services/shape_detection/shape_detection_service.h"
10 12
11 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 13 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
12 #include "base/bind.h" 14 #include "base/bind.h"
13 #include "media/mojo/services/media_service_factory.h" // nogncheck 15 #include "media/mojo/services/media_service_factory.h" // nogncheck
14 #endif 16 #endif
15 17
16 namespace content { 18 namespace content {
17 19
18 GpuServiceFactory::GpuServiceFactory( 20 GpuServiceFactory::GpuServiceFactory(
19 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager) { 21 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager) {
20 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 22 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
21 task_runner_ = base::ThreadTaskRunnerHandle::Get(); 23 task_runner_ = base::ThreadTaskRunnerHandle::Get();
22 media_gpu_channel_manager_ = std::move(media_gpu_channel_manager); 24 media_gpu_channel_manager_ = std::move(media_gpu_channel_manager);
23 #endif 25 #endif
24 } 26 }
25 27
26 GpuServiceFactory::~GpuServiceFactory() {} 28 GpuServiceFactory::~GpuServiceFactory() {}
27 29
28 void GpuServiceFactory::RegisterServices(ServiceMap* services) { 30 void GpuServiceFactory::RegisterServices(ServiceMap* services) {
29 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 31 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
30 ServiceInfo info; 32 ServiceInfo info;
31 info.factory = base::Bind(&media::CreateGpuMediaService, task_runner_, 33 info.factory = base::Bind(&media::CreateGpuMediaService, task_runner_,
32 media_gpu_channel_manager_); 34 media_gpu_channel_manager_);
33 info.use_own_thread = true; 35 info.use_own_thread = true;
34 services->insert(std::make_pair("media", info)); 36 services->insert(std::make_pair("media", info));
35 #endif 37 #endif
38
39 ServiceInfo shape_detection_info;
40 shape_detection_info.factory =
41 base::Bind(&shape_detection::ShapeDetectionService::Create);
42 services->insert(std::make_pair(shape_detection::mojom::kServiceName,
43 shape_detection_info));
36 } 44 }
37 45
38 } // namespace content 46 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/DEPS ('k') | third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698