Commit bf942a81 authored by Hiroki Nakagawa's avatar Hiroki Nakagawa Committed by Commit Bot

ServiceWorker: Remove unnecessary WorkerContextFailedToStartOnInitiatorThread()

WebServiceWorkerContextClient::WorkerContextFailedToStartOnInitiatorThread() is
no longer necessary. Off-the-main-thread service worker script fetch
removed the path where service worker startup fails before starting a
service worker thread.

Bug: 1005650
Change-Id: I090c97a020ec19ef95a3e402a0d7382407b3607b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1820917Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699266}
parent cd722c54
......@@ -199,19 +199,6 @@ void ServiceWorkerContextClient::WorkerReadyForInspectionOnInitiatorThread(
std::move(receiver));
}
void ServiceWorkerContextClient::WorkerContextFailedToStartOnInitiatorThread() {
DCHECK(initiator_thread_task_runner_->RunsTasksInCurrentSequence());
DCHECK(!proxy_);
instance_host_->OnStopped();
TRACE_EVENT_NESTABLE_ASYNC_END1(
"ServiceWorker", "ServiceWorkerContextClient", this, "Status",
"WorkerContextFailedToStartOnInitiatorThread");
owner_->WorkerContextDestroyed();
}
void ServiceWorkerContextClient::FailedToLoadClassicScript() {
DCHECK(worker_task_runner_->RunsTasksInCurrentSequence());
TRACE_EVENT_NESTABLE_ASYNC_END1("ServiceWorker", "LOAD_SCRIPT", this,
......
......@@ -125,7 +125,6 @@ class CONTENT_EXPORT ServiceWorkerContextClient
void WorkerReadyForInspectionOnInitiatorThread(
mojo::ScopedMessagePipeHandle devtools_agent_ptr_info,
mojo::ScopedMessagePipeHandle devtools_agent_host_request) override;
void WorkerContextFailedToStartOnInitiatorThread() override;
void FailedToLoadClassicScript() override;
void FailedToFetchModuleScript() override;
void WorkerScriptLoadedOnWorkerThread() override;
......
......@@ -81,11 +81,6 @@ class WebServiceWorkerContextClient {
mojo::ScopedMessagePipeHandle devtools_agent_ptr_info,
mojo::ScopedMessagePipeHandle devtools_agent_host_request) {}
// Starting the worker failed. This could happen when loading the worker
// script failed, or the worker was asked to terminate before startup
// completed. Called on the initiator thread.
virtual void WorkerContextFailedToStartOnInitiatorThread() {}
// The worker started but it could not execute because loading the classic
// script failed on the worker thread. This is called only for installed
// scripts fetch or off-the-main-thread classic worker script fetch.
......
......@@ -167,15 +167,8 @@ void WebEmbeddedWorkerImpl::TerminateWorkerContext() {
if (asked_to_terminate_)
return;
asked_to_terminate_ = true;
if (!worker_thread_) {
// The worker thread has not been created yet if the worker is asked to
// terminate during waiting for debugger.
DCHECK_EQ(WebEmbeddedWorkerStartData::kWaitForDebugger,
worker_start_data_.wait_for_debugger_mode);
// This deletes 'this'.
worker_context_client_->WorkerContextFailedToStartOnInitiatorThread();
return;
}
// StartWorkerThread() must be called before.
DCHECK(worker_thread_);
worker_thread_->Terminate();
}
......
......@@ -125,7 +125,6 @@ class MockServiceWorkerContextClient final
MOCK_METHOD2(WorkerReadyForInspectionOnInitiatorThread,
void(mojo::ScopedMessagePipeHandle,
mojo::ScopedMessagePipeHandle));
MOCK_METHOD0(WorkerContextFailedToStartOnInitiatorThread, void());
void WorkerContextStarted(WebServiceWorkerContextProxy* proxy,
scoped_refptr<base::SequencedTaskRunner>) override {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment