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/service_worker_devtools_agent_host.h" | 7 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/browser/worker_service.h" | 10 #include "content/public/browser/worker_service.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 AgentHostMap::iterator it = workers_.find(id); | 111 AgentHostMap::iterator it = workers_.find(id); |
112 if (it == workers_.end()) | 112 if (it == workers_.end()) |
113 return; | 113 return; |
114 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; | 114 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; |
115 host->WorkerReadyForInspection(); | 115 host->WorkerReadyForInspection(); |
116 FOR_EACH_OBSERVER(Observer, observer_list_, | 116 FOR_EACH_OBSERVER(Observer, observer_list_, |
117 WorkerReadyForInspection(host.get())); | 117 WorkerReadyForInspection(host.get())); |
118 | 118 |
119 // Then bring up UI for the ones not picked by other clients. | 119 // Then bring up UI for the ones not picked by other clients. |
120 if (host->IsPausedForDebugOnStart() && !host->IsAttached()) | 120 if (host->IsPausedForDebugOnStart() && !host->IsAttached()) |
121 host->Inspect(); | 121 host->Inspect(nullptr); |
122 } | 122 } |
123 | 123 |
124 void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id, | 124 void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id, |
125 int worker_route_id) { | 125 int worker_route_id) { |
126 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 126 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
127 const WorkerId id(worker_process_id, worker_route_id); | 127 const WorkerId id(worker_process_id, worker_route_id); |
128 AgentHostMap::iterator it = workers_.find(id); | 128 AgentHostMap::iterator it = workers_.find(id); |
129 if (it == workers_.end()) | 129 if (it == workers_.end()) |
130 return; | 130 return; |
131 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; | 131 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 break; | 192 break; |
193 } | 193 } |
194 return it; | 194 return it; |
195 } | 195 } |
196 | 196 |
197 void ServiceWorkerDevToolsManager::ResetForTesting() { | 197 void ServiceWorkerDevToolsManager::ResetForTesting() { |
198 workers_.clear(); | 198 workers_.clear(); |
199 } | 199 } |
200 | 200 |
201 } // namespace content | 201 } // namespace content |
OLD | NEW |