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_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_EMBEDDED_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/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "content/browser/shared_worker/shared_worker_instance.h" | 15 #include "content/browser/shared_worker/shared_worker_instance.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
| 20 class DevToolsAgentHost; |
20 class DevToolsAgentHostImpl; | 21 class DevToolsAgentHostImpl; |
21 class EmbeddedWorkerDevToolsAgentHost; | 22 class EmbeddedWorkerDevToolsAgentHost; |
22 class ServiceWorkerContextCore; | 23 class ServiceWorkerContextCore; |
23 | 24 |
24 // EmbeddedWorkerDevToolsManager is used instead of WorkerDevToolsManager when | 25 // EmbeddedWorkerDevToolsManager is used instead of WorkerDevToolsManager when |
25 // "enable-embedded-shared-worker" flag is set. | 26 // "enable-embedded-shared-worker" flag is set. |
26 // This class lives on UI thread. | 27 // This class lives on UI thread. |
27 class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { | 28 class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { |
28 public: | 29 public: |
29 typedef std::pair<int, int> WorkerId; | 30 typedef std::pair<int, int> WorkerId; |
(...skipping 14 matching lines...) Expand all Loading... |
44 }; | 45 }; |
45 | 46 |
46 // Returns the EmbeddedWorkerDevToolsManager singleton. | 47 // Returns the EmbeddedWorkerDevToolsManager singleton. |
47 static EmbeddedWorkerDevToolsManager* GetInstance(); | 48 static EmbeddedWorkerDevToolsManager* GetInstance(); |
48 | 49 |
49 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id, | 50 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id, |
50 int worker_route_id); | 51 int worker_route_id); |
51 DevToolsAgentHostImpl* GetDevToolsAgentHostForServiceWorker( | 52 DevToolsAgentHostImpl* GetDevToolsAgentHostForServiceWorker( |
52 const ServiceWorkerIdentifier& service_worker_id); | 53 const ServiceWorkerIdentifier& service_worker_id); |
53 | 54 |
| 55 std::vector<scoped_refptr<DevToolsAgentHost> > GetOrCreateAllAgentHosts(); |
| 56 |
54 // Returns true when the worker must be paused on start because a DevTool | 57 // Returns true when the worker must be paused on start because a DevTool |
55 // window for the same former SharedWorkerInstance is still opened. | 58 // window for the same former SharedWorkerInstance is still opened. |
56 bool SharedWorkerCreated(int worker_process_id, | 59 bool SharedWorkerCreated(int worker_process_id, |
57 int worker_route_id, | 60 int worker_route_id, |
58 const SharedWorkerInstance& instance); | 61 const SharedWorkerInstance& instance); |
59 // Returns true when the worker must be paused on start because a DevTool | 62 // Returns true when the worker must be paused on start because a DevTool |
60 // window for the same former ServiceWorkerIdentifier is still opened or | 63 // window for the same former ServiceWorkerIdentifier is still opened or |
61 // debug-on-start is enabled in chrome://serviceworker-internals. | 64 // debug-on-start is enabled in chrome://serviceworker-internals. |
62 bool ServiceWorkerCreated(int worker_process_id, | 65 bool ServiceWorkerCreated(int worker_process_id, |
63 int worker_route_id, | 66 int worker_route_id, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 AgentHostMap workers_; | 102 AgentHostMap workers_; |
100 | 103 |
101 bool debug_service_worker_on_start_; | 104 bool debug_service_worker_on_start_; |
102 | 105 |
103 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager); | 106 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager); |
104 }; | 107 }; |
105 | 108 |
106 } // namespace content | 109 } // namespace content |
107 | 110 |
108 #endif // CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ | 111 #endif // CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ |
OLD | NEW |