Chromium Code Reviews| 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_udp_socket_message_filter. h" | 5 #include "content/browser/renderer_host/pepper/pepper_udp_socket_message_filter. h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 int32_t integer_value = 0; | 139 int32_t integer_value = 0; |
| 140 if (!value.GetInt32(&integer_value) || integer_value <= 0) | 140 if (!value.GetInt32(&integer_value) || integer_value <= 0) |
| 141 return PP_ERROR_BADARGUMENT; | 141 return PP_ERROR_BADARGUMENT; |
| 142 | 142 |
| 143 bool result = false; | 143 bool result = false; |
| 144 if (name == PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE) { | 144 if (name == PP_UDPSOCKET_OPTION_SEND_BUFFER_SIZE) { |
| 145 if (integer_value > | 145 if (integer_value > |
| 146 ppapi::proxy::UDPSocketResourceBase::kMaxSendBufferSize) { | 146 ppapi::proxy::UDPSocketResourceBase::kMaxSendBufferSize) { |
| 147 return PP_ERROR_BADARGUMENT; | 147 return PP_ERROR_BADARGUMENT; |
| 148 } | 148 } |
| 149 result = socket_->SetSendBufferSize(integer_value); | 149 result = socket_->SetSendBufferSize(integer_value) == net::OK; |
| 150 } else { | 150 } else { |
| 151 if (integer_value > | 151 if (integer_value > |
| 152 ppapi::proxy::UDPSocketResourceBase::kMaxReceiveBufferSize) { | 152 ppapi::proxy::UDPSocketResourceBase::kMaxReceiveBufferSize) { |
| 153 return PP_ERROR_BADARGUMENT; | 153 return PP_ERROR_BADARGUMENT; |
| 154 } | 154 } |
| 155 result = socket_->SetReceiveBufferSize(integer_value); | 155 result = socket_->SetReceiveBufferSize(integer_value) == net::OK; |
| 156 } | 156 } |
| 157 return result ? PP_OK : PP_ERROR_FAILED; | 157 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 other file.
| |
| 158 } | 158 } |
| 159 default: { | 159 default: { |
| 160 NOTREACHED(); | 160 NOTREACHED(); |
| 161 return PP_ERROR_BADARGUMENT; | 161 return PP_ERROR_BADARGUMENT; |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 int32_t PepperUDPSocketMessageFilter::OnMsgBind( | 166 int32_t PepperUDPSocketMessageFilter::OnMsgBind( |
| 167 const ppapi::host::HostMessageContext* context, | 167 const ppapi::host::HostMessageContext* context, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 NetAddressPrivateImpl::kInvalidNetAddress); | 452 NetAddressPrivateImpl::kInvalidNetAddress); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void PepperUDPSocketMessageFilter::SendSendToError( | 455 void PepperUDPSocketMessageFilter::SendSendToError( |
| 456 const ppapi::host::ReplyMessageContext& context, | 456 const ppapi::host::ReplyMessageContext& context, |
| 457 int32_t result) { | 457 int32_t result) { |
| 458 SendSendToReply(context, result, 0); | 458 SendSendToReply(context, result, 0); |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace content | 461 } // namespace content |
| OLD | NEW |