Chromium Code Reviews| Index: content/browser/debugger/devtools_manager.h |
| diff --git a/content/browser/debugger/devtools_manager.h b/content/browser/debugger/devtools_manager.h |
| index 43349040835e04b47f222f427d50a8930eaa04ba..6dbb3459641c731f234c2f262d41e7e3eab51ec7 100644 |
| --- a/content/browser/debugger/devtools_manager.h |
| +++ b/content/browser/debugger/devtools_manager.h |
| @@ -10,13 +10,12 @@ |
| #include <string> |
| #include "content/browser/debugger/devtools_client_host.h" |
| -#include "content/common/notification_observer.h" |
| -#include "content/common/notification_registrar.h" |
| namespace IPC { |
| class Message; |
| } |
| +class DevToolsAgentHost; |
| class DevToolsNetLogObserver; |
| class GURL; |
| class IOThread; |
| @@ -28,8 +27,7 @@ typedef std::map<std::string, std::string> DevToolsRuntimeProperties; |
| // This class is a singleton that manages DevToolsClientHost instances and |
| // routes messages between developer tools clients and agents. |
| -class DevToolsManager : public DevToolsClientHost::CloseListener, |
| - public NotificationObserver { |
| +class DevToolsManager : public DevToolsClientHost::CloseListener { |
| public: |
| static DevToolsManager* GetInstance(); |
| @@ -39,12 +37,14 @@ class DevToolsManager : public DevToolsClientHost::CloseListener, |
| // Returns DevToolsClientHost registered for |inspected_rvh| or NULL if |
| // there is no alive DevToolsClientHost registered for |inspected_rvh|. |
| DevToolsClientHost* GetDevToolsClientHostFor(RenderViewHost* inspected_rvh); |
|
pfeldman
2011/08/16 06:48:57
Could you group rvh methods and comment on the blo
yurys
2011/08/16 08:14:48
Done.
|
| + DevToolsClientHost* GetDevToolsClientHostFor(DevToolsAgentHost* agent_host); |
| // Registers new DevToolsClientHost for |inspected_rvh|. There must be no |
| // other DevToolsClientHosts registered for the RenderViewHost at the moment. |
| void RegisterDevToolsClientHostFor(RenderViewHost* inspected_rvh, |
| DevToolsClientHost* client_host); |
| void UnregisterDevToolsClientHostFor(RenderViewHost* inspected_rvh); |
| + void UnregisterDevToolsClientHostFor(DevToolsAgentHost* agent_host); |
| bool ForwardToDevToolsAgent(DevToolsClientHost* from, |
| const IPC::Message& message); |
| @@ -86,23 +86,17 @@ class DevToolsManager : public DevToolsClientHost::CloseListener, |
| // DevToolsClientHost. |
| virtual void ClientHostClosing(DevToolsClientHost* host); |
| - // Overridden from NotificationObserver: |
| - virtual void Observe(int type, |
| - const NotificationSource& source, |
| - const NotificationDetails& details); |
| - |
| - // Returns RenderViewHost for the tab that is inspected by devtools |
| - // client hosted by DevToolsClientHost. |
| - RenderViewHost* GetInspectedRenderViewHost(DevToolsClientHost* client_host); |
| + // Returns DevToolsAgentHost inspected by the DevToolsClientHost. |
| + DevToolsAgentHost* GetAgentHost(DevToolsClientHost* client_host); |
| void SendAttachToAgent(RenderViewHost* inspected_rvh); |
| - void SendDetachToAgent(RenderViewHost* inspected_rvh); |
| + void SendDetachToAgent(DevToolsAgentHost*); |
| void BindClientHost(RenderViewHost* inspected_rvh, |
|
pfeldman
2011/08/16 06:48:57
Bind and Unbind should operate similar terms. Coul
yurys
2011/08/16 08:14:48
Done.
|
| DevToolsClientHost* client_host, |
| const DevToolsRuntimeProperties& runtime_properties); |
| - void UnbindClientHost(RenderViewHost* inspected_rvh, |
| + void UnbindClientHost(DevToolsAgentHost* agent_host, |
| DevToolsClientHost* client_host); |
| // These two maps are for tracking dependencies between inspected tabs and |
| @@ -111,15 +105,15 @@ class DevToolsManager : public DevToolsClientHost::CloseListener, |
| // |
| // DevToolsManager start listening to DevToolsClientHosts when they are put |
| // into these maps and removes them when they are closing. |
| - typedef std::map<RenderViewHost*, DevToolsClientHost*> |
| - InspectedRvhToClientHostMap; |
| - InspectedRvhToClientHostMap inspected_rvh_to_client_host_; |
| + typedef std::map<DevToolsAgentHost*, DevToolsClientHost*> |
| + AgentToClientHostMap; |
| + AgentToClientHostMap agent_to_client_host_; |
| - typedef std::map<DevToolsClientHost*, RenderViewHost*> |
| + typedef std::map<DevToolsClientHost*, DevToolsAgentHost*> |
| ClientHostToInspectedRvhMap; |
| - ClientHostToInspectedRvhMap client_host_to_inspected_rvh_; |
| + ClientHostToInspectedRvhMap client_to_agent_host_; |
| - typedef std::map<RenderViewHost*, DevToolsRuntimeProperties> |
| + typedef std::map<DevToolsAgentHost*, DevToolsRuntimeProperties> |
| RuntimePropertiesMap; |
| RuntimePropertiesMap runtime_properties_map_; |
| @@ -129,8 +123,6 @@ class DevToolsManager : public DevToolsClientHost::CloseListener, |
| OrphanClientHosts orphan_client_hosts_; |
| int last_orphan_cookie_; |
| - NotificationRegistrar registrar_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
| }; |