Index: third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h |
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h |
index 9c768b7377e226930b370f2b949be40d199d3c6b..22455961711e5909ceda7688be2d6eb4c82b017e 100644 |
--- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h |
+++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h |
@@ -12,6 +12,7 @@ |
namespace blink { |
+class Image; |
class ScriptState; |
class CSSPaintDefinition final : public GarbageCollectedFinalized<CSSPaintDefinition> { |
@@ -19,6 +20,10 @@ public: |
static RawPtr<CSSPaintDefinition> create(ScriptState*, v8::Local<v8::Function> constructor, v8::Local<v8::Function> paint); |
virtual ~CSSPaintDefinition(); |
+ PassRefPtr<Image> paint(const IntSize&); |
+ v8::Local<v8::Object> paintInstance(); |
+ ScriptState* getScriptState() const { return m_scriptState.get(); } |
+ |
v8::Local<v8::Function> paintFunctionForTesting(v8::Isolate* isolate) { return m_paint.newLocal(isolate); } |
DEFINE_INLINE_TRACE() { }; |
@@ -26,6 +31,7 @@ public: |
private: |
CSSPaintDefinition(ScriptState*, v8::Local<v8::Function> constructor, v8::Local<v8::Function> paint); |
+ |
RefPtr<ScriptState> m_scriptState; |
// This object keeps the constructor and paint functions alive. This object |
@@ -33,6 +39,11 @@ private: |
// PaintWorkletGlobalScope. |
ScopedPersistent<v8::Function> m_constructor; |
ScopedPersistent<v8::Function> m_paint; |
+ |
+ // At the moment there is only ever one instance of a paint class per type |
+ // so we store it here. If this changes, instance should be passed into the |
+ // callback. m_instance is lazily constructed. |
+ ScopedPersistent<v8::Object> m_instance; |
}; |
} // namespace blink |