Index: third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp |
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp |
index 7ebd858623274338dc5f0da00b9d9f60b316c39c..06b37398f63d07fbc8f78dc885ec1d443a7a29f0 100644 |
--- a/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp |
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp |
@@ -15,8 +15,7 @@ |
namespace blink { |
-ThreadedWorklet::ThreadedWorklet(LocalFrame* frame) |
- : Worklet(frame), frame_(frame) {} |
+ThreadedWorklet::ThreadedWorklet(LocalFrame* frame) : Worklet(frame) {} |
void ThreadedWorklet::FetchAndInvokeScript(const KURL& module_url_record, |
const WorkletOptions&, |
@@ -28,8 +27,8 @@ void ThreadedWorklet::FetchAndInvokeScript(const KURL& module_url_record, |
if (!IsInitialized()) |
Initialize(); |
- WorkletScriptLoader* script_loader = |
- WorkletScriptLoader::Create(frame_->GetDocument()->Fetcher(), this); |
+ WorkletScriptLoader* script_loader = WorkletScriptLoader::Create( |
+ ToDocument(GetExecutionContext())->Fetcher(), this); |
loader_to_resolver_map_.Set(script_loader, resolver); |
script_loader->FetchScript(module_url_record); |
} |
@@ -57,11 +56,9 @@ void ThreadedWorklet::ContextDestroyed(ExecutionContext* execution_context) { |
loader_to_resolver_map_.clear(); |
if (IsInitialized()) |
GetWorkletGlobalScopeProxy()->TerminateWorkletGlobalScope(); |
- frame_ = nullptr; |
} |
DEFINE_TRACE(ThreadedWorklet) { |
- visitor->Trace(frame_); |
visitor->Trace(loader_to_resolver_map_); |
Worklet::Trace(visitor); |
} |