| 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_basic_stream.h" | 5 #include "net/http/http_basic_stream.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "net/http/http_request_info.h" | 9 #include "net/http/http_request_info.h" |
| 10 #include "net/http/http_response_body_drainer.h" | 10 #include "net/http/http_response_body_drainer.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 parser()->GetSSLCertRequestInfo(cert_request_info); | 104 parser()->GetSSLCertRequestInfo(cert_request_info); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool HttpBasicStream::GetRemoteEndpoint(IPEndPoint* endpoint) { | 107 bool HttpBasicStream::GetRemoteEndpoint(IPEndPoint* endpoint) { |
| 108 if (!state_.connection() || !state_.connection()->socket()) | 108 if (!state_.connection() || !state_.connection()->socket()) |
| 109 return false; | 109 return false; |
| 110 | 110 |
| 111 return state_.connection()->socket()->GetPeerAddress(endpoint) == OK; | 111 return state_.connection()->socket()->GetPeerAddress(endpoint) == OK; |
| 112 } | 112 } |
| 113 | 113 |
| 114 Error HttpBasicStream::GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 114 Error HttpBasicStream::GetTokenBindingSignature(crypto::ECPrivateKey* key, |
| 115 std::vector<uint8_t>* out) { | 115 TokenBindingType tb_type, |
| 116 return parser()->GetSignedEKMForTokenBinding(key, out); | 116 std::vector<uint8_t>* out) { |
| 117 return parser()->GetTokenBindingSignature(key, tb_type, out); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void HttpBasicStream::Drain(HttpNetworkSession* session) { | 120 void HttpBasicStream::Drain(HttpNetworkSession* session) { |
| 120 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 121 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
| 121 drainer->Start(session); | 122 drainer->Start(session); |
| 122 // |drainer| will delete itself. | 123 // |drainer| will delete itself. |
| 123 } | 124 } |
| 124 | 125 |
| 125 void HttpBasicStream::PopulateNetErrorDetails(NetErrorDetails* details) { | 126 void HttpBasicStream::PopulateNetErrorDetails(NetErrorDetails* details) { |
| 126 // TODO(mmenke): Consumers don't actually care about HTTP version, but seems | 127 // TODO(mmenke): Consumers don't actually care about HTTP version, but seems |
| 127 // like the right version should be reported, if headers were received. | 128 // like the right version should be reported, if headers were received. |
| 128 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP1_1; | 129 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP1_1; |
| 129 return; | 130 return; |
| 130 } | 131 } |
| 131 | 132 |
| 132 void HttpBasicStream::SetPriority(RequestPriority priority) { | 133 void HttpBasicStream::SetPriority(RequestPriority priority) { |
| 133 // TODO(akalin): Plumb this through to |connection_|. | 134 // TODO(akalin): Plumb this through to |connection_|. |
| 134 } | 135 } |
| 135 | 136 |
| 136 } // namespace net | 137 } // namespace net |
| OLD | NEW |