Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef FaceDetector_h | 5 #ifndef FaceDetector_h |
| 6 #define FaceDetector_h | 6 #define FaceDetector_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 12 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
| 13 #include "modules/shapedetection/FaceDetectorOptions.h" | |
| 13 #include "modules/shapedetection/ShapeDetector.h" | 14 #include "modules/shapedetection/ShapeDetector.h" |
| 15 #include "public/platform/modules/shapedetection/facedetection.mojom-blink.h" | |
| 14 | 16 |
| 15 namespace blink { | 17 namespace blink { |
| 16 | 18 |
| 17 class LocalFrame; | 19 class LocalFrame; |
| 18 | 20 |
| 19 class MODULES_EXPORT FaceDetector final : public ShapeDetector, | 21 class MODULES_EXPORT FaceDetector final : public ShapeDetector, |
| 20 public ScriptWrappable { | 22 public ScriptWrappable { |
| 21 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 22 | 24 |
| 23 public: | 25 public: |
| 24 static FaceDetector* create(Document&, const FaceDetectorOptions&); | 26 static FaceDetector* create(Document&, const FaceDetectorOptions&); |
| 25 | 27 |
| 26 ScriptPromise detect(ScriptState*, const CanvasImageSourceUnion&); | |
| 27 DECLARE_VIRTUAL_TRACE(); | 28 DECLARE_VIRTUAL_TRACE(); |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 FaceDetector(LocalFrame&, const FaceDetectorOptions&); | 31 FaceDetector(LocalFrame&, const FaceDetectorOptions&); |
| 31 ~FaceDetector() override = default; | 32 ~FaceDetector() override = default; |
| 33 | |
| 34 ScriptPromise doDetect(ScriptPromiseResolver*, | |
| 35 mojo::ScopedSharedBufferHandle, | |
| 36 int, | |
| 37 int); | |
|
Reilly Grant (use Gerrit)
2016/12/06 20:40:13
Same comment here.
xianglu
2016/12/06 22:31:56
Done.
| |
| 38 void onDetectFaces(ScriptPromiseResolver*, | |
| 39 mojom::blink::FaceDetectionResultPtr); | |
| 40 void onFaceServiceConnectionError(); | |
| 41 | |
| 42 mojom::blink::FaceDetectionPtr m_faceService; | |
| 43 mojom::blink::FaceDetectorOptionsPtr m_faceDetectorOptions; | |
| 44 | |
| 45 HeapHashSet<Member<ScriptPromiseResolver>> m_faceServiceRequests; | |
| 32 }; | 46 }; |
| 33 | 47 |
| 34 } // namespace blink | 48 } // namespace blink |
| 35 | 49 |
| 36 #endif // FaceDetector_h | 50 #endif // FaceDetector_h |
| OLD | NEW |