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

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

Issue 2871513002: Worklet: Lazily create PaintWorkletGlobalScopes (Closed)
Patch Set: fix wrong dcheck Created 3 years, 7 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 ce2b683b8e48e34a1b61bce37005ab07fe9cfd36..a2a514b085b72f5186c260d417ced2262007cc97 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -9,12 +9,12 @@
#include "core/dom/ExecutionContext.h"
#include "core/workers/MainThreadWorkletGlobalScope.h"
#include "modules/ModulesExport.h"
+#include "modules/csspaint/PaintWorkletPendingGeneratorRegistry.h"
#include "platform/graphics/ImageBuffer.h"
namespace blink {
class CSSPaintDefinition;
-class CSSPaintImageGeneratorImpl;
class ExceptionState;
class MODULES_EXPORT PaintWorkletGlobalScope final
@@ -27,7 +27,8 @@ class MODULES_EXPORT PaintWorkletGlobalScope final
const KURL&,
const String& user_agent,
PassRefPtr<SecurityOrigin>,
- v8::Isolate*);
+ v8::Isolate*,
+ PaintWorkletPendingGeneratorRegistry*);
~PaintWorkletGlobalScope() override;
void Dispose() final;
@@ -37,7 +38,6 @@ class MODULES_EXPORT PaintWorkletGlobalScope final
ExceptionState&);
CSSPaintDefinition* FindDefinition(const String& name);
- void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*);
DECLARE_VIRTUAL_TRACE();
@@ -46,17 +46,15 @@ class MODULES_EXPORT PaintWorkletGlobalScope final
const KURL&,
const String& user_agent,
PassRefPtr<SecurityOrigin>,
- v8::Isolate*);
+ v8::Isolate*,
+ PaintWorkletPendingGeneratorRegistry*);
+ // The implementation of the "paint definition" concept:
+ // https://drafts.css-houdini.org/css-paint-api/#paint-definition
typedef HeapHashMap<String, Member<CSSPaintDefinition>> DefinitionMap;
DefinitionMap paint_definitions_;
- // The map of CSSPaintImageGeneratorImpl which are waiting for a
- // CSSPaintDefinition to be registered. The global scope is expected to
- // outlive the generators hence are held onto with a WeakMember.
- typedef HeapHashSet<WeakMember<CSSPaintImageGeneratorImpl>> GeneratorHashSet;
- typedef HeapHashMap<String, Member<GeneratorHashSet>> PendingGeneratorMap;
- PendingGeneratorMap pending_generators_;
+ Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_;
};
DEFINE_TYPE_CASTS(PaintWorkletGlobalScope,

Powered by Google App Engine
This is Rietveld 408576698