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

Side by Side Diff: net/socket/socks_client_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/socket/socks_client_socket.h" 5 #include "net/socket/socks_client_socket.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 int rv = transport_->socket()->Write( 205 int rv = transport_->socket()->Write(
206 buf, buf_len, 206 buf, buf_len,
207 base::Bind(&SOCKSClientSocket::OnReadWriteComplete, 207 base::Bind(&SOCKSClientSocket::OnReadWriteComplete,
208 base::Unretained(this), callback)); 208 base::Unretained(this), callback));
209 if (rv > 0) 209 if (rv > 0)
210 was_ever_used_ = true; 210 was_ever_used_ = true;
211 return rv; 211 return rv;
212 } 212 }
213 213
214 bool SOCKSClientSocket::SetReceiveBufferSize(int32 size) { 214 int SOCKSClientSocket::SetReceiveBufferSize(int32 size) {
215 return transport_->socket()->SetReceiveBufferSize(size); 215 return transport_->socket()->SetReceiveBufferSize(size);
216 } 216 }
217 217
218 bool SOCKSClientSocket::SetSendBufferSize(int32 size) { 218 int SOCKSClientSocket::SetSendBufferSize(int32 size) {
219 return transport_->socket()->SetSendBufferSize(size); 219 return transport_->socket()->SetSendBufferSize(size);
220 } 220 }
221 221
222 void SOCKSClientSocket::DoCallback(int result) { 222 void SOCKSClientSocket::DoCallback(int result) {
223 DCHECK_NE(ERR_IO_PENDING, result); 223 DCHECK_NE(ERR_IO_PENDING, result);
224 DCHECK(!user_callback_.is_null()); 224 DCHECK(!user_callback_.is_null());
225 225
226 // Since Run() may result in Read being called, 226 // Since Run() may result in Read being called,
227 // clear user_callback_ up front. 227 // clear user_callback_ up front.
228 DVLOG(1) << "Finished setting up SOCKS handshake"; 228 DVLOG(1) << "Finished setting up SOCKS handshake";
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { 447 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const {
448 return transport_->socket()->GetPeerAddress(address); 448 return transport_->socket()->GetPeerAddress(address);
449 } 449 }
450 450
451 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { 451 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const {
452 return transport_->socket()->GetLocalAddress(address); 452 return transport_->socket()->GetLocalAddress(address);
453 } 453 }
454 454
455 } // namespace net 455 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698