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

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

Issue 2369693002: Shapedetection module: Blink side implementation (Closed)
Patch Set: rockot@ comments Created 4 years, 2 months 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.h
diff --git a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
index 6afde515e3a691abbee6e0b60189b2b6092bb3f5..6728aeed3297b8329224b1db4ff0d261368cd155 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
+++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
@@ -6,18 +6,34 @@
#define FaceDetector_h
#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "bindings/core/v8/ScriptWrappable.h"
#include "modules/ModulesExport.h"
-#include "modules/shapedetection/Detector.h"
+#include "public/platform/modules/shapedetection/shapedetection.mojom-blink.h"
namespace blink {
-class MODULES_EXPORT FaceDetector final : public Detector {
+class Document;
+class HTMLImageElement;
+class LocalFrame;
+
+class MODULES_EXPORT FaceDetector final
+ : public GarbageCollectedFinalized<FaceDetector>
+ , public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- static FaceDetector* create();
-
+ static FaceDetector* create(const Document&);
ScriptPromise detect(ScriptState*, const HTMLImageElement*);
+ DECLARE_TRACE();
+
+private:
+ explicit FaceDetector(LocalFrame&);
+ void onDetectFace(ScriptPromiseResolver*, mojom::blink::FaceDetectionResultPtr);
+
+ mojom::blink::ShapeDetectionPtr m_service;
+
+ HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698