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

Unified Diff: content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.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: content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc
diff --git a/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc b/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc
index a76ca4eedd152a65ae23ee8ec0fcaba59fb0a99a..b9cda2bd27ea76a438d05fccbea32abcfe25966f 100644
--- a/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc
@@ -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;
Ryan Hamilton 2014/04/08 19:55:11 FYI, you could use ERR_UNEXPECTED here since you e
jar (doing other things) 2014/04/08 23:16:26 Done.
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();

Powered by Google App Engine
This is Rietveld 408576698