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

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

Issue 2502723002: ShapeDetection: implement barcode detection, blink part (Closed)
Patch Set: haraken@ comments Created 4 years, 1 month 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/BarcodeDetector.h
diff --git a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h b/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.h
similarity index 37%
copy from third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
copy to third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.h
index 61906cb473459a1a40d5616eb64958231e198edb..9431d486e55cb312516ffe91510bb27ea5760d6b 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.h
+++ b/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.h
@@ -2,52 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef FaceDetector_h
-#define FaceDetector_h
+#ifndef BarcodeDetector_h
+#define BarcodeDetector_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/canvas2d/CanvasRenderingContext2D.h"
+#include "modules/shapedetection/ShapeDetector.h"
#include "public/platform/modules/shapedetection/shapedetection.mojom-blink.h"
namespace blink {
class LocalFrame;
-class MODULES_EXPORT FaceDetector final
- : public GarbageCollectedFinalized<FaceDetector>,
- public ScriptWrappable {
+class MODULES_EXPORT BarcodeDetector final : public ShapeDetector,
+ public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- static FaceDetector* create(ScriptState*);
+ static BarcodeDetector* create(ScriptState*);
ScriptPromise detect(ScriptState*, const CanvasImageSourceUnion&);
- DECLARE_TRACE();
+ DECLARE_VIRTUAL_TRACE();
private:
- explicit FaceDetector(LocalFrame&);
- ScriptPromise detectFacesOnImageElement(ScriptPromiseResolver*,
- const HTMLImageElement*);
- ScriptPromise detectFacesOnImageBitmap(ScriptPromiseResolver*, ImageBitmap*);
- ScriptPromise detectFacesOnVideoElement(ScriptPromiseResolver*,
- const HTMLVideoElement*);
-
- ScriptPromise detectFacesOnData(ScriptPromiseResolver*,
- uint8_t* data,
- int size,
- int width,
- int height);
- void onDetectFace(ScriptPromiseResolver*,
- mojom::blink::FaceDetectionResultPtr);
-
- mojom::blink::ShapeDetectionPtr m_service;
-
- HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests;
+ explicit BarcodeDetector(LocalFrame&);
+ ~BarcodeDetector() override = default;
};
} // namespace blink
-#endif // FaceDetector_h
+#endif // BarcodeDetector_h

Powered by Google App Engine
This is Rietveld 408576698