Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp |
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp |
index 8966c10d921b29417784fb9969cec339b30ca480..1ef91922501906ce103723a78ce420a3a09d7886 100644 |
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp |
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp |
@@ -203,6 +203,13 @@ bool WorkerThread::IsCurrentThread() { |
return GetWorkerBackingThread().BackingThread().IsCurrentThread(); |
} |
+ThreadableLoadingContext* WorkerThread::GetLoadingContext() { |
+ DCHECK(IsCurrentThread()); |
+ // This should be never called after the termination sequence starts. |
+ DCHECK(loading_context_); |
+ return loading_context_; |
+} |
+ |
void WorkerThread::AppendDebuggerTask( |
std::unique_ptr<CrossThreadClosure> task) { |
DCHECK(IsMainThread()); |
@@ -289,12 +296,12 @@ bool WorkerThread::IsForciblyTerminated() { |
return false; |
} |
-WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> worker_loader_proxy, |
+WorkerThread::WorkerThread(ThreadableLoadingContext* loading_context, |
WorkerReportingProxy& worker_reporting_proxy) |
: worker_thread_id_(GetNextWorkerThreadId()), |
forcible_termination_delay_in_ms_(kForcibleTerminationDelayInMs), |
inspector_task_runner_(WTF::MakeUnique<InspectorTaskRunner>()), |
- worker_loader_proxy_(std::move(worker_loader_proxy)), |
+ loading_context_(loading_context), |
worker_reporting_proxy_(worker_reporting_proxy), |
shutdown_event_(WTF::WrapUnique( |
new WaitableEvent(WaitableEvent::ResetPolicy::kManual, |
@@ -530,6 +537,7 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { |
GlobalScope()->Dispose(); |
global_scope_scheduler_->Dispose(); |
console_message_storage_.Clear(); |
+ loading_context_.Clear(); |
GetWorkerBackingThread().BackingThread().RemoveTaskObserver(this); |
} |