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

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

Issue 2840473002: Worker: Remove WorkerLoaderProxy for clean-up (Closed)
Patch Set: clean up 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/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index e35a0aa7e1b4c994cbc6f2815e2ea7dc503045ad..d778af6b5c04079c1bc692bff4876f21fd26b901 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -201,6 +201,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());
@@ -287,12 +294,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,
@@ -534,6 +541,7 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
GlobalScope()->Dispose();
global_scope_scheduler_->Dispose();
console_message_storage_.Clear();
+ loading_context_.Clear();
GetWorkerBackingThread().BackingThread().RemoveTaskObserver(this);
}
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698