Chromium Code Reviews| Index: content/browser/devtools/devtools_remote_agent_connector_impl.cc |
| diff --git a/content/browser/devtools/devtools_remote_agent_connector_impl.cc b/content/browser/devtools/devtools_remote_agent_connector_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..40c27dfe6516bea109f742be5e115d03b5fd5ed9 |
| --- /dev/null |
| +++ b/content/browser/devtools/devtools_remote_agent_connector_impl.cc |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/browser/devtools/devtools_remote_agent_connector_impl.h" |
| + |
| +#include "content/browser/devtools/devtools_agent_host_impl.h" |
| + |
| +namespace content { |
| + |
| +class ForwardingDevToolsAgentHost: public content::DevToolsAgentHostImpl { |
|
pfeldman
2013/03/21 06:24:32
Space before : missing
Vladislav Kaznacheev
2013/03/21 06:55:53
Done.
|
| + friend class DevToolsRemoteAgentConnectorImpl; |
|
pfeldman
2013/03/21 06:24:32
Why friends?
Vladislav Kaznacheev
2013/03/21 06:55:53
Its constructor is private. But I have a better id
|
| + |
| + ForwardingDevToolsAgentHost( |
| + content::DevToolsRemoteAgentConnector::Delegate* delegate) |
| + : delegate_(delegate) { |
| + } |
| + |
| + // DevToolsAgentHostImpl implementation. |
| + virtual void Attach() OVERRIDE { |
| + delegate_->Attach(); |
| + }; |
| + |
| + virtual void Detach() OVERRIDE { |
| + delegate_->Detach(); |
| + }; |
| + |
| + virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE { |
| + delegate_->Send(message); |
| + } |
| + |
| + void ConnectionClosed() { |
| + NotifyCloseListener(); |
| + } |
| + |
| + content::DevToolsRemoteAgentConnector::Delegate* delegate_; |
| +}; |
| + |
| +//static |
| +DevToolsRemoteAgentConnector* DevToolsRemoteAgentConnector:: |
| + CreateFor(DevToolsRemoteAgentConnector::Delegate* delegate) { |
| + return new DevToolsRemoteAgentConnectorImpl(delegate); |
| +} |
| + |
| +DevToolsRemoteAgentConnectorImpl::DevToolsRemoteAgentConnectorImpl( |
| + Delegate* delegate) |
| + : agent_host_(new ForwardingDevToolsAgentHost(delegate)) { |
| +} |
| + |
| +DevToolsAgentHost* DevToolsRemoteAgentConnectorImpl::GetAgentHost() { |
| + return agent_host_; |
| +} |
| + |
| +void DevToolsRemoteAgentConnectorImpl::ConnectionClosed() { |
| + agent_host_->ConnectionClosed(); |
| +} |
| + |
| +} // content |