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

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: fix typo on Linux 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..bca4222aaeb0421d079c8de099137a22c8f516b5 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_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) {

Powered by Google App Engine
This is Rietveld 408576698