| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 27 matching lines...) Expand all Loading... |
| 38 int input_pos() const { return input_pos_; } | 38 int input_pos() const { return input_pos_; } |
| 39 bool read_pending() const { return read_pending_; } | 39 bool read_pending() const { return read_pending_; } |
| 40 | 40 |
| 41 // net::Socket implementation. | 41 // net::Socket implementation. |
| 42 virtual int Read(net::IOBuffer* buf, int buf_len, | 42 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 43 net::OldCompletionCallback* callback) OVERRIDE; | 43 net::OldCompletionCallback* callback) OVERRIDE; |
| 44 virtual int Read(net::IOBuffer* buf, int buf_len, | 44 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 45 const net::CompletionCallback& callback) OVERRIDE; | 45 const net::CompletionCallback& callback) OVERRIDE; |
| 46 virtual int Write(net::IOBuffer* buf, int buf_len, | 46 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 47 net::OldCompletionCallback* callback) OVERRIDE; | 47 net::OldCompletionCallback* callback) OVERRIDE; |
| 48 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 49 const net::CompletionCallback& callback) OVERRIDE; |
| 48 | 50 |
| 49 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 51 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 50 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 52 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 51 | 53 |
| 52 // net::StreamSocket implementation. | 54 // net::StreamSocket implementation. |
| 53 virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE; | 55 virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE; |
| 54 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; | 56 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; |
| 55 virtual void Disconnect() OVERRIDE; | 57 virtual void Disconnect() OVERRIDE; |
| 56 virtual bool IsConnected() const OVERRIDE; | 58 virtual bool IsConnected() const OVERRIDE; |
| 57 virtual bool IsConnectedAndIdle() const OVERRIDE; | 59 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void AppendInputPacket(const char* data, int data_size); | 100 void AppendInputPacket(const char* data, int data_size); |
| 99 int input_pos() const { return input_pos_; } | 101 int input_pos() const { return input_pos_; } |
| 100 | 102 |
| 101 // net::Socket implementation. | 103 // net::Socket implementation. |
| 102 virtual int Read(net::IOBuffer* buf, int buf_len, | 104 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 103 net::OldCompletionCallback* callback) OVERRIDE; | 105 net::OldCompletionCallback* callback) OVERRIDE; |
| 104 virtual int Read(net::IOBuffer* buf, int buf_len, | 106 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 105 const net::CompletionCallback& callback) OVERRIDE; | 107 const net::CompletionCallback& callback) OVERRIDE; |
| 106 virtual int Write(net::IOBuffer* buf, int buf_len, | 108 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 107 net::OldCompletionCallback* callback) OVERRIDE; | 109 net::OldCompletionCallback* callback) OVERRIDE; |
| 110 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 111 const net::CompletionCallback& callback) OVERRIDE; |
| 108 | 112 |
| 109 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 113 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 110 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 114 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 111 | 115 |
| 112 private: | 116 private: |
| 113 bool read_pending_; | 117 bool read_pending_; |
| 114 scoped_refptr<net::IOBuffer> read_buffer_; | 118 scoped_refptr<net::IOBuffer> read_buffer_; |
| 115 int read_buffer_size_; | 119 int read_buffer_size_; |
| 116 net::OldCompletionCallback* old_read_callback_; | 120 net::OldCompletionCallback* old_read_callback_; |
| 117 net::CompletionCallback read_callback_; | 121 net::CompletionCallback read_callback_; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 Session::Error error_; | 184 Session::Error error_; |
| 181 bool closed_; | 185 bool closed_; |
| 182 | 186 |
| 183 DISALLOW_COPY_AND_ASSIGN(FakeSession); | 187 DISALLOW_COPY_AND_ASSIGN(FakeSession); |
| 184 }; | 188 }; |
| 185 | 189 |
| 186 } // namespace protocol | 190 } // namespace protocol |
| 187 } // namespace remoting | 191 } // namespace remoting |
| 188 | 192 |
| 189 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ | 193 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ |
| OLD | NEW |