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

Unified Diff: third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp

Issue 2910953002: Worklet: Enqueue tasks into outsideSetting's event loop (Closed)
Patch Set: fix 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698