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

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

Issue 2871513002: Worklet: Lazily create PaintWorkletGlobalScopes (Closed)
Patch Set: fix layout test failures 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..52bd942841e9f36b8365578bed9104b19dec05b3 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -9,6 +9,7 @@
#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 {
@@ -38,6 +39,10 @@ class MODULES_EXPORT PaintWorkletGlobalScope final
CSSPaintDefinition* FindDefinition(const String& name);
void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*);
+ void SetPendingGeneratorRegistry(
+ PaintWorkletPendingGeneratorRegistry* registry) {
+ pending_generator_registry_ = registry;
+ }
DECLARE_VIRTUAL_TRACE();
@@ -51,12 +56,7 @@ class MODULES_EXPORT PaintWorkletGlobalScope final
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