Commit 27f82f41 authored by jar@chromium.org's avatar jar@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261966 0039d316-1c4b-4281-b951-d872f2087c98
parent 41b64e8a
......@@ -137,14 +137,14 @@ int AndroidUsbSocket::Write(net::IOBuffer* buffer,
return net::ERR_IO_PENDING;
}
bool AndroidUsbSocket::SetReceiveBufferSize(int32 size) {
int AndroidUsbSocket::SetReceiveBufferSize(int32 size) {
NOTIMPLEMENTED();
return false;
return net::ERR_NOT_IMPLEMENTED;
}
bool AndroidUsbSocket::SetSendBufferSize(int32 size) {
int AndroidUsbSocket::SetSendBufferSize(int32 size) {
NOTIMPLEMENTED();
return false;
return net::ERR_NOT_IMPLEMENTED;
}
int AndroidUsbSocket::Connect(const net::CompletionCallback& callback) {
......@@ -180,7 +180,7 @@ int AndroidUsbSocket::GetPeerAddress(net::IPEndPoint* address) const {
int AndroidUsbSocket::GetLocalAddress(net::IPEndPoint* address) const {
NOTIMPLEMENTED();
return net::ERR_FAILED;
return net::ERR_NOT_IMPLEMENTED;
}
const net::BoundNetLog& AndroidUsbSocket::NetLog() const {
......
......@@ -38,8 +38,8 @@ class AndroidUsbSocket : public net::StreamSocket,
const net::CompletionCallback& callback) OVERRIDE;
virtual int Write(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
virtual void Disconnect() OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
......
......@@ -412,9 +412,9 @@ bool P2PSocketHostTcpBase::SetOption(P2PSocketOption option, int value) {
DCHECK_EQ(STATE_OPEN, state_);
switch (option) {
case P2P_SOCKET_OPT_RCVBUF:
return socket_->SetReceiveBufferSize(value);
return socket_->SetReceiveBufferSize(value) == net::OK;
case P2P_SOCKET_OPT_SNDBUF:
return socket_->SetSendBufferSize(value);
return socket_->SetSendBufferSize(value) == net::OK;
case P2P_SOCKET_OPT_DSCP:
return false; // For TCP sockets DSCP setting is not available.
default:
......
......@@ -103,13 +103,14 @@ void FakeSocket::DoAsyncWrite(scoped_refptr<net::IOBuffer> buf, int buf_len,
callback.Run(buf_len);
}
bool FakeSocket::SetReceiveBufferSize(int32 size) {
int FakeSocket::SetReceiveBufferSize(int32 size) {
NOTIMPLEMENTED();
return false;
return net::ERR_NOT_IMPLEMENTED;
}
bool FakeSocket::SetSendBufferSize(int32 size) {
int FakeSocket::SetSendBufferSize(int32 size) {
NOTIMPLEMENTED();
return false;
return net::ERR_NOT_IMPLEMENTED;
}
int FakeSocket::Connect(const net::CompletionCallback& callback) {
......
......@@ -45,8 +45,8 @@ class FakeSocket : public net::StreamSocket {
const net::CompletionCallback& callback) OVERRIDE;
virtual int Write(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
virtual void Disconnect() OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
......
......@@ -95,7 +95,7 @@ bool P2PSocketHostUdp::Init(const net::IPEndPoint& local_address,
}
// Setting recv socket buffer size.
if (!socket_->SetReceiveBufferSize(kRecvSocketBufferSize)) {
if (socket_->SetReceiveBufferSize(kRecvSocketBufferSize) != net::OK) {
LOG(WARNING) << "Failed to set socket receive buffer size to "
<< kRecvSocketBufferSize;
}
......@@ -302,9 +302,9 @@ bool P2PSocketHostUdp::SetOption(P2PSocketOption option, int value) {
DCHECK_EQ(STATE_OPEN, state_);
switch (option) {
case P2P_SOCKET_OPT_RCVBUF:
return socket_->SetReceiveBufferSize(value);
return socket_->SetReceiveBufferSize(value) == net::OK;
case P2P_SOCKET_OPT_SNDBUF:
return socket_->SetSendBufferSize(value);
return socket_->SetSendBufferSize(value) == net::OK;
case P2P_SOCKET_OPT_DSCP:
return (net::OK == socket_->SetDiffServCodePoint(
static_cast<net::DiffServCodePoint>(value))) ? true : false;
......
......@@ -94,12 +94,12 @@ class FakeDatagramServerSocket : public net::DatagramServerSocket {
return buf_len;
}
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE {
return true;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE {
return net::OK;
}
virtual bool SetSendBufferSize(int32 size) OVERRIDE {
return true;
virtual int SetSendBufferSize(int32 size) OVERRIDE {
return net::OK;
}
void ReceivePacket(const net::IPEndPoint& address, std::vector<char> data) {
......
......@@ -254,21 +254,22 @@ void PepperTCPSocket::SetOption(PP_TCPSocket_Option name,
return;
}
bool result = false;
int net_result = net::OK;
if (name == PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE) {
if (integer_value > ppapi::TCPSocketShared::kMaxSendBufferSize) {
SendSetOptionACK(PP_ERROR_BADARGUMENT);
return;
}
result = tcp_socket->SetSendBufferSize(integer_value);
net_result = tcp_socket->SetSendBufferSize(integer_value);
} else {
if (integer_value > ppapi::TCPSocketShared::kMaxReceiveBufferSize) {
SendSetOptionACK(PP_ERROR_BADARGUMENT);
return;
}
result = tcp_socket->SetReceiveBufferSize(integer_value);
net_result = tcp_socket->SetReceiveBufferSize(integer_value);
}
SendSetOptionACK(result ? PP_OK : PP_ERROR_FAILED);
// TODO(wtc): Add error mapping.
SendSetOptionACK((net_result == net::OK) ? PP_OK : PP_ERROR_FAILED);
return;
}
default: {
......
......@@ -455,17 +455,18 @@ int32_t PepperTCPSocketMessageFilter::OnMsgSetOption(
if (!value.GetInt32(&integer_value) || integer_value <= 0)
return PP_ERROR_BADARGUMENT;
bool result = false;
int net_result = net::OK;
if (name == PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE) {
if (integer_value > TCPSocketResourceBase::kMaxSendBufferSize)
return PP_ERROR_BADARGUMENT;
result = socket_->SetSendBufferSize(integer_value);
net_result = socket_->SetSendBufferSize(integer_value);
} else {
if (integer_value > TCPSocketResourceBase::kMaxReceiveBufferSize)
return PP_ERROR_BADARGUMENT;
result = socket_->SetReceiveBufferSize(integer_value);
net_result = socket_->SetReceiveBufferSize(integer_value);
}
return result ? PP_OK : PP_ERROR_FAILED;
// TODO(wtc): Add error mapping code.
return (net_result == net::OK) ? PP_OK : PP_ERROR_FAILED;
}
default: {
NOTREACHED();
......
......@@ -140,21 +140,22 @@ int32_t PepperUDPSocketMessageFilter::OnMsgSetOption(
if (!value.GetInt32(&integer_value) || integer_value <= 0)
return PP_ERROR_BADARGUMENT;
bool result = false;
int net_result = net::OK;
if (name == PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE) {
if (integer_value >
ppapi::proxy::UDPSocketResourceBase::kMaxSendBufferSize) {
return PP_ERROR_BADARGUMENT;
}
result = socket_->SetSendBufferSize(integer_value);
net_result = socket_->SetSendBufferSize(integer_value);
} else {
if (integer_value >
ppapi::proxy::UDPSocketResourceBase::kMaxReceiveBufferSize) {
return PP_ERROR_BADARGUMENT;
}
result = socket_->SetReceiveBufferSize(integer_value);
net_result = socket_->SetReceiveBufferSize(integer_value);
}
return result ? PP_OK : PP_ERROR_FAILED;
// TODO(wtc): Add error mapping code.
return (net_result == net::OK) ? PP_OK : PP_ERROR_FAILED;
}
default: {
NOTREACHED();
......
......@@ -99,14 +99,16 @@ int TransportChannelSocketAdapter::Write(
return result;
}
bool TransportChannelSocketAdapter::SetReceiveBufferSize(int32 size) {
int TransportChannelSocketAdapter::SetReceiveBufferSize(int32 size) {
DCHECK_EQ(base::MessageLoop::current(), message_loop_);
return channel_->SetOption(talk_base::Socket::OPT_RCVBUF, size) == 0;
return (channel_->SetOption(talk_base::Socket::OPT_RCVBUF, size) == 0) ?
net::OK : net::ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR;
}
bool TransportChannelSocketAdapter::SetSendBufferSize(int32 size) {
int TransportChannelSocketAdapter::SetSendBufferSize(int32 size) {
DCHECK_EQ(base::MessageLoop::current(), message_loop_);
return channel_->SetOption(talk_base::Socket::OPT_SNDBUF, size) == 0;
return (channel_->SetOption(talk_base::Socket::OPT_SNDBUF, size) == 0) ?
net::OK : net::ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR;
}
void TransportChannelSocketAdapter::Close(int error_code) {
......
......@@ -48,8 +48,8 @@ class TransportChannelSocketAdapter : public net::Socket,
virtual int Write(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
private:
void OnNewPacket(cricket::TransportChannel* channel,
......
......@@ -103,11 +103,11 @@ int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len,
return transport_socket_->Write(buf, buf_len, callback);
}
bool FakeSSLClientSocket::SetReceiveBufferSize(int32 size) {
int FakeSSLClientSocket::SetReceiveBufferSize(int32 size) {
return transport_socket_->SetReceiveBufferSize(size);
}
bool FakeSSLClientSocket::SetSendBufferSize(int32 size) {
int FakeSSLClientSocket::SetSendBufferSize(int32 size) {
return transport_socket_->SetSendBufferSize(size);
}
......
......@@ -49,8 +49,8 @@ class FakeSSLClientSocket : public net::StreamSocket {
const net::CompletionCallback& callback) OVERRIDE;
virtual int Write(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
virtual void Disconnect() OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
......
......@@ -50,8 +50,8 @@ class MockClientSocket : public net::StreamSocket {
const net::CompletionCallback&));
MOCK_METHOD3(Write, int(net::IOBuffer*, int,
const net::CompletionCallback&));
MOCK_METHOD1(SetReceiveBufferSize, bool(int32));
MOCK_METHOD1(SetSendBufferSize, bool(int32));
MOCK_METHOD1(SetReceiveBufferSize, int(int32));
MOCK_METHOD1(SetSendBufferSize, int(int32));
MOCK_METHOD1(Connect, int(const net::CompletionCallback&));
MOCK_METHOD0(Disconnect, void());
MOCK_CONST_METHOD0(IsConnected, bool());
......
......@@ -107,18 +107,18 @@ int ProxyResolvingClientSocket::Write(
return net::ERR_SOCKET_NOT_CONNECTED;
}
bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) {
int ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) {
if (transport_.get() && transport_->socket())
return transport_->socket()->SetReceiveBufferSize(size);
NOTREACHED();
return false;
return net::ERR_SOCKET_NOT_CONNECTED;
}
bool ProxyResolvingClientSocket::SetSendBufferSize(int32 size) {
int ProxyResolvingClientSocket::SetSendBufferSize(int32 size) {
if (transport_.get() && transport_->socket())
return transport_->socket()->SetSendBufferSize(size);
NOTREACHED();
return false;
return net::ERR_SOCKET_NOT_CONNECTED;
}
int ProxyResolvingClientSocket::Connect(
......
......@@ -52,8 +52,8 @@ class ProxyResolvingClientSocket : public net::StreamSocket {
const net::CompletionCallback& callback) OVERRIDE;
virtual int Write(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
virtual void Disconnect() OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
......
......@@ -484,18 +484,18 @@ int PseudoTcpAdapter::Write(net::IOBuffer* buffer, int buffer_size,
return core_->Write(buffer, buffer_size, callback);
}
bool PseudoTcpAdapter::SetReceiveBufferSize(int32 size) {
int PseudoTcpAdapter::SetReceiveBufferSize(int32 size) {
DCHECK(CalledOnValidThread());
core_->SetReceiveBufferSize(size);
return false;
return net::OK;
}
bool PseudoTcpAdapter::SetSendBufferSize(int32 size) {
int PseudoTcpAdapter::SetSendBufferSize(int32 size) {
DCHECK(CalledOnValidThread());
core_->SetSendBufferSize(size);
return false;
return net::OK;
}
int PseudoTcpAdapter::Connect(const net::CompletionCallback& callback) {
......
......@@ -34,8 +34,8 @@ class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe {
const net::CompletionCallback& callback) OVERRIDE;
virtual int Write(net::IOBuffer* buffer, int buffer_size,
const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
// net::StreamSocket implementation.
virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
......
......@@ -142,13 +142,13 @@ class FakeSocket : public net::Socket {
return buf_len;
}
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE {
virtual int SetReceiveBufferSize(int32 size) OVERRIDE {
NOTIMPLEMENTED();
return false;
return net::ERR_NOT_IMPLEMENTED;
}
virtual bool SetSendBufferSize(int32 size) OVERRIDE {
virtual int SetSendBufferSize(int32 size) OVERRIDE {
NOTIMPLEMENTED();
return false;
return net::ERR_NOT_IMPLEMENTED;
}
private:
......
......@@ -313,12 +313,20 @@ NET_ERROR(CT_NO_SCTS_VERIFIED_OK, -158)
// The SSL server sent us a fatal unrecognized_name alert.
NET_ERROR(SSL_UNRECOGNIZED_NAME_ALERT, -159)
// Failed to set or change the socket's receive buffer size as requested
// Failed to set the socket's receive buffer size as requested.
NET_ERROR(SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR, -160)
// Failed to set or change the socket's send buffer size as requested.
// Failed to set the socket's send buffer size as requested.
NET_ERROR(SOCKET_SET_SEND_BUFFER_SIZE_ERROR, -161)
// Failed to set the socket's receive buffer size as requested, despite success
// return code from setsockopt.
NET_ERROR(SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE, -162)
// Failed to set the socket's send buffer size as requested, despite success
// return code from setsockopt.
NET_ERROR(SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE, -163)
// Certificate error codes
//
// The values of certificate error codes must be consecutive.
......
......@@ -43,11 +43,11 @@ class TestUDPClientSocket : public DatagramClientSocket {
NOTIMPLEMENTED();
return OK;
}
virtual bool SetReceiveBufferSize(int32) OVERRIDE {
return true;
virtual int SetReceiveBufferSize(int32) OVERRIDE {
return OK;
}
virtual bool SetSendBufferSize(int32) OVERRIDE {
return true;
virtual int SetSendBufferSize(int32) OVERRIDE {
return OK;
}
virtual void Close() OVERRIDE {}
......
......@@ -33,8 +33,8 @@ class MockMDnsDatagramServerSocket : public DatagramServerSocket {
const std::string address,
const CompletionCallback& callback));
MOCK_METHOD1(SetReceiveBufferSize, bool(int32 size));
MOCK_METHOD1(SetSendBufferSize, bool(int32 size));
MOCK_METHOD1(SetReceiveBufferSize, int(int32 size));
MOCK_METHOD1(SetSendBufferSize, int(int32 size));
MOCK_METHOD0(Close, void());
......
......@@ -237,11 +237,11 @@ int HttpProxyClientSocket::Write(IOBuffer* buf, int buf_len,
return transport_->socket()->Write(buf, buf_len, callback);
}
bool HttpProxyClientSocket::SetReceiveBufferSize(int32 size) {
int HttpProxyClientSocket::SetReceiveBufferSize(int32 size) {
return transport_->socket()->SetReceiveBufferSize(size);
}
bool HttpProxyClientSocket::SetSendBufferSize(int32 size) {
int HttpProxyClientSocket::SetSendBufferSize(int32 size) {
return transport_->socket()->SetSendBufferSize(size);
}
......
......@@ -82,8 +82,8 @@ class HttpProxyClientSocket : public ProxyClientSocket {
virtual int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
......
......@@ -722,16 +722,18 @@ int QuicStreamFactory::CreateSession(
// does not consume "too much" memory. If we see bursty packet loss, we may
// revisit this setting and test for its impact.
const int32 kSocketBufferSize(TcpReceiver::kReceiveWindowTCP);
if (!socket->SetReceiveBufferSize(kSocketBufferSize)) {
rv = socket->SetReceiveBufferSize(kSocketBufferSize);
if (rv != OK) {
HistogramCreateSessionFailure(CREATION_ERROR_SETTING_RECEIVE_BUFFER);
return ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR;
return rv;
}
// Set a buffer large enough to contain the initial CWND's worth of packet
// to work around the problem with CHLO packets being sent out with the
// wrong encryption level, when the send buffer is full.
if (!socket->SetSendBufferSize(kMaxPacketSize * 20)) {
rv = socket->SetSendBufferSize(kMaxPacketSize * 20);
if (rv != OK) {
HistogramCreateSessionFailure(CREATION_ERROR_SETTING_SEND_BUFFER);
return ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR;
return rv;
}
scoped_ptr<QuicDefaultPacketWriter> writer(
......
......@@ -59,11 +59,11 @@ int BufferedWriteStreamSocket::Write(IOBuffer* buf, int buf_len,
return buf_len;
}
bool BufferedWriteStreamSocket::SetReceiveBufferSize(int32 size) {
int BufferedWriteStreamSocket::SetReceiveBufferSize(int32 size) {
return wrapped_socket_->SetReceiveBufferSize(size);
}
bool BufferedWriteStreamSocket::SetSendBufferSize(int32 size) {
int BufferedWriteStreamSocket::SetSendBufferSize(int32 size) {
return wrapped_socket_->SetSendBufferSize(size);
}
......
......@@ -43,8 +43,8 @@ class NET_EXPORT_PRIVATE BufferedWriteStreamSocket : public StreamSocket {
const CompletionCallback& callback) OVERRIDE;
virtual int Write(IOBuffer* buf, int buf_len,
const CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
// StreamSocket interface
virtual int Connect(const CompletionCallback& callback) OVERRIDE;
......
......@@ -145,8 +145,8 @@ class MockClientSocket : public StreamSocket {
was_used_to_convey_data_ = true;
return len;
}
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE { return true; }
virtual bool SetSendBufferSize(int32 size) OVERRIDE { return true; }
virtual int SetReceiveBufferSize(int32 size) OVERRIDE { return OK; }
virtual int SetSendBufferSize(int32 size) OVERRIDE { return OK; }
// StreamSocket implementation.
virtual int Connect(const CompletionCallback& callback) OVERRIDE {
......
......@@ -48,13 +48,13 @@ class NET_EXPORT Socket {
// Set the receive buffer size (in bytes) for the socket.
// Note: changing this value can affect the TCP window size on some platforms.
// Returns true on success, or false on failure.
virtual bool SetReceiveBufferSize(int32 size) = 0;
// Returns a net error code.
virtual int SetReceiveBufferSize(int32 size) = 0;
// Set the send buffer size (in bytes) for the socket.
// Note: changing this value can affect the TCP window size on some platforms.
// Returns true on success, or false on failure.
virtual bool SetSendBufferSize(int32 size) = 0;
// Returns a net error code.
virtual int SetSendBufferSize(int32 size) = 0;
};
} // namespace net
......
......@@ -713,12 +713,12 @@ MockClientSocket::MockClientSocket(const BoundNetLog& net_log)
peer_addr_ = IPEndPoint(ip, 0);
}
bool MockClientSocket::SetReceiveBufferSize(int32 size) {
return true;
int MockClientSocket::SetReceiveBufferSize(int32 size) {
return OK;
}
bool MockClientSocket::SetSendBufferSize(int32 size) {
return true;
int MockClientSocket::SetSendBufferSize(int32 size) {
return OK;
}
void MockClientSocket::Disconnect() {
......@@ -1162,12 +1162,12 @@ int DeterministicMockUDPClientSocket::Read(
return helper_.Read(buf, buf_len, callback);
}
bool DeterministicMockUDPClientSocket::SetReceiveBufferSize(int32 size) {
return true;
int DeterministicMockUDPClientSocket::SetReceiveBufferSize(int32 size) {
return OK;
}
bool DeterministicMockUDPClientSocket::SetSendBufferSize(int32 size) {
return true;
int DeterministicMockUDPClientSocket::SetSendBufferSize(int32 size) {
return OK;
}
void DeterministicMockUDPClientSocket::Close() {
......@@ -1508,12 +1508,12 @@ int MockUDPClientSocket::Write(IOBuffer* buf, int buf_len,
return write_result.result;
}
bool MockUDPClientSocket::SetReceiveBufferSize(int32 size) {
return true;
int MockUDPClientSocket::SetReceiveBufferSize(int32 size) {
return OK;
}
bool MockUDPClientSocket::SetSendBufferSize(int32 size) {
return true;
int MockUDPClientSocket::SetSendBufferSize(int32 size) {
return OK;
}
void MockUDPClientSocket::Close() {
......
......@@ -675,8 +675,8 @@ class MockClientSocket : public SSLClientSocket {
virtual int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) = 0;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
// StreamSocket implementation.
virtual int Connect(const CompletionCallback& callback) = 0;
......@@ -850,8 +850,8 @@ class DeterministicMockUDPClientSocket
virtual int Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
virtual int SetSendBufferSize(int32 size) OVERRIDE;
// DatagramSocket implementation.
virtual void Close() OVERRIDE;