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

Unified Diff: content/browser/devtools/protocol/service_worker_handler.cc

Issue 1024543003: DevTools: hand over SW inspection to chrome://inspect upon request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment addressed. Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698