OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_ |
6 #define CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_ | 6 #define CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/browser/worker_host/worker_service_observer.h" | 16 #include "content/browser/worker_host/worker_service_observer.h" |
17 | 17 |
18 class DevToolsAgentHost; | |
19 | |
20 namespace IPC { | 18 namespace IPC { |
21 class Message; | 19 class Message; |
22 } | 20 } |
23 | 21 |
| 22 namespace content { |
| 23 |
| 24 class DevToolsAgentHost; |
| 25 |
24 // All methods are supposed to be called on the IO thread. | 26 // All methods are supposed to be called on the IO thread. |
25 class WorkerDevToolsManager : private WorkerServiceObserver { | 27 class WorkerDevToolsManager : private WorkerServiceObserver { |
26 public: | 28 public: |
27 // Returns the WorkerDevToolsManager singleton. | 29 // Returns the WorkerDevToolsManager singleton. |
28 static WorkerDevToolsManager* GetInstance(); | 30 static WorkerDevToolsManager* GetInstance(); |
29 | 31 |
30 // Called on the UI thread. | 32 // Called on the UI thread. |
31 CONTENT_EXPORT static DevToolsAgentHost* GetDevToolsAgentHostForWorker( | 33 static DevToolsAgentHost* GetDevToolsAgentHostForWorker( |
32 int worker_process_id, | 34 int worker_process_id, |
33 int worker_route_id); | 35 int worker_route_id); |
34 | 36 |
35 void ForwardToDevToolsClient(int worker_process_id, | 37 void ForwardToDevToolsClient(int worker_process_id, |
36 int worker_route_id, | 38 int worker_route_id, |
37 const IPC::Message& message); | 39 const IPC::Message& message); |
38 void SaveAgentRuntimeState(int worker_process_id, | 40 void SaveAgentRuntimeState(int worker_process_id, |
39 int worker_route_id, | 41 int worker_route_id, |
40 const std::string& state); | 42 const std::string& state); |
41 | 43 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // from this list in one of two cases: | 105 // from this list in one of two cases: |
104 // - DevTools client is closed on the UI thread, WorkerDevToolsManager was | 106 // - DevTools client is closed on the UI thread, WorkerDevToolsManager was |
105 // notified about that on the IO thread and sent "resume" message to the | 107 // notified about that on the IO thread and sent "resume" message to the |
106 // worker. | 108 // worker. |
107 // - Existing DevTools client was reattached to the new worker. | 109 // - Existing DevTools client was reattached to the new worker. |
108 PausedWorkers paused_workers_; | 110 PausedWorkers paused_workers_; |
109 | 111 |
110 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsManager); | 112 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsManager); |
111 }; | 113 }; |
112 | 114 |
| 115 } // namespace content |
| 116 |
113 #endif // CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_ | 117 #endif // CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_ |
OLD | NEW |