| 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 // HttpStream provides an abstraction for a basic http streams, SPDY, and QUIC. | 5 // HttpStream provides an abstraction for a basic http streams, SPDY, and QUIC. |
| 6 // The HttpStream subtype is expected to manage the underlying transport | 6 // The HttpStream subtype is expected to manage the underlying transport |
| 7 // appropriately. For example, a basic http stream will return the transport | 7 // appropriately. For example, a basic http stream will return the transport |
| 8 // socket to the pool for reuse. SPDY streams on the other hand leave the | 8 // socket to the pool for reuse. SPDY streams on the other hand leave the |
| 9 // transport socket management to the SpdySession. | 9 // transport socket management to the SpdySession. |
| 10 | 10 |
| 11 #ifndef NET_HTTP_HTTP_STREAM_H_ | 11 #ifndef NET_HTTP_HTTP_STREAM_H_ |
| 12 #define NET_HTTP_HTTP_STREAM_H_ | 12 #define NET_HTTP_HTTP_STREAM_H_ |
| 13 | 13 |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 | 15 |
| 16 #include <vector> |
| 17 |
| 16 #include "base/macros.h" | 18 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 18 #include "net/base/completion_callback.h" | 20 #include "net/base/completion_callback.h" |
| 19 #include "net/base/net_error_details.h" | 21 #include "net/base/net_error_details.h" |
| 20 #include "net/base/net_export.h" | 22 #include "net/base/net_export.h" |
| 21 #include "net/base/request_priority.h" | 23 #include "net/base/request_priority.h" |
| 22 #include "net/base/upload_progress.h" | 24 #include "net/base/upload_progress.h" |
| 23 | 25 |
| 26 namespace crypto { |
| 27 class ECPrivateKey; |
| 28 } |
| 29 |
| 24 namespace net { | 30 namespace net { |
| 25 | 31 |
| 26 class BoundNetLog; | 32 class BoundNetLog; |
| 27 class HttpNetworkSession; | 33 class HttpNetworkSession; |
| 28 class HttpRequestHeaders; | 34 class HttpRequestHeaders; |
| 29 struct HttpRequestInfo; | 35 struct HttpRequestInfo; |
| 30 class HttpResponseInfo; | 36 class HttpResponseInfo; |
| 31 class IOBuffer; | 37 class IOBuffer; |
| 32 class IPEndPoint; | 38 class IPEndPoint; |
| 33 struct LoadTimingInfo; | 39 struct LoadTimingInfo; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Get the SSLCertRequestInfo associated with this stream's connection. | 150 // Get the SSLCertRequestInfo associated with this stream's connection. |
| 145 // This should only be called for streams over SSL sockets, otherwise the | 151 // This should only be called for streams over SSL sockets, otherwise the |
| 146 // behavior is undefined. | 152 // behavior is undefined. |
| 147 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; | 153 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; |
| 148 | 154 |
| 149 // Gets the remote endpoint of the socket that the HTTP stream is using, if | 155 // Gets the remote endpoint of the socket that the HTTP stream is using, if |
| 150 // any. Returns true and fills in |endpoint| if it is available; returns false | 156 // any. Returns true and fills in |endpoint| if it is available; returns false |
| 151 // and does not modify |endpoint| if it is unavailable. | 157 // and does not modify |endpoint| if it is unavailable. |
| 152 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; | 158 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; |
| 153 | 159 |
| 160 // Signs the EKM value for Token Binding from the TLS layer using |*key| and |
| 161 // puts the result in |*out|. Returns OK or ERR_FAILED. |
| 162 virtual int GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, |
| 163 std::vector<uint8_t>* out) = 0; |
| 164 |
| 154 // In the case of an HTTP error or redirect, flush the response body (usually | 165 // In the case of an HTTP error or redirect, flush the response body (usually |
| 155 // a simple error or "this page has moved") so that we can re-use the | 166 // a simple error or "this page has moved") so that we can re-use the |
| 156 // underlying connection. This stream is responsible for deleting itself when | 167 // underlying connection. This stream is responsible for deleting itself when |
| 157 // draining is complete. | 168 // draining is complete. |
| 158 virtual void Drain(HttpNetworkSession* session) = 0; | 169 virtual void Drain(HttpNetworkSession* session) = 0; |
| 159 | 170 |
| 160 // Get the network error details this stream is encountering. | 171 // Get the network error details this stream is encountering. |
| 161 // Fills in |details| if it is available; leaves |details| unchanged if it | 172 // Fills in |details| if it is available; leaves |details| unchanged if it |
| 162 // is unavailable. | 173 // is unavailable. |
| 163 virtual void PopulateNetErrorDetails(NetErrorDetails* details) = 0; | 174 virtual void PopulateNetErrorDetails(NetErrorDetails* details) = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 175 // subclass does not support renewing the stream, NULL is returned. | 186 // subclass does not support renewing the stream, NULL is returned. |
| 176 virtual HttpStream* RenewStreamForAuth() = 0; | 187 virtual HttpStream* RenewStreamForAuth() = 0; |
| 177 | 188 |
| 178 private: | 189 private: |
| 179 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 190 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
| 180 }; | 191 }; |
| 181 | 192 |
| 182 } // namespace net | 193 } // namespace net |
| 183 | 194 |
| 184 #endif // NET_HTTP_HTTP_STREAM_H_ | 195 #endif // NET_HTTP_HTTP_STREAM_H_ |
| OLD | NEW |