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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h

Issue 2903703003: Use wrapper tracing for worklets. (Closed)
Patch Set: Separating in two CLs Created 3 years, 6 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 PaintWorkletGlobalScope_h 5 #ifndef PaintWorkletGlobalScope_h
6 #define PaintWorkletGlobalScope_h 6 #define PaintWorkletGlobalScope_h
7 7
8 #include "bindings/core/v8/ScriptValue.h" 8 #include "bindings/core/v8/ScriptValue.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "core/workers/MainThreadWorkletGlobalScope.h" 10 #include "core/workers/MainThreadWorkletGlobalScope.h"
11 #include "modules/ModulesExport.h" 11 #include "modules/ModulesExport.h"
12 #include "modules/csspaint/PaintWorkletPendingGeneratorRegistry.h" 12 #include "modules/csspaint/PaintWorkletPendingGeneratorRegistry.h"
13 #include "platform/bindings/ScriptWrappable.h"
13 #include "platform/graphics/ImageBuffer.h" 14 #include "platform/graphics/ImageBuffer.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class CSSPaintDefinition; 18 class CSSPaintDefinition;
18 class ExceptionState; 19 class ExceptionState;
19 20
20 class MODULES_EXPORT PaintWorkletGlobalScope final 21 class MODULES_EXPORT PaintWorkletGlobalScope final
21 : public MainThreadWorkletGlobalScope { 22 : public MainThreadWorkletGlobalScope {
22 DEFINE_WRAPPERTYPEINFO(); 23 DEFINE_WRAPPERTYPEINFO();
(...skipping 10 matching lines...) Expand all
33 void Dispose() final; 34 void Dispose() final;
34 35
35 bool IsPaintWorkletGlobalScope() const final { return true; } 36 bool IsPaintWorkletGlobalScope() const final { return true; }
36 void registerPaint(const String& name, 37 void registerPaint(const String& name,
37 const ScriptValue& ctor, 38 const ScriptValue& ctor,
38 ExceptionState&); 39 ExceptionState&);
39 40
40 CSSPaintDefinition* FindDefinition(const String& name); 41 CSSPaintDefinition* FindDefinition(const String& name);
41 42
42 DECLARE_VIRTUAL_TRACE(); 43 DECLARE_VIRTUAL_TRACE();
44 DECLARE_TRACE_WRAPPERS();
43 45
44 private: 46 private:
45 PaintWorkletGlobalScope(LocalFrame*, 47 PaintWorkletGlobalScope(LocalFrame*,
46 const KURL&, 48 const KURL&,
47 const String& user_agent, 49 const String& user_agent,
48 PassRefPtr<SecurityOrigin>, 50 PassRefPtr<SecurityOrigin>,
49 v8::Isolate*, 51 v8::Isolate*,
50 PaintWorkletPendingGeneratorRegistry*); 52 PaintWorkletPendingGeneratorRegistry*);
51 53
52 // The implementation of the "paint definition" concept: 54 // The implementation of the "paint definition" concept:
53 // https://drafts.css-houdini.org/css-paint-api/#paint-definition 55 // https://drafts.css-houdini.org/css-paint-api/#paint-definition
54 typedef HeapHashMap<String, Member<CSSPaintDefinition>> DefinitionMap; 56 typedef HeapHashMap<String, TraceWrapperMember<CSSPaintDefinition>>
57 DefinitionMap;
55 DefinitionMap paint_definitions_; 58 DefinitionMap paint_definitions_;
56 59
57 Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_; 60 Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_;
58 }; 61 };
59 62
60 DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, 63 DEFINE_TYPE_CASTS(PaintWorkletGlobalScope,
61 ExecutionContext, 64 ExecutionContext,
62 context, 65 context,
63 context->IsPaintWorkletGlobalScope(), 66 context->IsPaintWorkletGlobalScope(),
64 context.IsPaintWorkletGlobalScope()); 67 context.IsPaintWorkletGlobalScope());
65 68
66 } // namespace blink 69 } // namespace blink
67 70
68 #endif // PaintWorkletGlobalScope_h 71 #endif // PaintWorkletGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698