Index: third_party/WebKit/Source/modules/csspaint/PaintWorklet.h |
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h |
index 59c61e500d6619fb4320bab1922818ad34afa63e..fbef9147f8441ae905ccd1fb7c3857bf7d989148 100644 |
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h |
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h |
@@ -8,6 +8,7 @@ |
#include "core/workers/MainThreadWorklet.h" |
#include "modules/ModulesExport.h" |
#include "modules/csspaint/PaintWorkletGlobalScopeProxy.h" |
+#include "modules/csspaint/PaintWorkletPendingGeneratorRegistry.h" |
#include "platform/heap/Handle.h" |
namespace blink { |
@@ -24,17 +25,23 @@ class MODULES_EXPORT PaintWorklet final : public MainThreadWorklet { |
static PaintWorklet* Create(LocalFrame*); |
~PaintWorklet() override; |
- WorkletGlobalScopeProxy* GetWorkletGlobalScopeProxy() const final; |
CSSPaintDefinition* FindDefinition(const String& name); |
void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*); |
DECLARE_VIRTUAL_TRACE(); |
private: |
+ friend class PaintWorkletTest; |
+ |
explicit PaintWorklet(LocalFrame*); |
- // TODO(nhiroki): Make (Paint)WorkletGlobalScopeProxy GC-managed object. |
- std::unique_ptr<PaintWorkletGlobalScopeProxy> global_scope_proxy_; |
+ // Implements MainThreadWorklet. |
+ bool NeedsToCreateGlobalScope() final; |
+ std::unique_ptr<WorkletGlobalScopeProxy> CreateGlobalScope() final; |
+ |
+ // Used for keeping pending generators until the first PaintWorkletGlobalScope |
+ // is created. Ownership of this registry is transferred to the global scope. |
+ Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_; |
}; |
} // namespace blink |