| 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_agent_host_impl.h" | 7 #include "content/browser/devtools/devtools_agent_host_impl.h" |
| 8 #include "content/browser/devtools/service_worker_devtools_agent_host.h" | 8 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const ServiceWorkerIdentifier& other) const { | 41 const ServiceWorkerIdentifier& other) const { |
| 42 return context_ == other.context_ && version_id_ == other.version_id_; | 42 return context_ == other.context_ && version_id_ == other.version_id_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 ServiceWorkerDevToolsManager* ServiceWorkerDevToolsManager::GetInstance() { | 46 ServiceWorkerDevToolsManager* ServiceWorkerDevToolsManager::GetInstance() { |
| 47 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 47 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 48 return base::Singleton<ServiceWorkerDevToolsManager>::get(); | 48 return base::Singleton<ServiceWorkerDevToolsManager>::get(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 DevToolsAgentHostImpl* | 51 ServiceWorkerDevToolsAgentHost* |
| 52 ServiceWorkerDevToolsManager::GetDevToolsAgentHostForWorker( | 52 ServiceWorkerDevToolsManager::GetDevToolsAgentHostForWorker( |
| 53 int worker_process_id, | 53 int worker_process_id, |
| 54 int worker_route_id) { | 54 int worker_route_id) { |
| 55 AgentHostMap::iterator it = workers_.find( | 55 AgentHostMap::iterator it = workers_.find( |
| 56 WorkerId(worker_process_id, worker_route_id)); | 56 WorkerId(worker_process_id, worker_route_id)); |
| 57 return it == workers_.end() ? NULL : it->second; | 57 return it == workers_.end() ? NULL : it->second; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ServiceWorkerDevToolsManager::AddAllAgentHosts( | 60 void ServiceWorkerDevToolsManager::AddAllAgentHosts( |
| 61 ServiceWorkerDevToolsAgentHost::List* result) { | 61 ServiceWorkerDevToolsAgentHost::List* result) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 break; | 196 break; |
| 197 } | 197 } |
| 198 return it; | 198 return it; |
| 199 } | 199 } |
| 200 | 200 |
| 201 void ServiceWorkerDevToolsManager::ResetForTesting() { | 201 void ServiceWorkerDevToolsManager::ResetForTesting() { |
| 202 workers_.clear(); | 202 workers_.clear(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace content | 205 } // namespace content |
| OLD | NEW |