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

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

Issue 1839913002: Implement PaintWorkletGlobalScope#registerPaint() for the CSS Paint API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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/PaintWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
index fb48bccdbec20fe9ba20f239a7f58c7503807aa5..b178335516b578e7e6cc7d93bbc802ce49533001 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -11,6 +11,9 @@
namespace blink {
+class CSSPaintDefinition;
+class ExceptionState;
+
class PaintWorkletGlobalScope : public WorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -18,10 +21,17 @@ public:
~PaintWorkletGlobalScope() override;
bool isPaintWorkletGlobalScope() const final { return true; }
- void registerPaint(const String&, ScriptValue) { }
+ void registerPaint(const String& name, const ScriptValue& ctor, ExceptionState&);
+
+ CSSPaintDefinition* findDefinition(const String& name);
+
+ DECLARE_VIRTUAL_TRACE();
private:
PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*);
+
+ typedef WillBeHeapHashMap<String, RefPtrWillBeMember<CSSPaintDefinition>> DefinitionMap;
+ DefinitionMap m_paintDefinitions;
};
DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->isPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope());

Powered by Google App Engine
This is Rietveld 408576698