summaryrefslogtreecommitdiffstats
path: root/chrome/browser/debugger/inspectable_tab_proxy.cc
diff options
context:
space:
mode:
authorapavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 15:13:07 +0000
committerapavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 15:13:07 +0000
commit0e60f294d4d94a105588cb08ee7351f5bb5efef0 (patch)
treebc6036978b14c4b1f99fda34a7b40f13b9cd8dcf /chrome/browser/debugger/inspectable_tab_proxy.cc
parent9b9ae54a21648b1f1849740747ae3618bab381cf (diff)
downloadchromium_src-0e60f294d4d94a105588cb08ee7351f5bb5efef0.zip
chromium_src-0e60f294d4d94a105588cb08ee7351f5bb5efef0.tar.gz
chromium_src-0e60f294d4d94a105588cb08ee7351f5bb5efef0.tar.bz2
Review URL: http://codereview.chromium.org/87034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14187 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger/inspectable_tab_proxy.cc')
-rw-r--r--chrome/browser/debugger/inspectable_tab_proxy.cc39
1 files changed, 12 insertions, 27 deletions
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.cc b/chrome/browser/debugger/inspectable_tab_proxy.cc
index c216766..48e0155 100644
--- a/chrome/browser/debugger/inspectable_tab_proxy.cc
+++ b/chrome/browser/debugger/inspectable_tab_proxy.cc
@@ -16,29 +16,6 @@
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/common/devtools_messages.h"
-namespace {
-
-// An internal implementation of DevToolsClientHost that delegates
-// messages sent for DevToolsClient to a DebuggerShell instance.
-class DevToolsClientHostImpl : public DevToolsClientHost {
- public:
- DevToolsClientHostImpl(int32 id, DebuggerRemoteService* service)
- : id_(id),
- service_(service) {}
-
- // DevToolsClientHost interface
- virtual void InspectedTabClosing();
- virtual void SendMessageToClient(const IPC::Message& msg);
-
- private:
- // Message handling routines
- void OnRpcMessage(const std::string& msg);
- void DebuggerOutput(const std::string& msg);
-
- int32 id_;
- DebuggerRemoteService* service_;
-};
-
void DevToolsClientHostImpl::InspectedTabClosing() {
NotifyCloseListener();
delete this;
@@ -76,8 +53,6 @@ void DevToolsClientHostImpl::DebuggerOutput(const std::string& msg) {
service_->DebuggerOutput(id_, msg);
}
-} // namespace
-
const InspectableTabProxy::ControllersMap&
InspectableTabProxy::controllers_map() {
controllers_map_.clear();
@@ -93,9 +68,19 @@ const InspectableTabProxy::ControllersMap&
return controllers_map_;
}
-// static
DevToolsClientHost* InspectableTabProxy::NewClientHost(
int32 id,
DebuggerRemoteService* service) {
- return new DevToolsClientHostImpl(id, service);
+ DevToolsClientHostImpl* client_host =
+ new DevToolsClientHostImpl(id, service, &id_to_client_host_map_);
+ id_to_client_host_map_[id] = client_host;
+ return client_host;
+}
+
+void InspectableTabProxy::OnRemoteDebuggerDetached() {
+ while (id_to_client_host_map_.size() > 0) {
+ IdToClientHostMap::iterator it = id_to_client_host_map_.begin();
+ it->second->debugger_remote_service()->DetachTab(IntToString(it->first),
+ NULL);
+ }
}