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

Unified Diff: third_party/WebKit/Source/core/workers/MainThreadWorklet.h

Issue 2871513002: Worklet: Lazily create PaintWorkletGlobalScopes (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/MainThreadWorklet.h
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorklet.h b/third_party/WebKit/Source/core/workers/MainThreadWorklet.h
index e6b5c8578b3986d939aa7b2c42146a6d8ced3aa9..8350189cccc1a6b55bf06ba2536692d1f2825101 100644
--- a/third_party/WebKit/Source/core/workers/MainThreadWorklet.h
+++ b/third_party/WebKit/Source/core/workers/MainThreadWorklet.h
@@ -15,6 +15,7 @@ namespace blink {
class LocalFrame;
class ScriptPromiseResolver;
+class WorkletGlobalScopeProxy;
// A MainThreadWorklet is a worklet that runs only on the main thread.
// TODO(nhiroki): This is a temporary class to support module loading for main
@@ -38,6 +39,19 @@ class CORE_EXPORT MainThreadWorklet : public Worklet {
protected:
explicit MainThreadWorklet(LocalFrame*);
+ // Creates WorkletGlobalScope and adds it into |global_scope_proxies_| if
+ // there are not global scopes or additional global scopes are necessary.
+ virtual void AddWorkletGlobalScopesIfNeeded() = 0;
kouhei (in TOK) 2017/05/08 13:13:19 Can we have a virtual WorkletGlobalScopeProxy* Cre
nhiroki 2017/05/10 09:01:31 Replaced this with NeedsToCreateGlobalScope() and
+
+ // "A Worklet has a list of the worklet's WorkletGlobalScopes. Initially this
+ // list is empty; it is populated when the user agent chooses to create its
+ // WorkletGlobalScope."
+ // https://drafts.css-houdini.org/worklets/#worklet-section
+ // TODO(nhiroki): Make (Paint)WorkletGlobalScopeProxy GC-managed object to
+ // avoid that GC graphs are disjointed (PaintWorkletGlobalScopeProxy has a
+ // persistent holder for PaintWorkletGlobalscope).
kouhei (in TOK) 2017/05/08 13:13:19 +1. Can we give a crbug # to this?
nhiroki 2017/05/10 09:01:31 Added a crbug link.
+ WTF::HashSet<std::unique_ptr<WorkletGlobalScopeProxy>> global_scope_proxies_;
+
private:
void FetchAndInvokeScript(const KURL& module_url_record,
ScriptPromiseResolver*);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698