Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: content/browser/devtools/devtools_external_agent_proxy_impl.cc

Issue 12950002: Introduce DevToolsExternalAgentProxy interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/devtools_external_agent_proxy_impl.cc
diff --git a/content/browser/devtools/devtools_external_agent_proxy_impl.cc b/content/browser/devtools/devtools_external_agent_proxy_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0d77b53a33b79bc941d5f4ef555ee1f22a8b17d0
--- /dev/null
+++ b/content/browser/devtools/devtools_external_agent_proxy_impl.cc
@@ -0,0 +1,66 @@
+// 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_external_agent_proxy_impl.h"
+
+#include "content/browser/devtools/devtools_agent_host_impl.h"
+#include "content/public/browser/devtools_external_agent_proxy_delegate.h"
+
+namespace content {
+
+class DevToolsExternalAgentProxyImpl::ForwardingAgentHost
+ : public DevToolsAgentHostImpl {
+ public:
+ ForwardingAgentHost(DevToolsExternalAgentProxyDelegate* delegate)
+ : delegate_(delegate) {
+ }
+
+ void ConnectionClosed() {
+ NotifyCloseListener();
+ }
+
+ private:
+ ~ForwardingAgentHost() {
+ }
+
+ // DevToolsAgentHostImpl implementation.
+ virtual void Attach() OVERRIDE {
+ delegate_->Attach();
+ };
+
+ virtual void Detach() OVERRIDE {
+ delegate_->Detach();
+ };
+
+ virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE {
+ delegate_->SendMessageToBackend(message);
+ }
+
+ DevToolsExternalAgentProxyDelegate* delegate_;
+};
+
+//static
+DevToolsExternalAgentProxy* DevToolsExternalAgentProxy::Create(
+ DevToolsExternalAgentProxyDelegate* delegate) {
+ return new DevToolsExternalAgentProxyImpl(delegate);
+}
+
+DevToolsExternalAgentProxyImpl::DevToolsExternalAgentProxyImpl(
+ DevToolsExternalAgentProxyDelegate* delegate)
+ : agent_host_(new ForwardingAgentHost(delegate)) {
+}
+
+DevToolsExternalAgentProxyImpl::~DevToolsExternalAgentProxyImpl() {
+}
+
+scoped_refptr<DevToolsAgentHost> DevToolsExternalAgentProxyImpl::
+ GetAgentHost() {
+ return agent_host_;
+}
+
+void DevToolsExternalAgentProxyImpl::ConnectionClosed() {
+ agent_host_->ConnectionClosed();
+}
+
+} // content
« no previous file with comments | « content/browser/devtools/devtools_external_agent_proxy_impl.h ('k') | content/browser/devtools/devtools_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698