OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter. h" | 5 #include "content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter. h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
452 return PP_ERROR_FAILED; | 452 return PP_ERROR_FAILED; |
453 | 453 |
454 int32_t integer_value = 0; | 454 int32_t integer_value = 0; |
455 if (!value.GetInt32(&integer_value) || integer_value <= 0) | 455 if (!value.GetInt32(&integer_value) || integer_value <= 0) |
456 return PP_ERROR_BADARGUMENT; | 456 return PP_ERROR_BADARGUMENT; |
457 | 457 |
458 bool result = false; | 458 bool result = false; |
459 if (name == PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE) { | 459 if (name == PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE) { |
460 if (integer_value > TCPSocketResourceBase::kMaxSendBufferSize) | 460 if (integer_value > TCPSocketResourceBase::kMaxSendBufferSize) |
461 return PP_ERROR_BADARGUMENT; | 461 return PP_ERROR_BADARGUMENT; |
462 result = socket_->SetSendBufferSize(integer_value); | 462 result = socket_->SetSendBufferSize(integer_value) == net::OK; |
463 } else { | 463 } else { |
464 if (integer_value > TCPSocketResourceBase::kMaxReceiveBufferSize) | 464 if (integer_value > TCPSocketResourceBase::kMaxReceiveBufferSize) |
465 return PP_ERROR_BADARGUMENT; | 465 return PP_ERROR_BADARGUMENT; |
466 result = socket_->SetReceiveBufferSize(integer_value); | 466 result = socket_->SetReceiveBufferSize(integer_value) == net::OK; |
467 } | 467 } |
468 return result ? PP_OK : PP_ERROR_FAILED; | 468 return result ? PP_OK : PP_ERROR_FAILED; |
wtc
2014/03/29 13:30:12
Nit: see my suggestion in the previous file.
jar (doing other things)
2014/04/01 23:50:39
Done as in previous file... with TODO(wtc).
| |
469 } | 469 } |
470 default: { | 470 default: { |
471 NOTREACHED(); | 471 NOTREACHED(); |
472 return PP_ERROR_BADARGUMENT; | 472 return PP_ERROR_BADARGUMENT; |
473 } | 473 } |
474 } | 474 } |
475 } | 475 } |
476 | 476 |
477 void PepperTCPSocketMessageFilter::DoBind( | 477 void PepperTCPSocketMessageFilter::DoBind( |
478 const ppapi::host::ReplyMessageContext& context, | 478 const ppapi::host::ReplyMessageContext& context, |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
970 | 970 |
971 void PepperTCPSocketMessageFilter::SendAcceptError( | 971 void PepperTCPSocketMessageFilter::SendAcceptError( |
972 const ppapi::host::ReplyMessageContext& context, | 972 const ppapi::host::ReplyMessageContext& context, |
973 int32_t pp_error) { | 973 int32_t pp_error) { |
974 SendAcceptReply(context, pp_error, 0, | 974 SendAcceptReply(context, pp_error, 0, |
975 NetAddressPrivateImpl::kInvalidNetAddress, | 975 NetAddressPrivateImpl::kInvalidNetAddress, |
976 NetAddressPrivateImpl::kInvalidNetAddress); | 976 NetAddressPrivateImpl::kInvalidNetAddress); |
977 } | 977 } |
978 | 978 |
979 } // namespace content | 979 } // namespace content |
OLD | NEW |