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

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

Issue 2502763005: ShapeDetection: Add FaceDetectorOptions for fastMode and maxDetectedFaces (Closed)
Patch Set: Created 4 years, 1 month 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 3c37c16418579dff55b4361b5e935562045fdc9f..280940a9b24b26fdb98b5021df2e9b4da36f36f7 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
@@ -11,11 +11,18 @@
namespace blink {
-FaceDetector* FaceDetector::create(ScriptState* scriptState) {
- return new FaceDetector(*scriptState->domWindow()->frame());
+FaceDetector* FaceDetector::create(ScriptState* scriptState,
+ const FaceDetectorOptions& options) {
+ return new FaceDetector(*scriptState->domWindow()->frame(), options);
}
-FaceDetector::FaceDetector(LocalFrame& frame) : ShapeDetector(frame) {}
+FaceDetector::FaceDetector(LocalFrame& frame,
+ const FaceDetectorOptions& options)
+ : ShapeDetector(frame) {
+ m_options = mojom::blink::FaceDetectorOptions::New();
mcasas 2016/11/21 23:19:26 Can you add this to the initialization list? I.e.
xianglu 2016/11/22 00:59:13 In fact |m_options| is a protected variable of bas
+ m_options->maxDetectedFaces = options.maxDetectedFaces();
+ m_options->fastMode = options.fastMode();
+}
ScriptPromise FaceDetector::detect(ScriptState* scriptState,
const CanvasImageSourceUnion& imageSource) {

Powered by Google App Engine
This is Rietveld 408576698