| Index: content/browser/devtools/protocol/service_worker_handler.cc
|
| diff --git a/content/browser/devtools/protocol/service_worker_handler.cc b/content/browser/devtools/protocol/service_worker_handler.cc
|
| index 995442f1c36b854f0504fa9634d39e290e5c0916..788bcb0c6d8c57673efed5154944c86d7f8b4bcd 100644
|
| --- a/content/browser/devtools/protocol/service_worker_handler.cc
|
| +++ b/content/browser/devtools/protocol/service_worker_handler.cc
|
| @@ -299,13 +299,15 @@ void ServiceWorkerHandler::DispatchProtocolMessage(
|
| void ServiceWorkerHandler::AgentHostClosed(
|
| DevToolsAgentHost* host,
|
| bool replaced_with_another_client) {
|
| - WorkerDestroyed(static_cast<ServiceWorkerDevToolsAgentHost*>(host));
|
| + client_->WorkerTerminated(WorkerTerminatedParams::Create()->
|
| + set_worker_id(host->GetId()));
|
| + attached_hosts_.erase(host->GetId());
|
| }
|
|
|
| void ServiceWorkerHandler::WorkerCreated(
|
| ServiceWorkerDevToolsAgentHost* host) {
|
| auto hosts = GetMatchingServiceWorkers(urls_);
|
| - if (hosts.find(host->GetId()) != hosts.end())
|
| + if (hosts.find(host->GetId()) != hosts.end() && !host->IsAttached())
|
| host->PauseForDebugOnStart();
|
| }
|
|
|
| @@ -335,7 +337,7 @@ void ServiceWorkerHandler::ReportWorkerTerminated(
|
| auto it = attached_hosts_.find(host->GetId());
|
| if (it == attached_hosts_.end())
|
| return;
|
| - it->second->DetachClient();
|
| + host->DetachClient();
|
| client_->WorkerTerminated(WorkerTerminatedParams::Create()->
|
| set_worker_id(host->GetId()));
|
| attached_hosts_.erase(it);
|
|
|