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

Unified Diff: remoting/protocol/fake_stream_socket.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/fake_stream_socket.h
diff --git a/remoting/protocol/fake_stream_socket.h b/remoting/protocol/fake_stream_socket.h
index 6bd1cbe940881f7746547bb25f5b6407fa440862..78bd7dfb2b4e6fe9ab48dbf1c05444607d99ad7b 100644
--- a/remoting/protocol/fake_stream_socket.h
+++ b/remoting/protocol/fake_stream_socket.h
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "net/base/completion_callback.h"
-#include "net/socket/stream_socket.h"
+#include "remoting/protocol/p2p_socket.h"
#include "remoting/protocol/stream_channel_factory.h"
namespace base {
@@ -21,7 +21,7 @@ class SingleThreadTaskRunner;
namespace remoting {
namespace protocol {
-// FakeStreamSocket implement net::StreamSocket interface. All data written to
+// FakeStreamSocket implement P2PStreamSocket interface. All data written to
// FakeStreamSocket is stored in a buffer returned by written_data(). Read()
// reads data from another buffer that can be set with AppendInputData().
// Pending reads are supported, so if there is a pending read AppendInputData()
@@ -31,7 +31,7 @@ namespace protocol {
// PairWith() method, e.g.: a->PairWith(b). After this all data
// written to |a| can be read from |b| and vice versa. Two connected
// sockets |a| and |b| must be created and used on the same thread.
-class FakeStreamSocket : public net::StreamSocket {
+class FakeStreamSocket : public P2PStreamSocket {
public:
FakeStreamSocket();
~FakeStreamSocket() override;
@@ -68,7 +68,7 @@ class FakeStreamSocket : public net::StreamSocket {
base::WeakPtr<FakeStreamSocket> GetWeakPtr();
- // net::Socket implementation.
+ // P2PStreamSocket interface.
int Read(net::IOBuffer* buf,
int buf_len,
const net::CompletionCallback& callback) override;
@@ -78,26 +78,6 @@ class FakeStreamSocket : public net::StreamSocket {
int SetReceiveBufferSize(int32 size) override;
int SetSendBufferSize(int32 size) override;
- // net::StreamSocket interface.
- 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 {
- }
-
private:
void DoAsyncWrite(scoped_refptr<net::IOBuffer> buf, int buf_len,
const net::CompletionCallback& callback);
@@ -118,8 +98,6 @@ class FakeStreamSocket : public net::StreamSocket {
std::string input_data_;
int input_pos_;
- net::BoundNetLog net_log_;
-
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
base::WeakPtrFactory<FakeStreamSocket> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698