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/shared_worker_devtools_manager.h" | 5 #include "content/browser/devtools/shared_worker_devtools_manager.h" |
6 | 6 |
7 #include "content/browser/devtools/shared_worker_devtools_agent_host.h" | 7 #include "content/browser/devtools/shared_worker_devtools_agent_host.h" |
8 #include "content/browser/shared_worker/shared_worker_instance.h" | 8 #include "content/browser/shared_worker/shared_worker_instance.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // static | 13 // static |
14 SharedWorkerDevToolsManager* SharedWorkerDevToolsManager::GetInstance() { | 14 SharedWorkerDevToolsManager* SharedWorkerDevToolsManager::GetInstance() { |
15 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 15 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
16 return Singleton<SharedWorkerDevToolsManager>::get(); | 16 return base::Singleton<SharedWorkerDevToolsManager>::get(); |
17 } | 17 } |
18 | 18 |
19 DevToolsAgentHostImpl* | 19 DevToolsAgentHostImpl* |
20 SharedWorkerDevToolsManager::GetDevToolsAgentHostForWorker( | 20 SharedWorkerDevToolsManager::GetDevToolsAgentHostForWorker( |
21 int worker_process_id, | 21 int worker_process_id, |
22 int worker_route_id) { | 22 int worker_route_id) { |
23 AgentHostMap::iterator it = workers_.find( | 23 AgentHostMap::iterator it = workers_.find( |
24 WorkerId(worker_process_id, worker_route_id)); | 24 WorkerId(worker_process_id, worker_route_id)); |
25 return it == workers_.end() ? NULL : it->second; | 25 return it == workers_.end() ? NULL : it->second; |
26 } | 26 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 return it; | 96 return it; |
97 } | 97 } |
98 | 98 |
99 void SharedWorkerDevToolsManager::ResetForTesting() { | 99 void SharedWorkerDevToolsManager::ResetForTesting() { |
100 workers_.clear(); | 100 workers_.clear(); |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 } // namespace content | 104 } // namespace content |
OLD | NEW |