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

Side by Side 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 unified diff | Download patch
OLDNEW
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"
10 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "modules/ModulesExport.h" 11 #include "modules/ModulesExport.h"
10 #include "modules/shapedetection/Detector.h" 12 #include "public/platform/modules/shapedetection/shapedetection.mojom-blink.h"
11 13
12 namespace blink { 14 namespace blink {
13 15
14 class MODULES_EXPORT FaceDetector final : public Detector { 16 class Document;
17 class HTMLImageElement;
18 class LocalFrame;
19
20 class MODULES_EXPORT FaceDetector final
21 : public GarbageCollectedFinalized<FaceDetector>
22 , public ScriptWrappable {
15 DEFINE_WRAPPERTYPEINFO(); 23 DEFINE_WRAPPERTYPEINFO();
16 24
17 public: 25 public:
18 static FaceDetector* create(); 26 static FaceDetector* create(const Document&);
27 ScriptPromise detect(ScriptState*, const HTMLImageElement*);
28 DECLARE_TRACE();
19 29
20 ScriptPromise detect(ScriptState*, const HTMLImageElement*); 30 private:
31 explicit FaceDetector(LocalFrame&);
32 void onDetectFace(ScriptPromiseResolver*, mojom::blink::FaceDetectionResultP tr);
33
34 mojom::blink::ShapeDetectionPtr m_service;
35
36 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests;
21 }; 37 };
22 38
23 } // namespace blink 39 } // namespace blink
24 40
25 #endif // FaceDetector_h 41 #endif // FaceDetector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698