From 5f49336067c0871355aaa72af45771fa8d8e4cca Mon Sep 17 00:00:00 2001 From: "jschuh@chromium.org" Date: Sat, 5 Apr 2014 13:11:54 +0000 Subject: Revert 261966 "make SetReceiveBufferSize and SetSendBufferSize r..." Appears to have broken the following gcm_unit_tests on Mac: DeviceCredentials AckOnLogin AckWhenLimitReachedWithHeartbeat ExpiredTTLOnRestart InitializeExisting SendMessageRMQAckOnReconnect SendMessageRMQOnRestart SendMessageRMQPartialAckOnReconnect SendMessageRMQWithStreamAck http://build.chromium.org/p/chromium.mac/builders/Mac%2010.6%20Tests%20%28dbg%29%284%29/builds/39860 > make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) > > TBR=sergeyu,yzshen > R=wtc > BUG=355222 > > Review URL: https://codereview.chromium.org/217573002 TBR=jar@chromium.org Review URL: https://codereview.chromium.org/227083002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262002 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/jingle_glue/chromium_socket_factory.cc | 8 ++++---- remoting/protocol/channel_multiplexer.cc | 16 ++++++++-------- remoting/protocol/fake_session.cc | 20 +++++++++----------- remoting/protocol/fake_session.h | 8 ++++---- 4 files changed, 25 insertions(+), 27 deletions(-) (limited to 'remoting') diff --git a/remoting/jingle_glue/chromium_socket_factory.cc b/remoting/jingle_glue/chromium_socket_factory.cc index c88833f..24cda6e 100644 --- a/remoting/jingle_glue/chromium_socket_factory.cc +++ b/remoting/jingle_glue/chromium_socket_factory.cc @@ -225,13 +225,13 @@ int UdpPacketSocket::SetOption(talk_base::Socket::Option option, int value) { return -1; case talk_base::Socket::OPT_RCVBUF: { - int net_error = socket_->SetReceiveBufferSize(value); - return (net_error == net::OK) ? 0 : -1; + bool success = socket_->SetReceiveBufferSize(value); + return success ? 0 : -1; } case talk_base::Socket::OPT_SNDBUF: { - int net_error = socket_->SetSendBufferSize(value); - return (net_error == net::OK) ? 0 : -1; + bool success = socket_->SetSendBufferSize(value); + return success ? 0 : -1; } case talk_base::Socket::OPT_NODELAY: diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc index 3f7466c..2988f22 100644 --- a/remoting/protocol/channel_multiplexer.cc +++ b/remoting/protocol/channel_multiplexer.cc @@ -116,25 +116,25 @@ class ChannelMultiplexer::MuxSocket : public net::StreamSocket, virtual int Write(net::IOBuffer* buffer, int buffer_len, const net::CompletionCallback& callback) OVERRIDE; - virtual int SetReceiveBufferSize(int32 size) OVERRIDE { + virtual bool SetReceiveBufferSize(int32 size) OVERRIDE { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return false; } - virtual int SetSendBufferSize(int32 size) OVERRIDE { + virtual bool SetSendBufferSize(int32 size) OVERRIDE { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return false; } virtual int Connect(const net::CompletionCallback& callback) OVERRIDE { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return net::ERR_FAILED; } virtual void Disconnect() OVERRIDE { NOTIMPLEMENTED(); } virtual bool IsConnected() const OVERRIDE { NOTIMPLEMENTED(); - return false; + return true; } virtual bool IsConnectedAndIdle() const OVERRIDE { NOTIMPLEMENTED(); @@ -142,11 +142,11 @@ class ChannelMultiplexer::MuxSocket : public net::StreamSocket, } virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return net::ERR_FAILED; } virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return net::ERR_FAILED; } virtual const net::BoundNetLog& NetLog() const OVERRIDE { NOTIMPLEMENTED(); diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc index 213ae0b..1ce0675 100644 --- a/remoting/protocol/fake_session.cc +++ b/remoting/protocol/fake_session.cc @@ -136,14 +136,13 @@ void FakeSocket::DoWrite(net::IOBuffer* buf, int buf_len) { } } -int FakeSocket::SetReceiveBufferSize(int32 size) { +bool FakeSocket::SetReceiveBufferSize(int32 size) { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return false; } - -int FakeSocket::SetSendBufferSize(int32 size) { +bool FakeSocket::SetSendBufferSize(int32 size) { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return false; } int FakeSocket::Connect(const net::CompletionCallback& callback) { @@ -173,7 +172,7 @@ int FakeSocket::GetPeerAddress(net::IPEndPoint* address) const { int FakeSocket::GetLocalAddress(net::IPEndPoint* address) const { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return net::ERR_FAILED; } const net::BoundNetLog& FakeSocket::NetLog() const { @@ -264,14 +263,13 @@ int FakeUdpSocket::Write(net::IOBuffer* buf, int buf_len, return buf_len; } -int FakeUdpSocket::SetReceiveBufferSize(int32 size) { +bool FakeUdpSocket::SetReceiveBufferSize(int32 size) { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return false; } - -int FakeUdpSocket::SetSendBufferSize(int32 size) { +bool FakeUdpSocket::SetSendBufferSize(int32 size) { NOTIMPLEMENTED(); - return net::ERR_NOT_IMPLEMENTED; + return false; } FakeSession::FakeSession() diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h index 01f79c7..471b336 100644 --- a/remoting/protocol/fake_session.h +++ b/remoting/protocol/fake_session.h @@ -58,8 +58,8 @@ class FakeSocket : public net::StreamSocket { virtual int Write(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE; - virtual int SetReceiveBufferSize(int32 size) OVERRIDE; - virtual int SetSendBufferSize(int32 size) OVERRIDE; + virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; + virtual bool SetSendBufferSize(int32 size) OVERRIDE; // net::StreamSocket interface. virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; @@ -127,8 +127,8 @@ class FakeUdpSocket : public net::Socket { virtual int Write(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE; - virtual int SetReceiveBufferSize(int32 size) OVERRIDE; - virtual int SetSendBufferSize(int32 size) OVERRIDE; + virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; + virtual bool SetSendBufferSize(int32 size) OVERRIDE; private: bool read_pending_; -- cgit v1.1