Chromium Code Reviews| 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, |