| 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/devtools_protocol.h" | 8 #include "content/browser/devtools/devtools_protocol.h" |
| 9 #include "content/browser/devtools/devtools_protocol_constants.h" | 9 #include "content/browser/devtools/devtools_protocol_constants.h" |
| 10 #include "content/browser/devtools/embedded_worker_devtools_agent_host.h" | 10 #include "content/browser/devtools/embedded_worker_devtools_agent_host.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void EmbeddedWorkerDevToolsManager::WorkerReadyForInspection( | 144 void EmbeddedWorkerDevToolsManager::WorkerReadyForInspection( |
| 145 int worker_process_id, | 145 int worker_process_id, |
| 146 int worker_route_id) { | 146 int worker_route_id) { |
| 147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 148 const WorkerId id(worker_process_id, worker_route_id); | 148 const WorkerId id(worker_process_id, worker_route_id); |
| 149 AgentHostMap::iterator it = workers_.find(id); | 149 AgentHostMap::iterator it = workers_.find(id); |
| 150 DCHECK(it != workers_.end()); | 150 DCHECK(it != workers_.end()); |
| 151 it->second->WorkerReadyForInspection(); | 151 it->second->WorkerReadyForInspection(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void EmbeddedWorkerDevToolsManager::WorkerContextStarted(int worker_process_id, | |
| 155 int worker_route_id) { | |
| 156 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 157 const WorkerId id(worker_process_id, worker_route_id); | |
| 158 AgentHostMap::iterator it = workers_.find(id); | |
| 159 DCHECK(it != workers_.end()); | |
| 160 it->second->WorkerContextStarted(); | |
| 161 } | |
| 162 | |
| 163 void EmbeddedWorkerDevToolsManager::RemoveInspectedWorkerData(WorkerId id) { | 154 void EmbeddedWorkerDevToolsManager::RemoveInspectedWorkerData(WorkerId id) { |
| 164 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 165 workers_.erase(id); | 156 workers_.erase(id); |
| 166 } | 157 } |
| 167 | 158 |
| 168 EmbeddedWorkerDevToolsManager::AgentHostMap::iterator | 159 EmbeddedWorkerDevToolsManager::AgentHostMap::iterator |
| 169 EmbeddedWorkerDevToolsManager::FindExistingSharedWorkerAgentHost( | 160 EmbeddedWorkerDevToolsManager::FindExistingSharedWorkerAgentHost( |
| 170 const SharedWorkerInstance& instance) { | 161 const SharedWorkerInstance& instance) { |
| 171 AgentHostMap::iterator it = workers_.begin(); | 162 AgentHostMap::iterator it = workers_.begin(); |
| 172 for (; it != workers_.end(); ++it) { | 163 for (; it != workers_.end(); ++it) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 workers_.erase(it); | 198 workers_.erase(it); |
| 208 workers_[id] = agent_host; | 199 workers_[id] = agent_host; |
| 209 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); | 200 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); |
| 210 } | 201 } |
| 211 | 202 |
| 212 void EmbeddedWorkerDevToolsManager::ResetForTesting() { | 203 void EmbeddedWorkerDevToolsManager::ResetForTesting() { |
| 213 workers_.clear(); | 204 workers_.clear(); |
| 214 } | 205 } |
| 215 | 206 |
| 216 } // namespace content | 207 } // namespace content |
| OLD | NEW |