OLD | NEW |
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 "modules/worklet/WorkletGlobalScope.h" | 10 #include "modules/worklet/WorkletGlobalScope.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
| 14 class CSSPaintDefinition; |
| 15 class ExceptionState; |
| 16 |
14 class PaintWorkletGlobalScope : public WorkletGlobalScope { | 17 class PaintWorkletGlobalScope : public WorkletGlobalScope { |
15 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
16 public: | 19 public: |
17 static PassRefPtrWillBeRawPtr<PaintWorkletGlobalScope> create(LocalFrame*, c
onst KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); | 20 static PassRefPtrWillBeRawPtr<PaintWorkletGlobalScope> create(LocalFrame*, c
onst KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); |
18 ~PaintWorkletGlobalScope() override; | 21 ~PaintWorkletGlobalScope() override; |
19 | 22 |
20 bool isPaintWorkletGlobalScope() const final { return true; } | 23 bool isPaintWorkletGlobalScope() const final { return true; } |
21 void registerPaint(const String&, ScriptValue) { } | 24 void registerPaint(const String& name, const ScriptValue& ctor, ExceptionSta
te&); |
| 25 |
| 26 CSSPaintDefinition* findDefinition(const String& name); |
| 27 |
| 28 DECLARE_VIRTUAL_TRACE(); |
22 | 29 |
23 private: | 30 private: |
24 PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, P
assRefPtr<SecurityOrigin>, v8::Isolate*); | 31 PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, P
assRefPtr<SecurityOrigin>, v8::Isolate*); |
| 32 |
| 33 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<CSSPaintDefinition>> De
finitionMap; |
| 34 DefinitionMap m_paintDefinitions; |
25 }; | 35 }; |
26 | 36 |
27 DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->i
sPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope()); | 37 DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->i
sPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope()); |
28 | 38 |
29 } // namespace blink | 39 } // namespace blink |
30 | 40 |
31 #endif // PaintWorkletGlobalScope_h | 41 #endif // PaintWorkletGlobalScope_h |
OLD | NEW |