Commit 25d14cc7 authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: hand over SW inspection to chrome://inspect upon request.

BUG=463892

Review URL: https://codereview.chromium.org/1024543003

Cr-Commit-Position: refs/heads/master@{#321553}
parent 63bf923a
......@@ -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);
......
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