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

Unified Diff: content/browser/renderer_host/pepper/pepper_tcp_socket.cc

Issue 227473008: make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux typo Created 6 years, 8 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: content/browser/renderer_host/pepper/pepper_tcp_socket.cc
diff --git a/content/browser/renderer_host/pepper/pepper_tcp_socket.cc b/content/browser/renderer_host/pepper/pepper_tcp_socket.cc
index 9a8be5c02719ff41e23b7c331ede44240710fafe..c03123a715b18ab3b11743d988cd9c2087813349 100644
--- a/content/browser/renderer_host/pepper/pepper_tcp_socket.cc
+++ b/content/browser/renderer_host/pepper/pepper_tcp_socket.cc
@@ -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: {

Powered by Google App Engine
This is Rietveld 408576698