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

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

Issue 2448193002: ShapeDetection: support CanvasImageSource as detect() source (Closed)
Patch Set: esprehn@ comments and specific LayoutTest for empty HTMLImageElement 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 76b35adf4ae0f365105a10829a673a59d3b8aa07..6cb1723badaef8aad0f8449ea4c4f76ce7a13f52 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
+++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
@@ -9,13 +9,11 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "modules/ModulesExport.h"
+#include "modules/canvas2d/CanvasRenderingContext2D.h"
#include "public/platform/modules/shapedetection/shapedetection.mojom-blink.h"
namespace blink {
-class Document;
-class HTMLImageElement;
-class LocalDOMWindow;
class LocalFrame;
class MODULES_EXPORT FaceDetector final
@@ -25,11 +23,16 @@ class MODULES_EXPORT FaceDetector final
public:
static FaceDetector* create(ScriptState*);
- ScriptPromise detect(ScriptState*, const HTMLImageElement*);
+
+ ScriptPromise detect(ScriptState*, const CanvasImageSourceUnion&);
DECLARE_TRACE();
private:
explicit FaceDetector(LocalFrame&);
+ ScriptPromise detectFacesOnImageElement(ScriptPromiseResolver*,
+ const HTMLImageElement*);
+ ScriptPromise detectFacesOnImageBitmap(ScriptPromiseResolver*, ImageBitmap*);
+
void onDetectFace(ScriptPromiseResolver*,
mojom::blink::FaceDetectionResultPtr);

Powered by Google App Engine
This is Rietveld 408576698