| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 | 1166 |
| 1167 void HttpStreamParser::GetSSLCertRequestInfo( | 1167 void HttpStreamParser::GetSSLCertRequestInfo( |
| 1168 SSLCertRequestInfo* cert_request_info) { | 1168 SSLCertRequestInfo* cert_request_info) { |
| 1169 if (request_->url.SchemeIsCryptographic() && connection_->socket()) { | 1169 if (request_->url.SchemeIsCryptographic() && connection_->socket()) { |
| 1170 SSLClientSocket* ssl_socket = | 1170 SSLClientSocket* ssl_socket = |
| 1171 static_cast<SSLClientSocket*>(connection_->socket()); | 1171 static_cast<SSLClientSocket*>(connection_->socket()); |
| 1172 ssl_socket->GetSSLCertRequestInfo(cert_request_info); | 1172 ssl_socket->GetSSLCertRequestInfo(cert_request_info); |
| 1173 } | 1173 } |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 Error HttpStreamParser::GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 1176 Error HttpStreamParser::GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 1177 std::vector<uint8_t>* out) { | 1177 TokenBindingType tb_type, |
| 1178 std::vector<uint8_t>* out) { |
| 1178 if (!request_->url.SchemeIsCryptographic() || !connection_->socket()) { | 1179 if (!request_->url.SchemeIsCryptographic() || !connection_->socket()) { |
| 1179 NOTREACHED(); | 1180 NOTREACHED(); |
| 1180 return ERR_FAILED; | 1181 return ERR_FAILED; |
| 1181 } | 1182 } |
| 1182 SSLClientSocket* ssl_socket = | 1183 SSLClientSocket* ssl_socket = |
| 1183 static_cast<SSLClientSocket*>(connection_->socket()); | 1184 static_cast<SSLClientSocket*>(connection_->socket()); |
| 1184 return ssl_socket->GetSignedEKMForTokenBinding(key, out); | 1185 return ssl_socket->GetTokenBindingSignature(key, tb_type, out); |
| 1185 } | 1186 } |
| 1186 | 1187 |
| 1187 int HttpStreamParser::EncodeChunk(const base::StringPiece& payload, | 1188 int HttpStreamParser::EncodeChunk(const base::StringPiece& payload, |
| 1188 char* output, | 1189 char* output, |
| 1189 size_t output_size) { | 1190 size_t output_size) { |
| 1190 if (output_size < payload.size() + kChunkHeaderFooterSize) | 1191 if (output_size < payload.size() + kChunkHeaderFooterSize) |
| 1191 return ERR_INVALID_ARGUMENT; | 1192 return ERR_INVALID_ARGUMENT; |
| 1192 | 1193 |
| 1193 char* cursor = output; | 1194 char* cursor = output; |
| 1194 // Add the header. | 1195 // Add the header. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, | 1230 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, |
| 1230 HttpStatusLineValidator::STATUS_LINE_MAX); | 1231 HttpStatusLineValidator::STATUS_LINE_MAX); |
| 1231 } | 1232 } |
| 1232 | 1233 |
| 1233 bool HttpStreamParser::SendRequestBuffersEmpty() { | 1234 bool HttpStreamParser::SendRequestBuffersEmpty() { |
| 1234 return request_headers_ == nullptr && request_body_send_buf_ == nullptr && | 1235 return request_headers_ == nullptr && request_body_send_buf_ == nullptr && |
| 1235 request_body_send_buf_ == nullptr; | 1236 request_body_send_buf_ == nullptr; |
| 1236 } | 1237 } |
| 1237 | 1238 |
| 1238 } // namespace net | 1239 } // namespace net |
| OLD | NEW |