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

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: 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..4750a490e91bea6c6a86287ec993040a39cd3ed7 100644
--- a/content/browser/devtools/protocol/service_worker_handler.cc
+++ b/content/browser/devtools/protocol/service_worker_handler.cc
@@ -192,8 +192,10 @@ void ServiceWorkerHandler::UpdateHosts() {
GetMatchingServiceWorkers(urls_);
for (auto pair : old_hosts) {
- if (new_hosts.find(pair.first) == new_hosts.end())
+ if (new_hosts.find(pair.first) == new_hosts.end()) {
+ pair.second->DetachClient();
ReportWorkerTerminated(pair.second.get());
+ }
}
for (auto pair : new_hosts) {
@@ -299,13 +301,13 @@ void ServiceWorkerHandler::DispatchProtocolMessage(
void ServiceWorkerHandler::AgentHostClosed(
DevToolsAgentHost* host,
bool replaced_with_another_client) {
- WorkerDestroyed(static_cast<ServiceWorkerDevToolsAgentHost*>(host));
+ ReportWorkerTerminated(static_cast<ServiceWorkerDevToolsAgentHost*>(host));
dgozman 2015/03/20 09:42:44 Let's remove host from |attached_hosts_| right her
pfeldman 2015/03/20 10:05:25 What you are suggesting is worse since we should o
}
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,6 @@ void ServiceWorkerHandler::ReportWorkerTerminated(
auto it = attached_hosts_.find(host->GetId());
if (it == attached_hosts_.end())
return;
- it->second->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