OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |