OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_stream_parser.h" | 5 #include "net/http/http_stream_parser.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "net/base/auth.h" | 9 #include "net/base/auth.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 int HttpStreamParser::SendRequest(const std::string& headers, | 46 int HttpStreamParser::SendRequest(const std::string& headers, |
47 UploadDataStream* request_body, | 47 UploadDataStream* request_body, |
48 HttpResponseInfo* response, | 48 HttpResponseInfo* response, |
49 CompletionCallback* callback) { | 49 CompletionCallback* callback) { |
50 DCHECK_EQ(STATE_NONE, io_state_); | 50 DCHECK_EQ(STATE_NONE, io_state_); |
51 DCHECK(!user_callback_); | 51 DCHECK(!user_callback_); |
52 DCHECK(callback); | 52 DCHECK(callback); |
53 DCHECK(response); | 53 DCHECK(response); |
54 | 54 |
55 response_ = response; | 55 response_ = response; |
56 scoped_refptr<StringIOBuffer> headers_io_buf = new StringIOBuffer(headers); | 56 scoped_refptr<StringIOBuffer> headers_io_buf(new StringIOBuffer(headers)); |
57 request_headers_ = new DrainableIOBuffer(headers_io_buf, | 57 request_headers_ = new DrainableIOBuffer(headers_io_buf, |
58 headers_io_buf->size()); | 58 headers_io_buf->size()); |
59 request_body_.reset(request_body); | 59 request_body_.reset(request_body); |
60 | 60 |
61 io_state_ = STATE_SENDING_HEADERS; | 61 io_state_ = STATE_SENDING_HEADERS; |
62 int result = DoLoop(OK); | 62 int result = DoLoop(OK); |
63 if (result == ERR_IO_PENDING) | 63 if (result == ERR_IO_PENDING) |
64 user_callback_ = callback; | 64 user_callback_ = callback; |
65 | 65 |
66 return result > 0 ? OK : result; | 66 return result > 0 ? OK : result; |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 void HttpStreamParser::GetSSLCertRequestInfo( | 620 void HttpStreamParser::GetSSLCertRequestInfo( |
621 SSLCertRequestInfo* cert_request_info) { | 621 SSLCertRequestInfo* cert_request_info) { |
622 if (request_->url.SchemeIs("https") && connection_->socket()) { | 622 if (request_->url.SchemeIs("https") && connection_->socket()) { |
623 SSLClientSocket* ssl_socket = | 623 SSLClientSocket* ssl_socket = |
624 static_cast<SSLClientSocket*>(connection_->socket()); | 624 static_cast<SSLClientSocket*>(connection_->socket()); |
625 ssl_socket->GetSSLCertRequestInfo(cert_request_info); | 625 ssl_socket->GetSSLCertRequestInfo(cert_request_info); |
626 } | 626 } |
627 } | 627 } |
628 | 628 |
629 } // namespace net | 629 } // namespace net |
OLD | NEW |