Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CONTENT_BROWSER_SHAPEDETECTION_FACE_DETECTION_SERVICE_DISPATCHER_H_ | 5 #ifndef CONTENT_BROWSER_SHAPEDETECTION_SHAPE_DETECTION_SERVICE_DISPATCHER_H_ |
| 6 #define CONTENT_BROWSER_SHAPEDETECTION_FACE_DETECTION_SERVICE_DISPATCHER_H_ | 6 #define CONTENT_BROWSER_SHAPEDETECTION_SHAPE_DETECTION_SERVICE_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "content/public/common/service_manager_connection.h" | 9 #include "content/public/common/service_manager_connection.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| 11 #include "services/shape_detection/public/interfaces/barcodedetection.mojom.h" | |
| 11 #include "services/shape_detection/public/interfaces/constants.mojom.h" | 12 #include "services/shape_detection/public/interfaces/constants.mojom.h" |
| 12 #include "services/shape_detection/public/interfaces/facedetection_provider.mojo m.h" | 13 #include "services/shape_detection/public/interfaces/facedetection_provider.mojo m.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 // Because the renderer cannot launch an out-of-process service on its own, we | 17 // Since the renderer cannot launch an out-of-process service on its own, use |
| 17 // use |FaceDetectionServiceDispatcher| to forward requests to Service Manager, | 18 // |FaceDetectionServiceDispatcher| to forward requests to Service Manager, |
| 18 // which then starts Face Detection Service in a utility process. | 19 // which then starts Face Detection Service as a utility process. |
| 19 namespace FaceDetectionServiceDispatcher { | 20 namespace ShapeDetectionServiceDispatcher { |
|
Ken Rockot(use gerrit already)
2017/02/01 21:01:07
Maybe I missed this in a previous CL, but this is
mcasas
2017/02/02 19:40:33
That's very correct. Moved to render_process_host_
| |
| 20 | 21 |
| 21 static void CreateMojoService( | 22 static void CreateFaceMojoService( |
| 22 shape_detection::mojom::FaceDetectionProviderRequest request) { | 23 shape_detection::mojom::FaceDetectionProviderRequest request) { |
| 23 service_manager::Connector* connector = | 24 service_manager::Connector* connector = |
| 24 ServiceManagerConnection::GetForProcess()->GetConnector(); | 25 ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 25 connector->BindInterface(shape_detection::mojom::kServiceName, | 26 connector->BindInterface(shape_detection::mojom::kServiceName, |
| 26 std::move(request)); | 27 std::move(request)); |
| 27 } | 28 } |
| 28 | 29 |
| 29 } // namespace FaceDetectionServiceDispatcher | 30 static void CreateBarcodeMojoService( |
| 31 shape_detection::mojom::BarcodeDetectionRequest request) { | |
| 32 service_manager::Connector* connector = | |
| 33 ServiceManagerConnection::GetForProcess()->GetConnector(); | |
| 34 connector->BindInterface(shape_detection::mojom::kServiceName, | |
| 35 std::move(request)); | |
| 36 } | |
| 37 | |
| 38 } // namespace ShapeDetectionServiceDispatcher | |
| 30 | 39 |
| 31 } // namespace content | 40 } // namespace content |
| 32 | 41 |
| 33 #endif // CONTENT_BROWSER_SHAPEDETECTION_FACE_DETECTION_SERVICE_DISPATCHER_H_ | 42 #endif // CONTENT_BROWSER_SHAPEDETECTION_SHAPE_DETECTION_SERVICE_DISPATCHER_H_ |
| OLD | NEW |