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

Unified Diff: third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp

Issue 2528743002: Shape Detection: Implement FaceDetection on Mac as out-of-process service (Closed)
Patch Set: avi@ comments, rebase 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
diff --git a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
index 060c66f89195f31b31daa50b731e2c50532e69a7..3854249842f34f5f83dff1ad92359985f2b76434 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
@@ -11,8 +11,10 @@
#include "core/html/canvas/CanvasImageSource.h"
#include "modules/shapedetection/DetectedFace.h"
#include "modules/shapedetection/FaceDetectorOptions.h"
+#include "platform/ServiceConnector.h"
#include "public/platform/InterfaceProvider.h"
#include "public/platform/modules/shapedetection/facedetection_provider.mojom-blink.h"
+#include "services/shape_detection/public/interfaces/constants.mojom-blink.h"
namespace blink {
@@ -29,10 +31,16 @@ FaceDetector::FaceDetector(LocalFrame& frame,
faceDetectorOptions->max_detected_faces = options.maxDetectedFaces();
faceDetectorOptions->fast_mode = options.fastMode();
mojom::blink::FaceDetectionProviderPtr provider;
+#if OS(MACOSX)
+ ServiceConnector::instance().connectToInterface(
+ shape_detection::mojom::blink::kServiceName,
+ mojo::MakeRequest(&provider));
+#else
+ // TODO(xianglu): Move Android implementation to service/ as well.
frame.interfaceProvider()->getInterface(mojo::MakeRequest(&provider));
+#endif
provider->CreateFaceDetection(mojo::MakeRequest(&m_faceService),
std::move(faceDetectorOptions));
-
m_faceService.set_connection_error_handler(convertToBaseCallback(WTF::bind(
&FaceDetector::onFaceServiceConnectionError, wrapWeakPersistent(this))));
}

Powered by Google App Engine
This is Rietveld 408576698