Commit 0d3f0b88 authored by dgozman's avatar dgozman Committed by Commit bot

[DevTools] Preserve DevTools window when remote connection is lost.

BUG=456547

Review URL: https://codereview.chromium.org/906223003

Cr-Commit-Position: refs/heads/master@{#315292}
parent 0ed000a7
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#include "content/browser/devtools/forwarding_agent_host.h" #include "content/browser/devtools/forwarding_agent_host.h"
#include "base/bind.h"
#include "content/browser/devtools/protocol/inspector_handler.h"
namespace content { namespace content {
ForwardingAgentHost::ForwardingAgentHost( ForwardingAgentHost::ForwardingAgentHost(
...@@ -19,19 +22,27 @@ void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) { ...@@ -19,19 +22,27 @@ void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) {
} }
void ForwardingAgentHost::ConnectionClosed() { void ForwardingAgentHost::ConnectionClosed() {
HostClosed(); devtools::inspector::Client inspector(
base::Bind(&ForwardingAgentHost::DispatchOnClientHost,
base::Unretained(this)));
inspector.Detached(devtools::inspector::DetachedParams::Create()
->set_reason("Connection lost."));
delegate_.reset();
} }
void ForwardingAgentHost::Attach() { void ForwardingAgentHost::Attach() {
if (delegate_)
delegate_->Attach(this); delegate_->Attach(this);
} }
void ForwardingAgentHost::Detach() { void ForwardingAgentHost::Detach() {
if (delegate_)
delegate_->Detach(); delegate_->Detach();
} }
void ForwardingAgentHost::DispatchProtocolMessage( void ForwardingAgentHost::DispatchProtocolMessage(
const std::string& message) { const std::string& message) {
if (delegate_)
delegate_->SendMessageToBackend(message); delegate_->SendMessageToBackend(message);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment