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

Unified Diff: remoting/protocol/pseudotcp_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, 6 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: remoting/protocol/pseudotcp_adapter.h
diff --git a/remoting/protocol/pseudotcp_adapter.h b/remoting/protocol/pseudotcp_adapter.h
index 0399258448551abca8341150fa1c1ceebfbf1a7a..48ae056fe0cdf566b46027eec4b292134a1a901b 100644
--- a/remoting/protocol/pseudotcp_adapter.h
+++ b/remoting/protocol/pseudotcp_adapter.h
@@ -11,23 +11,23 @@
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "net/log/net_log.h"
-#include "net/socket/stream_socket.h"
+#include "remoting/protocol/p2p_socket.h"
#include "third_party/webrtc/p2p/base/pseudotcp.h"
namespace remoting {
namespace protocol {
-// PseudoTcpAdapter adapts a connectionless net::Socket to a connection-
-// oriented net::StreamSocket using PseudoTcp. Because net::StreamSockets
-// can be deleted during callbacks, while PseudoTcp cannot, the core of the
-// PseudoTcpAdapter is reference counted, with a reference held by the
-// adapter, and an additional reference held on the stack during callbacks.
-class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe {
+// PseudoTcpAdapter adapts a P2PDatagramSocket to P2PStreamSocket using
+// PseudoTcp. Because net::StreamSockets can be deleted during callbacks,
Wez 2015/06/22 15:49:07 nit: Because P2PStreamSockets...
Sergey Ulanov 2015/07/10 00:49:54 Done.
+// while PseudoTcp cannot, the core of the PseudoTcpAdapter is reference
+// counted, with a reference held by the adapter, and an additional reference
+// held on the stack during callbacks.
+class PseudoTcpAdapter : public P2PStreamSocket, base::NonThreadSafe {
public:
- explicit PseudoTcpAdapter(scoped_ptr<net::Socket> socket);
+ explicit PseudoTcpAdapter(scoped_ptr<P2PDatagramSocket> socket);
~PseudoTcpAdapter() override;
- // net::Socket implementation.
+ // P2PStreamSocket implementation.
int Read(net::IOBuffer* buffer,
int buffer_size,
const net::CompletionCallback& callback) override;
@@ -37,25 +37,7 @@ class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe {
int SetReceiveBufferSize(int32 size) override;
int SetSendBufferSize(int32 size) override;
- // net::StreamSocket implementation.
- int Connect(const net::CompletionCallback& callback) override;
- void Disconnect() override;
- bool IsConnected() const override;
- bool IsConnectedAndIdle() const override;
- int GetPeerAddress(net::IPEndPoint* address) const override;
- int GetLocalAddress(net::IPEndPoint* address) const override;
- const net::BoundNetLog& NetLog() const override;
- void SetSubresourceSpeculation() override;
- void SetOmniboxSpeculation() override;
- bool WasEverUsed() const override;
- bool UsingTCPFastOpen() const override;
- bool WasNpnNegotiated() const override;
- net::NextProto GetNegotiatedProtocol() const override;
- bool GetSSLInfo(net::SSLInfo* ssl_info) override;
- void GetConnectionAttempts(net::ConnectionAttempts* out) const override;
- void ClearConnectionAttempts() override {}
- void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override {
- }
+ int Connect(const net::CompletionCallback& callback);
// Set the delay for sending ACK.
void SetAckDelay(int delay_ms);

Powered by Google App Engine
This is Rietveld 408576698