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/service_worker_devtools_manager.h" | 5 #include "content/browser/devtools/service_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/ipc_devtools_agent_host.h" | 8 #include "content/browser/devtools/ipc_devtools_agent_host.h" |
9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" | 9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return host->IsPausedForDebugOnStart(); | 84 return host->IsPausedForDebugOnStart(); |
85 } | 85 } |
86 | 86 |
87 // Worker was restarted. | 87 // Worker was restarted. |
88 ServiceWorkerDevToolsAgentHost* agent_host = it->second; | 88 ServiceWorkerDevToolsAgentHost* agent_host = it->second; |
89 agent_host->WorkerRestarted(id); | 89 agent_host->WorkerRestarted(id); |
90 workers_.erase(it); | 90 workers_.erase(it); |
91 workers_[id] = agent_host; | 91 workers_[id] = agent_host; |
92 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); | 92 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); |
93 | 93 |
94 return it->second->IsAttached(); | 94 return agent_host->IsAttached(); |
95 } | 95 } |
96 | 96 |
97 void ServiceWorkerDevToolsManager::WorkerReadyForInspection( | 97 void ServiceWorkerDevToolsManager::WorkerReadyForInspection( |
98 int worker_process_id, | 98 int worker_process_id, |
99 int worker_route_id) { | 99 int worker_route_id) { |
100 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 100 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
101 const WorkerId id(worker_process_id, worker_route_id); | 101 const WorkerId id(worker_process_id, worker_route_id); |
102 AgentHostMap::iterator it = workers_.find(id); | 102 AgentHostMap::iterator it = workers_.find(id); |
103 DCHECK(it != workers_.end()); | 103 DCHECK(it != workers_.end()); |
104 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; | 104 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 break; | 169 break; |
170 } | 170 } |
171 return it; | 171 return it; |
172 } | 172 } |
173 | 173 |
174 void ServiceWorkerDevToolsManager::ResetForTesting() { | 174 void ServiceWorkerDevToolsManager::ResetForTesting() { |
175 workers_.clear(); | 175 workers_.clear(); |
176 } | 176 } |
177 | 177 |
178 } // namespace content | 178 } // namespace content |
OLD | NEW |