Index: chrome/browser/devtools/devtools_ui_bindings.cc |
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc |
index 26a1e03e271da42340547671c37a4aa8682d29d1..cccc6e6f9b13b28ce221f2504eca062d3af08c16 100644 |
--- a/chrome/browser/devtools/devtools_ui_bindings.cc |
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc |
@@ -422,7 +422,7 @@ DevToolsUIBindings::~DevToolsUIBindings() { |
delete pair.first; |
if (agent_host_.get()) |
- agent_host_->DetachClient(); |
+ agent_host_->DetachClient(this); |
for (IndexingJobsMap::const_iterator jobs_it(indexing_jobs_.begin()); |
jobs_it != indexing_jobs_.end(); ++jobs_it) { |
@@ -1032,7 +1032,9 @@ void DevToolsUIBindings::AttachTo( |
if (agent_host_.get()) |
Detach(); |
agent_host_ = agent_host; |
- agent_host_->AttachClient(this); |
+ // DevToolsUIBindings terminates existing debugging connections and starts |
+ // debugging. |
+ agent_host_->ForceAttachClient(this); |
} |
void DevToolsUIBindings::Reattach() { |
@@ -1042,7 +1044,7 @@ void DevToolsUIBindings::Reattach() { |
void DevToolsUIBindings::Detach() { |
if (agent_host_.get()) |
- agent_host_->DetachClient(); |
+ agent_host_->DetachClient(this); |
agent_host_ = NULL; |
} |
@@ -1077,7 +1079,7 @@ void DevToolsUIBindings::DocumentAvailableInMainFrame() { |
if (!reattaching_) |
return; |
reattaching_ = false; |
- agent_host_->DetachClient(); |
+ agent_host_->DetachClient(this); |
agent_host_->AttachClient(this); |
} |