Add long running gmail memory benchmark for background tab.
[chromium-blink-merge.git] / content / browser / devtools / forwarding_agent_host.cc
blob9f3f204b7762e85baa064b69186b1f075d3c1281
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/devtools/forwarding_agent_host.h"
7 #include "base/bind.h"
8 #include "content/browser/devtools/protocol/inspector_handler.h"
10 namespace content {
12 ForwardingAgentHost::ForwardingAgentHost(
13 DevToolsExternalAgentProxyDelegate* delegate)
14 : delegate_(delegate) {
17 ForwardingAgentHost::~ForwardingAgentHost() {
20 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) {
21 SendMessageToClient(message);
24 void ForwardingAgentHost::ConnectionClosed() {
25 devtools::inspector::Client inspector(
26 base::Bind(&ForwardingAgentHost::DispatchOnClientHost,
27 base::Unretained(this)));
28 inspector.Detached(devtools::inspector::DetachedParams::Create()
29 ->set_reason("Connection lost."));
30 delegate_.reset();
33 void ForwardingAgentHost::Attach() {
34 if (delegate_)
35 delegate_->Attach(this);
38 void ForwardingAgentHost::Detach() {
39 if (delegate_)
40 delegate_->Detach();
43 bool ForwardingAgentHost::DispatchProtocolMessage(
44 const std::string& message) {
45 if (delegate_)
46 delegate_->SendMessageToBackend(message);
47 return true;
50 DevToolsAgentHost::Type ForwardingAgentHost::GetType() {
51 return TYPE_EXTERNAL;
54 std::string ForwardingAgentHost::GetTitle() {
55 return "";
58 GURL ForwardingAgentHost::GetURL() {
59 return GURL();
62 bool ForwardingAgentHost::Activate() {
63 return false;
66 bool ForwardingAgentHost::Close() {
67 return false;
70 } // content