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

Unified Diff: content/browser/renderer_host/p2p_socket_host.h

Issue 6598053: P2P Sockets host implementation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: - Created 9 years, 10 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
« no previous file with comments | « chrome/common/render_messages.h ('k') | content/browser/renderer_host/p2p_socket_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/p2p_socket_host.h
diff --git a/content/browser/renderer_host/p2p_socket_host.h b/content/browser/renderer_host/p2p_socket_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..8692888292d5483fb5e79a5ddb8eb19230874788
--- /dev/null
+++ b/content/browser/renderer_host/p2p_socket_host.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2011 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.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
+#define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
+
+#include "content/common/p2p_sockets.h"
+
+class P2PSocketsHost;
+
+// Base class for P2P sockets used by P2PSocketsHost.
+class P2PSocketHost {
+ public:
+ // Creates P2PSocketHost for the current platform. Must be
+ // implemented in a platform-specific file.
+ static P2PSocketHost* Create(P2PSocketsHost* host, int routing_id, int id,
+ P2PSocketType type);
+
+ virtual ~P2PSocketHost();
+
+ // Initalizes the socket. Returns false when initiazations fails.
+ virtual bool Init() = 0;
+
+ // Sends |data| on the socket to |socket_address|.
+ virtual void Send(P2PSocketAddress socket_address,
+ const std::vector<char>& data) = 0;
+
+ protected:
+ P2PSocketHost(P2PSocketsHost* host, int routing_id, int id);
+
+ P2PSocketsHost* host_;
+ int routing_id_;
+ int id_;
+
+ DISALLOW_COPY_AND_ASSIGN(P2PSocketHost);
+};
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
« no previous file with comments | « chrome/common/render_messages.h ('k') | content/browser/renderer_host/p2p_socket_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698