OLD | NEW |
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/embedded_worker_devtools_agent_host.h" | 8 #include "content/browser/devtools/embedded_worker_devtools_agent_host.h" |
9 #include "content/browser/devtools/ipc_devtools_agent_host.h" | 9 #include "content/browser/devtools/ipc_devtools_agent_host.h" |
10 #include "content/browser/shared_worker/shared_worker_instance.h" | 10 #include "content/browser/shared_worker/shared_worker_instance.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 int worker_route_id) { | 132 int worker_route_id) { |
133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
134 const WorkerId id(worker_process_id, worker_route_id); | 134 const WorkerId id(worker_process_id, worker_route_id); |
135 AgentHostMap::iterator it = workers_.find(id); | 135 AgentHostMap::iterator it = workers_.find(id); |
136 DCHECK(it != workers_.end()); | 136 DCHECK(it != workers_.end()); |
137 scoped_refptr<EmbeddedWorkerDevToolsAgentHost> agent_host(it->second); | 137 scoped_refptr<EmbeddedWorkerDevToolsAgentHost> agent_host(it->second); |
138 agent_host->WorkerDestroyed(); | 138 agent_host->WorkerDestroyed(); |
139 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); | 139 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); |
140 } | 140 } |
141 | 141 |
| 142 void EmbeddedWorkerDevToolsManager::WorkerStopIgnored(int worker_process_id, |
| 143 int worker_route_id) { |
| 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 145 // TODO(pfeldman): Show a console message to tell the user that UA didn't |
| 146 // terminate the worker because devtools is attached. |
| 147 } |
| 148 |
142 void EmbeddedWorkerDevToolsManager::WorkerReadyForInspection( | 149 void EmbeddedWorkerDevToolsManager::WorkerReadyForInspection( |
143 int worker_process_id, | 150 int worker_process_id, |
144 int worker_route_id) { | 151 int worker_route_id) { |
145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 152 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
146 const WorkerId id(worker_process_id, worker_route_id); | 153 const WorkerId id(worker_process_id, worker_route_id); |
147 AgentHostMap::iterator it = workers_.find(id); | 154 AgentHostMap::iterator it = workers_.find(id); |
148 DCHECK(it != workers_.end()); | 155 DCHECK(it != workers_.end()); |
149 it->second->WorkerReadyForInspection(); | 156 it->second->WorkerReadyForInspection(); |
150 } | 157 } |
151 | 158 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 workers_.erase(it); | 203 workers_.erase(it); |
197 workers_[id] = agent_host; | 204 workers_[id] = agent_host; |
198 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); | 205 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); |
199 } | 206 } |
200 | 207 |
201 void EmbeddedWorkerDevToolsManager::ResetForTesting() { | 208 void EmbeddedWorkerDevToolsManager::ResetForTesting() { |
202 workers_.clear(); | 209 workers_.clear(); |
203 } | 210 } |
204 | 211 |
205 } // namespace content | 212 } // namespace content |
OLD | NEW |