Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Unified Diff: content/browser/debugger/devtools_manager.h

Issue 7774004: Revert 98552 (OpenAndManuallyCloseDevToolsClientHost now fails on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/debugger/devtools_agent_host.cc ('k') | content/browser/debugger/devtools_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/debugger/devtools_manager.h
===================================================================
--- content/browser/debugger/devtools_manager.h (revision 98553)
+++ content/browser/debugger/devtools_manager.h (working copy)
@@ -9,14 +9,14 @@
#include <map>
#include <string>
-#include "content/browser/debugger/devtools_agent_host.h"
#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,12 +28,8 @@
// This class is a singleton that manages DevToolsClientHost instances and
// routes messages between developer tools clients and agents.
-//
-// Methods below that accept inspected RenderViewHost as a parameter are
-// just convenience methods that call corresponding methods accepting
-// DevToolAgentHost.
class DevToolsManager : public DevToolsClientHost::CloseListener,
- public DevToolsAgentHost::CloseListener {
+ public NotificationObserver {
public:
static DevToolsManager* GetInstance();
@@ -83,9 +79,6 @@
// Closes all open developer tools windows.
void CloseAllClientHosts();
- DevToolsClientHost* GetDevToolsClientHostFor(DevToolsAgentHost* agent_host);
- void UnregisterDevToolsClientHostFor(DevToolsAgentHost* agent_host);
-
private:
// DevToolsClientHost::CloseListener override.
// This method will remove all references from the manager to the
@@ -93,19 +86,23 @@
// DevToolsClientHost.
virtual void ClientHostClosing(DevToolsClientHost* host);
- // DevToolsAgentHost::CloseListener implementation.
- virtual void AgentHostClosing(DevToolsAgentHost* host);
+ // Overridden from NotificationObserver:
+ virtual void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
- // Returns DevToolsAgentHost inspected by the DevToolsClientHost.
- DevToolsAgentHost* GetAgentHost(DevToolsClientHost* client_host);
+ // Returns RenderViewHost for the tab that is inspected by devtools
+ // client hosted by DevToolsClientHost.
+ RenderViewHost* GetInspectedRenderViewHost(DevToolsClientHost* client_host);
- void SendAttachToAgent(DevToolsAgentHost*);
- void SendDetachToAgent(DevToolsAgentHost*);
+ void SendAttachToAgent(RenderViewHost* inspected_rvh);
+ void SendDetachToAgent(RenderViewHost* inspected_rvh);
- void BindClientHost(DevToolsAgentHost* agent_host,
+ void BindClientHost(RenderViewHost* inspected_rvh,
DevToolsClientHost* client_host,
const DevToolsRuntimeProperties& runtime_properties);
- void UnbindClientHost(DevToolsAgentHost* agent_host,
+
+ void UnbindClientHost(RenderViewHost* inspected_rvh,
DevToolsClientHost* client_host);
// These two maps are for tracking dependencies between inspected tabs and
@@ -114,15 +111,15 @@
//
// DevToolsManager start listening to DevToolsClientHosts when they are put
// into these maps and removes them when they are closing.
- typedef std::map<DevToolsAgentHost*, DevToolsClientHost*>
- AgentToClientHostMap;
- AgentToClientHostMap agent_to_client_host_;
+ typedef std::map<RenderViewHost*, DevToolsClientHost*>
+ InspectedRvhToClientHostMap;
+ InspectedRvhToClientHostMap inspected_rvh_to_client_host_;
- typedef std::map<DevToolsClientHost*, DevToolsAgentHost*>
+ typedef std::map<DevToolsClientHost*, RenderViewHost*>
ClientHostToInspectedRvhMap;
- ClientHostToInspectedRvhMap client_to_agent_host_;
+ ClientHostToInspectedRvhMap client_host_to_inspected_rvh_;
- typedef std::map<DevToolsAgentHost*, DevToolsRuntimeProperties>
+ typedef std::map<RenderViewHost*, DevToolsRuntimeProperties>
RuntimePropertiesMap;
RuntimePropertiesMap runtime_properties_map_;
@@ -132,6 +129,8 @@
OrphanClientHosts orphan_client_hosts_;
int last_orphan_cookie_;
+ NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(DevToolsManager);
};
« no previous file with comments | « content/browser/debugger/devtools_agent_host.cc ('k') | content/browser/debugger/devtools_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698