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 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 // Get the SSLCertRequestInfo associated with this stream's connection. | 143 // Get the SSLCertRequestInfo associated with this stream's connection. |
144 // This should only be called for streams over SSL sockets, otherwise the | 144 // This should only be called for streams over SSL sockets, otherwise the |
145 // behavior is undefined. | 145 // behavior is undefined. |
146 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; | 146 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; |
147 | 147 |
148 // Gets the remote endpoint of the socket that the HTTP stream is using, if | 148 // Gets the remote endpoint of the socket that the HTTP stream is using, if |
149 // any. Returns true and fills in |endpoint| if it is available; returns false | 149 // any. Returns true and fills in |endpoint| if it is available; returns false |
150 // and does not modify |endpoint| if it is unavailable. | 150 // and does not modify |endpoint| if it is unavailable. |
151 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; | 151 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; |
152 | 152 |
153 // Puts the TokenBindingMessage for the SSL connection in |out|. If this | |
154 // stream's connection is not over an SSL socket, or token binding was not | |
155 // negotiated for this connection, then |*out| will be set to the empty | |
156 // string. | |
mattm
2015/10/01 01:53:01
document return value
nharper
2015/10/01 20:25:46
Done.
| |
157 virtual int GetTokenBindingMessageHeader(std::string* out) = 0; | |
158 | |
153 // In the case of an HTTP error or redirect, flush the response body (usually | 159 // In the case of an HTTP error or redirect, flush the response body (usually |
154 // a simple error or "this page has moved") so that we can re-use the | 160 // a simple error or "this page has moved") so that we can re-use the |
155 // underlying connection. This stream is responsible for deleting itself when | 161 // underlying connection. This stream is responsible for deleting itself when |
156 // draining is complete. | 162 // draining is complete. |
157 virtual void Drain(HttpNetworkSession* session) = 0; | 163 virtual void Drain(HttpNetworkSession* session) = 0; |
158 | 164 |
159 // Called when the priority of the parent transaction changes. | 165 // Called when the priority of the parent transaction changes. |
160 virtual void SetPriority(RequestPriority priority) = 0; | 166 virtual void SetPriority(RequestPriority priority) = 0; |
161 | 167 |
162 // Queries the UploadDataStream for its progress (bytes sent). | 168 // Queries the UploadDataStream for its progress (bytes sent). |
163 virtual UploadProgress GetUploadProgress() const = 0; | 169 virtual UploadProgress GetUploadProgress() const = 0; |
164 | 170 |
165 // Returns a new (not initialized) stream using the same underlying | 171 // Returns a new (not initialized) stream using the same underlying |
166 // connection and invalidates the old stream - no further methods should be | 172 // connection and invalidates the old stream - no further methods should be |
167 // called on the old stream. The caller should ensure that the response body | 173 // called on the old stream. The caller should ensure that the response body |
168 // from the previous request is drained before calling this method. If the | 174 // from the previous request is drained before calling this method. If the |
169 // subclass does not support renewing the stream, NULL is returned. | 175 // subclass does not support renewing the stream, NULL is returned. |
170 virtual HttpStream* RenewStreamForAuth() = 0; | 176 virtual HttpStream* RenewStreamForAuth() = 0; |
171 | 177 |
172 private: | 178 private: |
173 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 179 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
174 }; | 180 }; |
175 | 181 |
176 } // namespace net | 182 } // namespace net |
177 | 183 |
178 #endif // NET_HTTP_HTTP_STREAM_H_ | 184 #endif // NET_HTTP_HTTP_STREAM_H_ |
OLD | NEW |