Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "content/public/browser/devtools_agent_host.h" | 13 #include "content/public/browser/devtools_agent_host.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class DevToolsAgentHostImpl; | 17 class DevToolsAgentHostImpl; |
| 18 class SharedWorkerDevToolsAgentHost; | 18 class SharedWorkerDevToolsAgentHost; |
| 19 class SharedWorkerInstance; | 19 class SharedWorkerInstance; |
| 20 | 20 |
| 21 // Manages WorkerDevToolsAgentHost's for Shared Workers. | 21 // Manages WorkerDevToolsAgentHost's for Shared Workers. |
| 22 // This class lives on UI thread. | 22 // This class lives on UI thread. |
| 23 class CONTENT_EXPORT SharedWorkerDevToolsManager { | 23 class CONTENT_EXPORT SharedWorkerDevToolsManager { |
| 24 public: | 24 public: |
| 25 typedef std::pair<int, int> WorkerId; | 25 using WorkerId = std::pair<int, int>; |
| 26 | 26 |
| 27 // Returns the SharedWorkerDevToolsManager singleton. | 27 // Returns the SharedWorkerDevToolsManager singleton. |
| 28 static SharedWorkerDevToolsManager* GetInstance(); | 28 static SharedWorkerDevToolsManager* GetInstance(); |
| 29 | 29 |
| 30 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id, | 30 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id, |
| 31 int worker_route_id); | 31 int worker_route_id); |
| 32 void AddAllAgentHosts(DevToolsAgentHost::List* result); | 32 void AddAllAgentHosts( |
| 33 std::vector<scoped_refptr<SharedWorkerDevToolsAgentHost>>* result); | |
|
dgozman
2015/03/08 15:27:08
SharedWorkerDevToolsAgentHost::List
pfeldman
2015/03/08 15:34:15
Can't do that, the .h dependency is the other way
| |
| 33 | 34 |
| 34 // Returns true when the worker must be paused on start because a DevTool | 35 // Returns true when the worker must be paused on start because a DevTool |
| 35 // window for the same former SharedWorkerInstance is still opened. | 36 // window for the same former SharedWorkerInstance is still opened. |
| 36 bool WorkerCreated(int worker_process_id, | 37 bool WorkerCreated(int worker_process_id, |
| 37 int worker_route_id, | 38 int worker_route_id, |
| 38 const SharedWorkerInstance& instance); | 39 const SharedWorkerInstance& instance); |
| 39 void WorkerReadyForInspection(int worker_process_id, int worker_route_id); | 40 void WorkerReadyForInspection(int worker_process_id, int worker_route_id); |
| 40 void WorkerDestroyed(int worker_process_id, int worker_route_id); | 41 void WorkerDestroyed(int worker_process_id, int worker_route_id); |
| 41 void RemoveInspectedWorkerData(WorkerId id); | 42 void RemoveInspectedWorkerData(WorkerId id); |
| 42 | 43 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 58 // Resets to its initial state as if newly created. | 59 // Resets to its initial state as if newly created. |
| 59 void ResetForTesting(); | 60 void ResetForTesting(); |
| 60 | 61 |
| 61 AgentHostMap workers_; | 62 AgentHostMap workers_; |
| 62 DISALLOW_COPY_AND_ASSIGN(SharedWorkerDevToolsManager); | 63 DISALLOW_COPY_AND_ASSIGN(SharedWorkerDevToolsManager); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace content | 66 } // namespace content |
| 66 | 67 |
| 67 #endif // CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ | 68 #endif // CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ |
| OLD | NEW |