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

Unified Diff: third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h

Issue 1866623002: Hook up CSSPaintValue::image to CSS Paint API callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
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..1e8a09d69dc89585cb8e825978666f64d7542939 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&);
chrishtr 2016/04/06 18:55:20 This class is under-documented. Please also add M
ikilpatrick 2016/04/07 23:03:00 PTAL.
+ 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() { };
@@ -33,6 +38,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.
+ // This is a weak reference, CSSPaintImageGeneratorImpl holds a persistent
+ // reference which keeps it alive.
+ ScopedPersistent<v8::Object> m_instance;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698