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

Unified Diff: remoting/protocol/channel_socket_adapter.h

Issue 1197853003: Add P2PDatagramSocket and P2PStreamSocket interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « remoting/protocol/channel_multiplexer_unittest.cc ('k') | remoting/protocol/channel_socket_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_socket_adapter.h
diff --git a/remoting/protocol/channel_socket_adapter.h b/remoting/protocol/channel_socket_adapter.h
index b05fb236fbaece3abccfd367c0a33ecde64a914e..28e2493755d27013c67f7e8738f4670b6b334f37 100644
--- a/remoting/protocol/channel_socket_adapter.h
+++ b/remoting/protocol/channel_socket_adapter.h
@@ -8,7 +8,7 @@
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/threading/thread_checker.h"
-#include "net/socket/socket.h"
+#include "remoting/protocol/p2p_datagram_socket.h"
#include "third_party/webrtc/base/asyncpacketsocket.h"
#include "third_party/webrtc/base/sigslot.h"
#include "third_party/webrtc/base/socketaddress.h"
@@ -20,10 +20,10 @@ class TransportChannel;
namespace remoting {
namespace protocol {
-// TransportChannelSocketAdapter implements net::Socket interface on
+// TransportChannelSocketAdapter implements P2PDatagramSocket interface on
// top of libjingle's TransportChannel. It is used by LibjingleTransportFactory
-// to provide net::Socket interface for channels.
-class TransportChannelSocketAdapter : public net::Socket,
+// to provide P2PDatagramSocket interface for channels.
+class TransportChannelSocketAdapter : public P2PDatagramSocket,
public sigslot::has_slots<> {
public:
// Doesn't take ownership of the |channel|. The |channel| must outlive
@@ -37,20 +37,15 @@ class TransportChannelSocketAdapter : public net::Socket,
void SetOnDestroyedCallback(const base::Closure& callback);
// Closes the stream. |error_code| specifies error code that will
- // be returned by Read() and Write() after the stream is closed.
+ // be returned by Recv() and Send() after the stream is closed.
// Must be called before the session and the channel are destroyed.
void Close(int error_code);
- // net::Socket interface.
- int Read(net::IOBuffer* buf,
- int buf_len,
+ // P2PDatagramSocket interface.
+ int Recv(const scoped_refptr<net::IOBuffer>& buf, int buf_len,
+ const net::CompletionCallback& callback) override;
+ int Send(const scoped_refptr<net::IOBuffer>& buf, int buf_len,
const net::CompletionCallback& callback) override;
- int Write(net::IOBuffer* buf,
- int buf_len,
- const net::CompletionCallback& callback) override;
-
- int SetReceiveBufferSize(int32 size) override;
- int SetSendBufferSize(int32 size) override;
private:
void OnNewPacket(cricket::TransportChannel* channel,
« no previous file with comments | « remoting/protocol/channel_multiplexer_unittest.cc ('k') | remoting/protocol/channel_socket_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698