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 @@
#include "content/browser/devtools/forwarding_agent_host.h"
#include "base/bind.h"
#include "content/browser/devtools/protocol/inspector_handler.h"
namespace content {
ForwardingAgentHost::ForwardingAgentHost(
......@@ -19,20 +22,28 @@ void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) {
}
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() {
delegate_->Attach(this);
if (delegate_)
delegate_->Attach(this);
}
void ForwardingAgentHost::Detach() {
delegate_->Detach();
if (delegate_)
delegate_->Detach();
}
void ForwardingAgentHost::DispatchProtocolMessage(
const std::string& message) {
delegate_->SendMessageToBackend(message);
if (delegate_)
delegate_->SendMessageToBackend(message);
}
DevToolsAgentHost::Type ForwardingAgentHost::GetType() {
......
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