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

Unified Diff: content/browser/devtools/devtools_remote_agent_connector_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_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

Powered by Google App Engine
This is Rietveld 408576698