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

Side by Side Diff: third_party/WebKit/Source/modules/shapedetection/TextDetector.h

Issue 2629523008: Shape Detection: Remove ConstructorCallWith=Document (Closed)
Patch Set: Add layout test for worker Created 3 years, 11 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 TextDetector_h 5 #ifndef TextDetector_h
6 #define TextDetector_h 6 #define TextDetector_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 "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "modules/ModulesExport.h" 11 #include "modules/ModulesExport.h"
12 #include "modules/canvas2d/CanvasRenderingContext2D.h" 12 #include "modules/canvas2d/CanvasRenderingContext2D.h"
13 #include "modules/shapedetection/ShapeDetector.h" 13 #include "modules/shapedetection/ShapeDetector.h"
14 #include "services/shape_detection/public/interfaces/textdetection.mojom-blink.h " 14 #include "services/shape_detection/public/interfaces/textdetection.mojom-blink.h "
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class LocalFrame;
19
20 class MODULES_EXPORT TextDetector final : public ShapeDetector, 18 class MODULES_EXPORT TextDetector final : public ShapeDetector,
21 public ScriptWrappable { 19 public ScriptWrappable {
22 DEFINE_WRAPPERTYPEINFO(); 20 DEFINE_WRAPPERTYPEINFO();
23 21
24 public: 22 public:
25 static TextDetector* create(Document&); 23 static TextDetector* create();
26 24
27 DECLARE_VIRTUAL_TRACE(); 25 DECLARE_VIRTUAL_TRACE();
28 26
29 private: 27 private:
30 explicit TextDetector(LocalFrame&); 28 TextDetector();
31 ~TextDetector() override = default; 29 ~TextDetector() override = default;
32 30
33 ScriptPromise doDetect(ScriptPromiseResolver*, 31 ScriptPromise doDetect(ScriptPromiseResolver*,
34 mojo::ScopedSharedBufferHandle, 32 mojo::ScopedSharedBufferHandle,
35 int imageWidth, 33 int imageWidth,
36 int imageHeight) override; 34 int imageHeight) override;
37 void onDetectText( 35 void onDetectText(
38 ScriptPromiseResolver*, 36 ScriptPromiseResolver*,
39 Vector<shape_detection::mojom::blink::TextDetectionResultPtr>); 37 Vector<shape_detection::mojom::blink::TextDetectionResultPtr>);
40 void onTextServiceConnectionError(); 38 void onTextServiceConnectionError();
41 39
42 shape_detection::mojom::blink::TextDetectionPtr m_textService; 40 shape_detection::mojom::blink::TextDetectionPtr m_textService;
43 41
44 HeapHashSet<Member<ScriptPromiseResolver>> m_textServiceRequests; 42 HeapHashSet<Member<ScriptPromiseResolver>> m_textServiceRequests;
45 }; 43 };
46 44
47 } // namespace blink 45 } // namespace blink
48 46
49 #endif // TextDetector_h 47 #endif // TextDetector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698