Chromium Code Reviews| 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 "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "crypto/ec_private_key.h" | |
|
davidben
2015/11/18 20:49:00
Forward decl
nharper
2015/12/04 01:42:19
Done.
| |
| 18 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
| 19 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 20 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
| 21 #include "net/base/upload_progress.h" | 22 #include "net/base/upload_progress.h" |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 | 25 |
| 25 class BoundNetLog; | 26 class BoundNetLog; |
| 26 class HttpNetworkSession; | 27 class HttpNetworkSession; |
| 27 class HttpRequestHeaders; | 28 class HttpRequestHeaders; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 | 143 |
| 143 // Get the SSLCertRequestInfo associated with this stream's connection. | 144 // Get the SSLCertRequestInfo associated with this stream's connection. |
| 144 // This should only be called for streams over SSL sockets, otherwise the | 145 // This should only be called for streams over SSL sockets, otherwise the |
| 145 // behavior is undefined. | 146 // behavior is undefined. |
| 146 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; | 147 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) = 0; |
| 147 | 148 |
| 148 // Gets the remote endpoint of the socket that the HTTP stream is using, if | 149 // 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 | 150 // any. Returns true and fills in |endpoint| if it is available; returns false |
| 150 // and does not modify |endpoint| if it is unavailable. | 151 // and does not modify |endpoint| if it is unavailable. |
| 151 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; | 152 virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) = 0; |
| 152 | 153 |
|
davidben
2015/11/18 20:49:00
Documentation?
nharper
2015/12/04 01:42:20
This method is now gone, and a passthru to SSLClie
| |
| 154 virtual int GetProvidedTokenBindingWithKey( | |
|
davidben
2015/11/18 20:49:00
Nit: Maybe WithKey -> ForKey? Not sure. That seems
davidben
2015/11/18 20:49:00
So, I'm a little confused about this "provided" vs
nharper
2015/12/04 01:42:20
Pushing this up higher did clean up some stuff.
nharper
2015/12/04 01:42:20
Method is gone, so naming is moot.
| |
| 155 const scoped_ptr<crypto::ECPrivateKey>& key, | |
|
davidben
2015/11/18 20:49:00
crypto::ECPrivateKey* is how you spell a non-ownin
nharper
2015/12/04 01:42:20
Done.
| |
| 156 std::string* header_out) = 0; | |
| 157 | |
| 153 // In the case of an HTTP error or redirect, flush the response body (usually | 158 // 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 | 159 // 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 | 160 // underlying connection. This stream is responsible for deleting itself when |
| 156 // draining is complete. | 161 // draining is complete. |
| 157 virtual void Drain(HttpNetworkSession* session) = 0; | 162 virtual void Drain(HttpNetworkSession* session) = 0; |
| 158 | 163 |
| 159 // Called when the priority of the parent transaction changes. | 164 // Called when the priority of the parent transaction changes. |
| 160 virtual void SetPriority(RequestPriority priority) = 0; | 165 virtual void SetPriority(RequestPriority priority) = 0; |
| 161 | 166 |
| 162 // Queries the UploadDataStream for its progress (bytes sent). | 167 // Queries the UploadDataStream for its progress (bytes sent). |
| 163 virtual UploadProgress GetUploadProgress() const = 0; | 168 virtual UploadProgress GetUploadProgress() const = 0; |
| 164 | 169 |
| 165 // Returns a new (not initialized) stream using the same underlying | 170 // Returns a new (not initialized) stream using the same underlying |
| 166 // connection and invalidates the old stream - no further methods should be | 171 // 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 | 172 // 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 | 173 // from the previous request is drained before calling this method. If the |
| 169 // subclass does not support renewing the stream, NULL is returned. | 174 // subclass does not support renewing the stream, NULL is returned. |
| 170 virtual HttpStream* RenewStreamForAuth() = 0; | 175 virtual HttpStream* RenewStreamForAuth() = 0; |
| 171 | 176 |
| 172 private: | 177 private: |
| 173 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 178 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
| 174 }; | 179 }; |
| 175 | 180 |
| 176 } // namespace net | 181 } // namespace net |
| 177 | 182 |
| 178 #endif // NET_HTTP_HTTP_STREAM_H_ | 183 #endif // NET_HTTP_HTTP_STREAM_H_ |
| OLD | NEW |