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

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

Issue 1834843002: [WIP] Plumbing for paint Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: \o/\o/ 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..261b899341d869de5d6c51027b5c86909deb4095 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -8,9 +8,14 @@
#include "bindings/core/v8/ScriptValue.h"
#include "core/dom/ExecutionContext.h"
#include "modules/worklet/WorkletGlobalScope.h"
+#include "platform/graphics/ImageBuffer.h"
namespace blink {
+class CSSPaintDefinition;
+class CSSPaintImageGeneratorImpl;
+class ExceptionState;
+
class PaintWorkletGlobalScope : public WorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -18,10 +23,22 @@ 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);
+ void addPendingGenerator(const String& name, PassRefPtrWillBeRawPtr<CSSPaintImageGeneratorImpl>);
+
+ DECLARE_VIRTUAL_TRACE();
private:
PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*);
+
+ typedef WillBeHeapHashMap<String, RefPtrWillBeMember<CSSPaintDefinition>> DefinitionMap;
+ DefinitionMap m_paintDefinitions;
+
+ using GeneratorHashSet = WillBeHeapHashSet<WeakPtrWillBeWeakMember<CSSPaintImageGeneratorImpl>>;
+ using PendingGeneratorMap = WillBeHeapHashMap<String, OwnPtrWillBeMember<GeneratorHashSet>>;
+ PendingGeneratorMap m_pendingGenerators;
};
DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->isPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope());

Powered by Google App Engine
This is Rietveld 408576698