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

Side by Side Diff: net/http/http_proxy_client_socket.cc

Issue 8831001: base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix alignment. Created 9 years 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/http/http_proxy_client_socket.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/http/http_proxy_client_socket.h" 5 #include "net/http/http_proxy_client_socket.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 return ERR_TUNNEL_CONNECTION_FAILED; 248 return ERR_TUNNEL_CONNECTION_FAILED;
249 } 249 }
250 250
251 return transport_->socket()->Read(buf, buf_len, callback); 251 return transport_->socket()->Read(buf, buf_len, callback);
252 } 252 }
253 253
254 int HttpProxyClientSocket::Write(IOBuffer* buf, int buf_len, 254 int HttpProxyClientSocket::Write(IOBuffer* buf, int buf_len,
255 OldCompletionCallback* callback) { 255 OldCompletionCallback* callback) {
256 DCHECK_EQ(STATE_DONE, next_state_); 256 DCHECK_EQ(STATE_DONE, next_state_);
257 DCHECK(!old_user_callback_); 257 DCHECK(!old_user_callback_ && user_callback_.is_null());
258 258
259 return transport_->socket()->Write(buf, buf_len, callback); 259 return transport_->socket()->Write(buf, buf_len, callback);
260 } 260 }
261 int HttpProxyClientSocket::Write(IOBuffer* buf, int buf_len,
262 const CompletionCallback& callback) {
263 DCHECK_EQ(STATE_DONE, next_state_);
264 DCHECK(!old_user_callback_ && user_callback_.is_null());
265
266 return transport_->socket()->Write(buf, buf_len, callback);
267 }
261 268
262 bool HttpProxyClientSocket::SetReceiveBufferSize(int32 size) { 269 bool HttpProxyClientSocket::SetReceiveBufferSize(int32 size) {
263 return transport_->socket()->SetReceiveBufferSize(size); 270 return transport_->socket()->SetReceiveBufferSize(size);
264 } 271 }
265 272
266 bool HttpProxyClientSocket::SetSendBufferSize(int32 size) { 273 bool HttpProxyClientSocket::SetSendBufferSize(int32 size) {
267 return transport_->socket()->SetSendBufferSize(size); 274 return transport_->socket()->SetSendBufferSize(size);
268 } 275 }
269 276
270 int HttpProxyClientSocket::GetPeerAddress(AddressList* address) const { 277 int HttpProxyClientSocket::GetPeerAddress(AddressList* address) const {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 523
517 if (http_stream_parser_->IsResponseBodyComplete()) 524 if (http_stream_parser_->IsResponseBodyComplete())
518 return DidDrainBodyForAuthRestart(true); 525 return DidDrainBodyForAuthRestart(true);
519 526
520 // Keep draining. 527 // Keep draining.
521 next_state_ = STATE_DRAIN_BODY; 528 next_state_ = STATE_DRAIN_BODY;
522 return OK; 529 return OK;
523 } 530 }
524 531
525 } // namespace net 532 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698