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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2655303005: Shape detection service: Add QR detection in Mac (Closed)
Patch Set: Don't init explicitly a vector of vectors Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/shapedetection/face_detection_service_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 4546d52b7e3824a30aa9fc838f8434555224e975..5cf3fedaaeca4e4c7f95e0e1db492b9c942bc6e4 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -182,11 +182,13 @@
#include "net/url_request/url_request_context_getter.h"
#include "ppapi/features/features.h"
#include "services/service_manager/public/cpp/connection.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/runner/common/client_util.h"
#include "services/service_manager/runner/common/switches.h"
#include "services/shape_detection/public/interfaces/barcodedetection.mojom.h"
+#include "services/shape_detection/public/interfaces/constants.mojom.h"
#include "services/shape_detection/public/interfaces/facedetection_provider.mojom.h"
#include "services/shape_detection/public/interfaces/textdetection.mojom.h"
#include "storage/browser/fileapi/sandbox_file_system_backend.h"
@@ -219,7 +221,6 @@
#if defined(OS_MACOSX)
#include "content/browser/bootstrap_sandbox_manager_mac.h"
#include "content/browser/mach_broker_mac.h"
-#include "content/browser/shapedetection/face_detection_service_dispatcher.h"
#endif
#if defined(OS_POSIX)
@@ -456,6 +457,16 @@ void CreateMemoryCoordinatorHandle(
std::move(request));
}
+// Forwards service requests to Service Manager since the renderer cannot launch
+// out-of-process services on is own.
+template <typename R>
+void ForwardShapeDetectionRequest(R request) {
+ service_manager::Connector* connector =
+ ServiceManagerConnection::GetForProcess()->GetConnector();
+ connector->BindInterface(shape_detection::mojom::kServiceName,
+ std::move(request));
+}
+
} // namespace
RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
@@ -1197,12 +1208,6 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
channel_->AddAssociatedInterfaceForIOThread(
base::Bind(&IndexedDBDispatcherHost::AddBinding, indexed_db_factory_));
-#if defined(OS_MACOSX)
- AddUIThreadInterface(
- registry.get(),
- base::Bind(&FaceDetectionServiceDispatcher::CreateMojoService));
-#endif
-
#if defined(OS_ANDROID)
AddUIThreadInterface(registry.get(),
GetGlobalJavaInterfaces()
@@ -1222,6 +1227,14 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
#else
AddUIThreadInterface(
registry.get(), base::Bind(&device::BatteryMonitorImpl::Create));
+ AddUIThreadInterface(
+ registry.get(),
+ base::Bind(&ForwardShapeDetectionRequest<
+ shape_detection::mojom::BarcodeDetectionRequest>));
+ AddUIThreadInterface(
+ registry.get(),
+ base::Bind(&ForwardShapeDetectionRequest<
+ shape_detection::mojom::FaceDetectionProviderRequest>));
#endif
AddUIThreadInterface(
registry.get(),
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/shapedetection/face_detection_service_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698