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

Side by Side Diff: net/socket/socks_client_socket.cc

Issue 199048: Add methods for setting socket buffers to the Socket (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « net/socket/socks_client_socket.h ('k') | net/socket/ssl_client_socket_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "build/build_config.h" 8 #include "build/build_config.h"
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <ws2tcpip.h> 10 #include <ws2tcpip.h>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // SOCKS handshake is complete. 129 // SOCKS handshake is complete.
130 int SOCKSClientSocket::Write(IOBuffer* buf, int buf_len, 130 int SOCKSClientSocket::Write(IOBuffer* buf, int buf_len,
131 CompletionCallback* callback) { 131 CompletionCallback* callback) {
132 DCHECK(completed_handshake_); 132 DCHECK(completed_handshake_);
133 DCHECK_EQ(STATE_NONE, next_state_); 133 DCHECK_EQ(STATE_NONE, next_state_);
134 DCHECK(!user_callback_); 134 DCHECK(!user_callback_);
135 135
136 return transport_->Write(buf, buf_len, callback); 136 return transport_->Write(buf, buf_len, callback);
137 } 137 }
138 138
139 bool SOCKSClientSocket::SetReceiveBufferSize(int32 size) {
140 return transport_->SetReceiveBufferSize(size);
141 }
142
143 bool SOCKSClientSocket::SetSendBufferSize(int32 size) {
144 return transport_->SetSendBufferSize(size);
145 }
146
139 void SOCKSClientSocket::DoCallback(int result) { 147 void SOCKSClientSocket::DoCallback(int result) {
140 DCHECK_NE(ERR_IO_PENDING, result); 148 DCHECK_NE(ERR_IO_PENDING, result);
141 DCHECK(user_callback_); 149 DCHECK(user_callback_);
142 150
143 // Since Run() may result in Read being called, 151 // Since Run() may result in Read being called,
144 // clear user_callback_ up front. 152 // clear user_callback_ up front.
145 CompletionCallback* c = user_callback_; 153 CompletionCallback* c = user_callback_;
146 user_callback_ = NULL; 154 user_callback_ = NULL;
147 DLOG(INFO) << "Finished setting up SOCKS handshake"; 155 DLOG(INFO) << "Finished setting up SOCKS handshake";
148 c->Run(result); 156 c->Run(result);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 384 }
377 385
378 #if defined(OS_LINUX) 386 #if defined(OS_LINUX)
379 int SOCKSClientSocket::GetPeerName(struct sockaddr* name, 387 int SOCKSClientSocket::GetPeerName(struct sockaddr* name,
380 socklen_t* namelen) { 388 socklen_t* namelen) {
381 return transport_->GetPeerName(name, namelen); 389 return transport_->GetPeerName(name, namelen);
382 } 390 }
383 #endif 391 #endif
384 392
385 } // namespace net 393 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket.h ('k') | net/socket/ssl_client_socket_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698