| 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 ShapeDetector_h | 5 #ifndef ShapeDetector_h |
| 6 #define ShapeDetector_h | 6 #define ShapeDetector_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 "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| 11 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 11 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
| 12 #include "modules/shapedetection/FaceDetectorOptions.h" | 12 #include "modules/shapedetection/FaceDetectorOptions.h" |
| 13 #include "public/platform/modules/shapedetection/shapedetection.mojom-blink.h" | 13 #include "public/platform/modules/shapedetection/barcodedetection.mojom-blink.h" |
| 14 #include "public/platform/modules/shapedetection/facedetection.mojom-blink.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class LocalFrame; | 18 class LocalFrame; |
| 18 | 19 |
| 19 class MODULES_EXPORT ShapeDetector | 20 class MODULES_EXPORT ShapeDetector |
| 20 : public GarbageCollectedFinalized<ShapeDetector> { | 21 : public GarbageCollectedFinalized<ShapeDetector> { |
| 21 public: | 22 public: |
| 22 enum class DetectorType { | 23 enum class DetectorType { |
| 23 Face, | 24 Face, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 49 ScriptPromiseResolver*, | 50 ScriptPromiseResolver*, |
| 50 uint8_t* data, | 51 uint8_t* data, |
| 51 int size, | 52 int size, |
| 52 int width, | 53 int width, |
| 53 int height); | 54 int height); |
| 54 void onDetectFaces(ScriptPromiseResolver*, | 55 void onDetectFaces(ScriptPromiseResolver*, |
| 55 mojom::blink::FaceDetectionResultPtr); | 56 mojom::blink::FaceDetectionResultPtr); |
| 56 void onDetectBarcodes(ScriptPromiseResolver*, | 57 void onDetectBarcodes(ScriptPromiseResolver*, |
| 57 Vector<mojom::blink::BarcodeDetectionResultPtr>); | 58 Vector<mojom::blink::BarcodeDetectionResultPtr>); |
| 58 | 59 |
| 59 mojom::blink::ShapeDetectionPtr m_service; | 60 mojom::blink::FaceDetectionPtr m_faceService; |
| 61 mojom::blink::BarcodeDetectionPtr m_barcodeService; |
| 60 | 62 |
| 61 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; | 63 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; |
| 62 | 64 |
| 63 protected: | 65 protected: |
| 64 mojom::blink::FaceDetectorOptionsPtr m_options; | 66 mojom::blink::FaceDetectorOptionsPtr m_faceDetectorOptions; |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace blink | 69 } // namespace blink |
| 68 | 70 |
| 69 #endif // ShapeDetector_h | 71 #endif // ShapeDetector_h |
| OLD | NEW |