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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintWorklet.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/PaintWorklet.h
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h
index 59c61e500d6619fb4320bab1922818ad34afa63e..35848ae47a377fffa5686c60413a53c33d71be2d 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,25 @@ 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;
+
+ Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_;
+
+ // TODO(style-dev): Implement the "document paint definition" concept:
+ // https://drafts.css-houdini.org/css-paint-api/#document-paint-definition
+ // (https://crbug.com/578252)
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/csspaint/BUILD.gn ('k') | third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698