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

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

Issue 2527503003: FaceDetector: Pass |options| to parent constructor (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/ShapeDetector.cpp
diff --git a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
index d5b57cdffc33fcc85ec2548b8ba971a09598a782..65396b98750a89d297929966aceeae81d38af15a 100644
--- a/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
@@ -49,6 +49,16 @@ ShapeDetector::ShapeDetector(LocalFrame& frame) {
frame.interfaceProvider()->getInterface(mojo::GetProxy(&m_service));
}
+ShapeDetector::ShapeDetector(LocalFrame& frame,
+ const FaceDetectorOptions& options)
+ : m_options(mojom::blink::FaceDetectorOptions::New()) {
+ DCHECK(!m_service.is_bound());
+ DCHECK(frame.interfaceProvider());
+ frame.interfaceProvider()->getInterface(mojo::GetProxy(&m_service));
Reilly Grant (use Gerrit) 2016/11/23 01:42:04 You can use delegated constructors to avoid this c
+ m_options->max_detected_faces = options.maxDetectedFaces();
+ m_options->fast_mode = options.fastMode();
+}
+
ScriptPromise ShapeDetector::detectShapes(
ScriptState* scriptState,
DetectorType detectorType,

Powered by Google App Engine
This is Rietveld 408576698