OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_ | 5 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_ |
6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_ | 6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void PairWith(FakeSocket* peer_socket); | 51 void PairWith(FakeSocket* peer_socket); |
52 int input_pos() const { return input_pos_; } | 52 int input_pos() const { return input_pos_; } |
53 bool read_pending() const { return read_pending_; } | 53 bool read_pending() const { return read_pending_; } |
54 | 54 |
55 // net::Socket implementation. | 55 // net::Socket implementation. |
56 virtual int Read(net::IOBuffer* buf, int buf_len, | 56 virtual int Read(net::IOBuffer* buf, int buf_len, |
57 const net::CompletionCallback& callback) OVERRIDE; | 57 const net::CompletionCallback& callback) OVERRIDE; |
58 virtual int Write(net::IOBuffer* buf, int buf_len, | 58 virtual int Write(net::IOBuffer* buf, int buf_len, |
59 const net::CompletionCallback& callback) OVERRIDE; | 59 const net::CompletionCallback& callback) OVERRIDE; |
60 | 60 |
61 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 61 virtual int SetReceiveBufferSize(int32 size) OVERRIDE; |
62 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 62 virtual int SetSendBufferSize(int32 size) OVERRIDE; |
63 | 63 |
64 // net::StreamSocket interface. | 64 // net::StreamSocket interface. |
65 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; | 65 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; |
66 virtual void Disconnect() OVERRIDE; | 66 virtual void Disconnect() OVERRIDE; |
67 virtual bool IsConnected() const OVERRIDE; | 67 virtual bool IsConnected() const OVERRIDE; |
68 virtual bool IsConnectedAndIdle() const OVERRIDE; | 68 virtual bool IsConnectedAndIdle() const OVERRIDE; |
69 virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; | 69 virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; |
70 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; | 70 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; |
71 virtual const net::BoundNetLog& NetLog() const OVERRIDE; | 71 virtual const net::BoundNetLog& NetLog() const OVERRIDE; |
72 virtual void SetSubresourceSpeculation() OVERRIDE; | 72 virtual void SetSubresourceSpeculation() OVERRIDE; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 void AppendInputPacket(const char* data, int data_size); | 121 void AppendInputPacket(const char* data, int data_size); |
122 int input_pos() const { return input_pos_; } | 122 int input_pos() const { return input_pos_; } |
123 | 123 |
124 // net::Socket implementation. | 124 // net::Socket implementation. |
125 virtual int Read(net::IOBuffer* buf, int buf_len, | 125 virtual int Read(net::IOBuffer* buf, int buf_len, |
126 const net::CompletionCallback& callback) OVERRIDE; | 126 const net::CompletionCallback& callback) OVERRIDE; |
127 virtual int Write(net::IOBuffer* buf, int buf_len, | 127 virtual int Write(net::IOBuffer* buf, int buf_len, |
128 const net::CompletionCallback& callback) OVERRIDE; | 128 const net::CompletionCallback& callback) OVERRIDE; |
129 | 129 |
130 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 130 virtual int SetReceiveBufferSize(int32 size) OVERRIDE; |
131 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 131 virtual int SetSendBufferSize(int32 size) OVERRIDE; |
132 | 132 |
133 private: | 133 private: |
134 bool read_pending_; | 134 bool read_pending_; |
135 scoped_refptr<net::IOBuffer> read_buffer_; | 135 scoped_refptr<net::IOBuffer> read_buffer_; |
136 int read_buffer_size_; | 136 int read_buffer_size_; |
137 net::CompletionCallback read_callback_; | 137 net::CompletionCallback read_callback_; |
138 | 138 |
139 std::vector<std::string> written_packets_; | 139 std::vector<std::string> written_packets_; |
140 std::vector<std::string> input_packets_; | 140 std::vector<std::string> input_packets_; |
141 int input_pos_; | 141 int input_pos_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 base::WeakPtrFactory<FakeSession> weak_factory_; | 212 base::WeakPtrFactory<FakeSession> weak_factory_; |
213 | 213 |
214 DISALLOW_COPY_AND_ASSIGN(FakeSession); | 214 DISALLOW_COPY_AND_ASSIGN(FakeSession); |
215 }; | 215 }; |
216 | 216 |
217 } // namespace protocol | 217 } // namespace protocol |
218 } // namespace remoting | 218 } // namespace remoting |
219 | 219 |
220 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ | 220 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ |
OLD | NEW |