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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 const WorkerId id(worker_process_id, worker_route_id); | 110 const WorkerId id(worker_process_id, worker_route_id); |
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(RenderProcessHost::FromID(worker_process_id)-> | 121 host->Inspect(); |
122 GetBrowserContext()); | |
123 } | |
124 } | 122 } |
125 | 123 |
126 void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id, | 124 void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id, |
127 int worker_route_id) { | 125 int worker_route_id) { |
128 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 126 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
129 const WorkerId id(worker_process_id, worker_route_id); | 127 const WorkerId id(worker_process_id, worker_route_id); |
130 AgentHostMap::iterator it = workers_.find(id); | 128 AgentHostMap::iterator it = workers_.find(id); |
131 if (it == workers_.end()) | 129 if (it == workers_.end()) |
132 return; | 130 return; |
133 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... |
194 break; | 192 break; |
195 } | 193 } |
196 return it; | 194 return it; |
197 } | 195 } |
198 | 196 |
199 void ServiceWorkerDevToolsManager::ResetForTesting() { | 197 void ServiceWorkerDevToolsManager::ResetForTesting() { |
200 workers_.clear(); | 198 workers_.clear(); |
201 } | 199 } |
202 | 200 |
203 } // namespace content | 201 } // namespace content |
OLD | NEW |