| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // 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 |
| 36 // window for the same former SharedWorkerInstance is still opened. | 36 // window for the same former SharedWorkerInstance is still opened. |
| 37 bool WorkerCreated(int worker_process_id, | 37 bool WorkerCreated(int worker_process_id, |
| 38 int worker_route_id, | 38 int worker_route_id, |
| 39 const SharedWorkerInstance& instance); | 39 const SharedWorkerInstance& instance); |
| 40 void WorkerReadyForInspection(int worker_process_id, int worker_route_id); | 40 void WorkerReadyForInspection(int worker_process_id, int worker_route_id); |
| 41 void WorkerDestroyed(int worker_process_id, int worker_route_id); | 41 void WorkerDestroyed(int worker_process_id, int worker_route_id); |
| 42 void RemoveInspectedWorkerData(WorkerId id); | 42 void RemoveInspectedWorkerData(WorkerId id); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 friend struct DefaultSingletonTraits<SharedWorkerDevToolsManager>; | 45 friend struct base::DefaultSingletonTraits<SharedWorkerDevToolsManager>; |
| 46 friend class SharedWorkerDevToolsAgentHost; | 46 friend class SharedWorkerDevToolsAgentHost; |
| 47 friend class SharedWorkerDevToolsManagerTest; | 47 friend class SharedWorkerDevToolsManagerTest; |
| 48 FRIEND_TEST_ALL_PREFIXES(SharedWorkerDevToolsManagerTest, BasicTest); | 48 FRIEND_TEST_ALL_PREFIXES(SharedWorkerDevToolsManagerTest, BasicTest); |
| 49 FRIEND_TEST_ALL_PREFIXES(SharedWorkerDevToolsManagerTest, AttachTest); | 49 FRIEND_TEST_ALL_PREFIXES(SharedWorkerDevToolsManagerTest, AttachTest); |
| 50 | 50 |
| 51 using AgentHostMap = std::map<WorkerId, SharedWorkerDevToolsAgentHost*>; | 51 using AgentHostMap = std::map<WorkerId, SharedWorkerDevToolsAgentHost*>; |
| 52 | 52 |
| 53 SharedWorkerDevToolsManager(); | 53 SharedWorkerDevToolsManager(); |
| 54 ~SharedWorkerDevToolsManager(); | 54 ~SharedWorkerDevToolsManager(); |
| 55 | 55 |
| 56 AgentHostMap::iterator FindExistingWorkerAgentHost( | 56 AgentHostMap::iterator FindExistingWorkerAgentHost( |
| 57 const SharedWorkerInstance& instance); | 57 const SharedWorkerInstance& instance); |
| 58 | 58 |
| 59 // Resets to its initial state as if newly created. | 59 // Resets to its initial state as if newly created. |
| 60 void ResetForTesting(); | 60 void ResetForTesting(); |
| 61 | 61 |
| 62 AgentHostMap workers_; | 62 AgentHostMap workers_; |
| 63 DISALLOW_COPY_AND_ASSIGN(SharedWorkerDevToolsManager); | 63 DISALLOW_COPY_AND_ASSIGN(SharedWorkerDevToolsManager); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace content | 66 } // namespace content |
| 67 | 67 |
| 68 #endif // CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ | 68 #endif // CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_MANAGER_H_ |
| OLD | NEW |