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_DEVTOOLS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/singleton.h" |
13 #include "content/browser/debugger/devtools_agent_host.h" | 14 #include "content/browser/debugger/devtools_agent_host.h" |
14 #include "content/browser/debugger/devtools_client_host.h" | 15 #include "content/browser/debugger/devtools_client_host.h" |
15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
16 | 17 |
17 class DevToolsAgentHost; | 18 class DevToolsAgentHost; |
18 class GURL; | 19 class GURL; |
19 class RenderViewHost; | 20 class RenderViewHost; |
20 class TabContents; | 21 class TabContents; |
21 | 22 |
22 namespace IPC { | 23 namespace IPC { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 82 |
82 void AttachClientHost(int client_host_cookie, | 83 void AttachClientHost(int client_host_cookie, |
83 DevToolsAgentHost* to_agent); | 84 DevToolsAgentHost* to_agent); |
84 DevToolsClientHost* GetDevToolsClientHostFor(DevToolsAgentHost* agent_host); | 85 DevToolsClientHost* GetDevToolsClientHostFor(DevToolsAgentHost* agent_host); |
85 void RegisterDevToolsClientHostFor(DevToolsAgentHost* agent_host, | 86 void RegisterDevToolsClientHostFor(DevToolsAgentHost* agent_host, |
86 DevToolsClientHost* client_host); | 87 DevToolsClientHost* client_host); |
87 void UnregisterDevToolsClientHostFor(DevToolsAgentHost* agent_host); | 88 void UnregisterDevToolsClientHostFor(DevToolsAgentHost* agent_host); |
88 int DetachClientHost(DevToolsAgentHost* from_agent); | 89 int DetachClientHost(DevToolsAgentHost* from_agent); |
89 | 90 |
90 private: | 91 private: |
| 92 friend struct DefaultSingletonTraits<DevToolsManager>; |
| 93 |
91 // DevToolsClientHost::CloseListener override. | 94 // DevToolsClientHost::CloseListener override. |
92 // This method will remove all references from the manager to the | 95 // This method will remove all references from the manager to the |
93 // DevToolsClientHost and unregister all listeners related to the | 96 // DevToolsClientHost and unregister all listeners related to the |
94 // DevToolsClientHost. | 97 // DevToolsClientHost. |
95 virtual void ClientHostClosing(DevToolsClientHost* host) OVERRIDE; | 98 virtual void ClientHostClosing(DevToolsClientHost* host) OVERRIDE; |
96 | 99 |
97 // DevToolsAgentHost::CloseListener implementation. | 100 // DevToolsAgentHost::CloseListener implementation. |
98 virtual void AgentHostClosing(DevToolsAgentHost* host) OVERRIDE; | 101 virtual void AgentHostClosing(DevToolsAgentHost* host) OVERRIDE; |
99 | 102 |
100 // Returns DevToolsAgentHost inspected by the DevToolsClientHost. | 103 // Returns DevToolsAgentHost inspected by the DevToolsClientHost. |
(...skipping 23 matching lines...) Expand all Loading... |
124 | 127 |
125 typedef std::map<int, std::pair<DevToolsClientHost*, std::string> > | 128 typedef std::map<int, std::pair<DevToolsClientHost*, std::string> > |
126 OrphanClientHosts; | 129 OrphanClientHosts; |
127 OrphanClientHosts orphan_client_hosts_; | 130 OrphanClientHosts orphan_client_hosts_; |
128 int last_orphan_cookie_; | 131 int last_orphan_cookie_; |
129 | 132 |
130 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); | 133 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
131 }; | 134 }; |
132 | 135 |
133 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 136 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
OLD | NEW |