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*); |