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

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: rebase + remove WillBe types. 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 f566f0ef95b03551e9fe352c6e9b873e5a23b92e..4c87e4915c4aa2a092e291fc71a9818515926a78 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -7,21 +7,33 @@
#include "bindings/core/v8/ScriptValue.h"
#include "core/dom/ExecutionContext.h"
+#include "modules/ModulesExport.h"
#include "modules/worklet/WorkletGlobalScope.h"
namespace blink {
-class PaintWorkletGlobalScope : public WorkletGlobalScope {
+class CSSPaintDefinition;
+class ExceptionState;
+
+class MODULES_EXPORT PaintWorkletGlobalScope : public WorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO();
public:
static RawPtr<PaintWorkletGlobalScope> create(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*);
~PaintWorkletGlobalScope() override;
+ void dispose() 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 HeapHashMap<String, Member<CSSPaintDefinition>> DefinitionMap;
+ DefinitionMap m_paintDefinitions;
};
DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->isPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope());

Powered by Google App Engine
This is Rietveld 408576698