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

Side by Side Diff: content/browser/devtools/embedded_worker_devtools_manager.cc

Issue 761923004: Keep alive ServiceWorkers when devtools is attached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/devtools/embedded_worker_devtools_manager.h" 5 #include "content/browser/devtools/embedded_worker_devtools_manager.h"
6 6
7 #include "content/browser/devtools/devtools_manager.h" 7 #include "content/browser/devtools/devtools_manager.h"
8 #include "content/browser/devtools/devtools_protocol.h" 8 #include "content/browser/devtools/devtools_protocol.h"
9 #include "content/browser/devtools/embedded_worker_devtools_agent_host.h" 9 #include "content/browser/devtools/embedded_worker_devtools_agent_host.h"
10 #include "content/browser/devtools/ipc_devtools_agent_host.h" 10 #include "content/browser/devtools/ipc_devtools_agent_host.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 int worker_route_id) { 133 int worker_route_id) {
134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
135 const WorkerId id(worker_process_id, worker_route_id); 135 const WorkerId id(worker_process_id, worker_route_id);
136 AgentHostMap::iterator it = workers_.find(id); 136 AgentHostMap::iterator it = workers_.find(id);
137 DCHECK(it != workers_.end()); 137 DCHECK(it != workers_.end());
138 scoped_refptr<EmbeddedWorkerDevToolsAgentHost> agent_host(it->second); 138 scoped_refptr<EmbeddedWorkerDevToolsAgentHost> agent_host(it->second);
139 agent_host->WorkerDestroyed(); 139 agent_host->WorkerDestroyed();
140 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); 140 DevToolsManager::GetInstance()->AgentHostChanged(agent_host);
141 } 141 }
142 142
143 void EmbeddedWorkerDevToolsManager::WorkerStopIgnored(int worker_process_id,
144 int worker_route_id) {
145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
146 // TODO(kinuko,pfeldman): Show a console message to tell the user that
147 // UA didn't terminate the worker because devtools is attached.
148 }
149
143 void EmbeddedWorkerDevToolsManager::WorkerReadyForInspection( 150 void EmbeddedWorkerDevToolsManager::WorkerReadyForInspection(
144 int worker_process_id, 151 int worker_process_id,
145 int worker_route_id) { 152 int worker_route_id) {
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 153 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
147 const WorkerId id(worker_process_id, worker_route_id); 154 const WorkerId id(worker_process_id, worker_route_id);
148 AgentHostMap::iterator it = workers_.find(id); 155 AgentHostMap::iterator it = workers_.find(id);
149 DCHECK(it != workers_.end()); 156 DCHECK(it != workers_.end());
150 it->second->WorkerReadyForInspection(); 157 it->second->WorkerReadyForInspection();
151 } 158 }
152 159
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 workers_.erase(it); 204 workers_.erase(it);
198 workers_[id] = agent_host; 205 workers_[id] = agent_host;
199 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); 206 DevToolsManager::GetInstance()->AgentHostChanged(agent_host);
200 } 207 }
201 208
202 void EmbeddedWorkerDevToolsManager::ResetForTesting() { 209 void EmbeddedWorkerDevToolsManager::ResetForTesting() {
203 workers_.clear(); 210 workers_.clear();
204 } 211 }
205 212
206 } // namespace content 213 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698