Chromium Code Reviews| Index: remoting/protocol/fake_session.h |
| diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h |
| index 7eaab6becf0b8ea93ebdcb621a3691e32bf73c3e..7e77d5ffcc6a4b3ab4297c7b14626f2deb449b8a 100644 |
| --- a/remoting/protocol/fake_session.h |
| +++ b/remoting/protocol/fake_session.h |
| @@ -10,6 +10,7 @@ |
| #include <vector> |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "net/socket/socket.h" |
| #include "net/socket/stream_socket.h" |
| #include "remoting/protocol/session.h" |
| @@ -33,7 +34,8 @@ class FakeSocket : public net::StreamSocket { |
| const std::string& written_data() const { return written_data_; } |
| - void AppendInputData(const char* data, int data_size); |
| + void AppendInputData(const std::vector<char>& data); |
| + void Connect(FakeSocket* peer_socket); |
|
Wez
2011/12/09 23:42:33
Isn't Connect() overloading net::StreamSocket::Con
Sergey Ulanov
2011/12/12 22:52:00
Renamed to SetPeer(), though I disagree that overl
Wez
2011/12/13 00:12:38
True, but the semantics of this Connect() method a
|
| int input_pos() const { return input_pos_; } |
| bool read_pending() const { return read_pending_; } |
| @@ -66,6 +68,7 @@ class FakeSocket : public net::StreamSocket { |
| scoped_refptr<net::IOBuffer> read_buffer_; |
| int read_buffer_size_; |
| net::OldCompletionCallback* read_callback_; |
| + base::WeakPtr<FakeSocket> peer_socket_; |
| std::string written_data_; |
| std::string input_data_; |
| @@ -74,6 +77,7 @@ class FakeSocket : public net::StreamSocket { |
| net::BoundNetLog net_log_; |
| MessageLoop* message_loop_; |
| + base::WeakPtrFactory<FakeSocket> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(FakeSocket); |
| }; |