diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-22 02:34:56 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-22 02:34:56 +0000 |
commit | 6852d7d96f3643277e8dab49e3bfa0e482aafffe (patch) | |
tree | 65b97cf15fb3cb6a60b914abac6310c9ff22e710 /remoting/protocol/fake_session.h | |
parent | a4f4692c776153b2b61c0a63d8b9c80e56613881 (diff) | |
download | chromium_src-6852d7d96f3643277e8dab49e3bfa0e482aafffe.zip chromium_src-6852d7d96f3643277e8dab49e3bfa0e482aafffe.tar.gz chromium_src-6852d7d96f3643277e8dab49e3bfa0e482aafffe.tar.bz2 |
Changed MessageReader so that it doesn't read from the socket if there are
other messages being processed. Added unittests for MessageReader.
BUG=None
TEST=Unittests
Review URL: http://codereview.chromium.org/6271004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/fake_session.h')
-rw-r--r-- | remoting/protocol/fake_session.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h index 62818e4..3ffe20b 100644 --- a/remoting/protocol/fake_session.h +++ b/remoting/protocol/fake_session.h @@ -27,10 +27,11 @@ class FakeSocket : public net::Socket { FakeSocket(); virtual ~FakeSocket(); - const std::string& written_data() { return written_data_; } + const std::string& written_data() const { return written_data_; } - void AppendInputData(char* data, int data_size); - int input_pos() { return input_pos_; } + void AppendInputData(const char* data, int data_size); + int input_pos() const { return input_pos_; } + bool read_pending() const { return read_pending_; } // net::Socket interface. virtual int Read(net::IOBuffer* buf, int buf_len, @@ -60,12 +61,12 @@ class FakeUdpSocket : public net::Socket { FakeUdpSocket(); virtual ~FakeUdpSocket(); - const std::vector<std::string>& written_packets() { + const std::vector<std::string>& written_packets() const { return written_packets_; } - void AppendInputPacket(char* data, int data_size); - int input_pos() { return input_pos_; } + void AppendInputPacket(const char* data, int data_size); + int input_pos() const { return input_pos_; } // net::Socket interface. virtual int Read(net::IOBuffer* buf, int buf_len, @@ -100,7 +101,7 @@ class FakeSession : public Session { message_loop_ = message_loop; } - bool is_closed() { return closed_; } + bool is_closed() const { return closed_; } virtual void SetStateChangeCallback(StateChangeCallback* callback); |