Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: jingle/glue/channel_socket_adapter.cc

Issue 217573002: make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: process error code in quic_stream_factory Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: jingle/glue/channel_socket_adapter.cc
diff --git a/jingle/glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc
index 40ed12c7cd9856a184426d46c7645acd3073e7c1..60131d4b195790cbbea70a4af48e684106504076 100644
--- a/jingle/glue/channel_socket_adapter.cc
+++ b/jingle/glue/channel_socket_adapter.cc
@@ -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_SEND_BUFFER_SIZE_ERROR;
wtc 2014/03/29 13:30:12 BUG: the error code should be ...RECEIVE_BUFFER...
jar (doing other things) 2014/04/01 23:50:39 Done.
}
-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) {

Powered by Google App Engine
This is Rietveld 408576698