| 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_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 "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 user_read_buf_(NULL), | 78 user_read_buf_(NULL), |
| 79 user_read_buf_len_(0), | 79 user_read_buf_len_(0), |
| 80 user_callback_(NULL), | 80 user_callback_(NULL), |
| 81 connection_(connection), | 81 connection_(connection), |
| 82 net_log_(net_log), | 82 net_log_(net_log), |
| 83 ALLOW_THIS_IN_INITIALIZER_LIST( | 83 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 84 io_callback_(this, &HttpStreamParser::OnIOComplete)), | 84 io_callback_(this, &HttpStreamParser::OnIOComplete)), |
| 85 chunk_length_(0), | 85 chunk_length_(0), |
| 86 chunk_length_without_encoding_(0), | 86 chunk_length_without_encoding_(0), |
| 87 sent_last_chunk_(false) { | 87 sent_last_chunk_(false) { |
| 88 DCHECK_EQ(0, read_buffer->offset()); | |
| 89 } | 88 } |
| 90 | 89 |
| 91 HttpStreamParser::~HttpStreamParser() { | 90 HttpStreamParser::~HttpStreamParser() { |
| 92 if (request_body_ != NULL && request_body_->is_chunked()) | 91 if (request_body_ != NULL && request_body_->is_chunked()) |
| 93 request_body_->set_chunk_callback(NULL); | 92 request_body_->set_chunk_callback(NULL); |
| 94 } | 93 } |
| 95 | 94 |
| 96 int HttpStreamParser::SendRequest(const std::string& request_line, | 95 int HttpStreamParser::SendRequest(const std::string& request_line, |
| 97 const HttpRequestHeaders& headers, | 96 const HttpRequestHeaders& headers, |
| 98 UploadDataStream* request_body, | 97 UploadDataStream* request_body, |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 void HttpStreamParser::GetSSLCertRequestInfo( | 762 void HttpStreamParser::GetSSLCertRequestInfo( |
| 764 SSLCertRequestInfo* cert_request_info) { | 763 SSLCertRequestInfo* cert_request_info) { |
| 765 if (request_->url.SchemeIs("https") && connection_->socket()) { | 764 if (request_->url.SchemeIs("https") && connection_->socket()) { |
| 766 SSLClientSocket* ssl_socket = | 765 SSLClientSocket* ssl_socket = |
| 767 static_cast<SSLClientSocket*>(connection_->socket()); | 766 static_cast<SSLClientSocket*>(connection_->socket()); |
| 768 ssl_socket->GetSSLCertRequestInfo(cert_request_info); | 767 ssl_socket->GetSSLCertRequestInfo(cert_request_info); |
| 769 } | 768 } |
| 770 } | 769 } |
| 771 | 770 |
| 772 } // namespace net | 771 } // namespace net |
| OLD | NEW |