| 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 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 | 1158 |
| 1159 void HttpStreamParser::GetSSLCertRequestInfo( | 1159 void HttpStreamParser::GetSSLCertRequestInfo( |
| 1160 SSLCertRequestInfo* cert_request_info) { | 1160 SSLCertRequestInfo* cert_request_info) { |
| 1161 if (request_->url.SchemeIsCryptographic() && connection_->socket()) { | 1161 if (request_->url.SchemeIsCryptographic() && connection_->socket()) { |
| 1162 SSLClientSocket* ssl_socket = | 1162 SSLClientSocket* ssl_socket = |
| 1163 static_cast<SSLClientSocket*>(connection_->socket()); | 1163 static_cast<SSLClientSocket*>(connection_->socket()); |
| 1164 ssl_socket->GetSSLCertRequestInfo(cert_request_info); | 1164 ssl_socket->GetSSLCertRequestInfo(cert_request_info); |
| 1165 } | 1165 } |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 Error HttpStreamParser::GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 1168 Error HttpStreamParser::GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 1169 std::vector<uint8_t>* out) { | 1169 TokenBindingType tb_type, |
| 1170 std::vector<uint8_t>* out) { |
| 1170 if (!request_->url.SchemeIsCryptographic() || !connection_->socket()) { | 1171 if (!request_->url.SchemeIsCryptographic() || !connection_->socket()) { |
| 1171 NOTREACHED(); | 1172 NOTREACHED(); |
| 1172 return ERR_FAILED; | 1173 return ERR_FAILED; |
| 1173 } | 1174 } |
| 1174 SSLClientSocket* ssl_socket = | 1175 SSLClientSocket* ssl_socket = |
| 1175 static_cast<SSLClientSocket*>(connection_->socket()); | 1176 static_cast<SSLClientSocket*>(connection_->socket()); |
| 1176 return ssl_socket->GetSignedEKMForTokenBinding(key, out); | 1177 return ssl_socket->GetTokenBindingSignature(key, tb_type, out); |
| 1177 } | 1178 } |
| 1178 | 1179 |
| 1179 int HttpStreamParser::EncodeChunk(const base::StringPiece& payload, | 1180 int HttpStreamParser::EncodeChunk(const base::StringPiece& payload, |
| 1180 char* output, | 1181 char* output, |
| 1181 size_t output_size) { | 1182 size_t output_size) { |
| 1182 if (output_size < payload.size() + kChunkHeaderFooterSize) | 1183 if (output_size < payload.size() + kChunkHeaderFooterSize) |
| 1183 return ERR_INVALID_ARGUMENT; | 1184 return ERR_INVALID_ARGUMENT; |
| 1184 | 1185 |
| 1185 char* cursor = output; | 1186 char* cursor = output; |
| 1186 // Add the header. | 1187 // Add the header. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, | 1222 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, |
| 1222 HttpStatusLineValidator::STATUS_LINE_MAX); | 1223 HttpStatusLineValidator::STATUS_LINE_MAX); |
| 1223 } | 1224 } |
| 1224 | 1225 |
| 1225 bool HttpStreamParser::SendRequestBuffersEmpty() { | 1226 bool HttpStreamParser::SendRequestBuffersEmpty() { |
| 1226 return request_headers_ == nullptr && request_body_send_buf_ == nullptr && | 1227 return request_headers_ == nullptr && request_body_send_buf_ == nullptr && |
| 1227 request_body_send_buf_ == nullptr; | 1228 request_body_send_buf_ == nullptr; |
| 1228 } | 1229 } |
| 1229 | 1230 |
| 1230 } // namespace net | 1231 } // namespace net |
| OLD | NEW |