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 11 matching lines...) Expand all Loading... |
22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
23 #include "net/base/net_export.h" | 23 #include "net/base/net_export.h" |
24 #include "net/base/request_priority.h" | 24 #include "net/base/request_priority.h" |
25 | 25 |
26 namespace crypto { | 26 namespace crypto { |
27 class ECPrivateKey; | 27 class ECPrivateKey; |
28 } | 28 } |
29 | 29 |
30 namespace net { | 30 namespace net { |
31 | 31 |
32 class BoundNetLog; | 32 class NetLogWithSource; |
33 class HttpNetworkSession; | 33 class HttpNetworkSession; |
34 class HttpRequestHeaders; | 34 class HttpRequestHeaders; |
35 struct HttpRequestInfo; | 35 struct HttpRequestInfo; |
36 class HttpResponseInfo; | 36 class HttpResponseInfo; |
37 class IOBuffer; | 37 class IOBuffer; |
38 class IPEndPoint; | 38 class IPEndPoint; |
39 struct LoadTimingInfo; | 39 struct LoadTimingInfo; |
40 class SSLCertRequestInfo; | 40 class SSLCertRequestInfo; |
41 class SSLInfo; | 41 class SSLInfo; |
42 | 42 |
43 class NET_EXPORT_PRIVATE HttpStream { | 43 class NET_EXPORT_PRIVATE HttpStream { |
44 public: | 44 public: |
45 HttpStream() {} | 45 HttpStream() {} |
46 virtual ~HttpStream() {} | 46 virtual ~HttpStream() {} |
47 | 47 |
48 // Initialize stream. Must be called before calling SendRequest(). | 48 // Initialize stream. Must be called before calling SendRequest(). |
49 // |request_info| must outlive the HttpStream. | 49 // |request_info| must outlive the HttpStream. |
50 // Returns a net error code, possibly ERR_IO_PENDING. | 50 // Returns a net error code, possibly ERR_IO_PENDING. |
51 virtual int InitializeStream(const HttpRequestInfo* request_info, | 51 virtual int InitializeStream(const HttpRequestInfo* request_info, |
52 RequestPriority priority, | 52 RequestPriority priority, |
53 const BoundNetLog& net_log, | 53 const NetLogWithSource& net_log, |
54 const CompletionCallback& callback) = 0; | 54 const CompletionCallback& callback) = 0; |
55 | 55 |
56 // Writes the headers and uploads body data to the underlying socket. | 56 // Writes the headers and uploads body data to the underlying socket. |
57 // ERR_IO_PENDING is returned if the operation could not be completed | 57 // ERR_IO_PENDING is returned if the operation could not be completed |
58 // synchronously, in which case the result will be passed to the callback | 58 // synchronously, in which case the result will be passed to the callback |
59 // when available. Returns OK on success. | 59 // when available. Returns OK on success. |
60 // | 60 // |
61 // The callback will only be invoked once the first full set of headers have | 61 // The callback will only be invoked once the first full set of headers have |
62 // been received, at which point |response| will have been populated with that | 62 // been received, at which point |response| will have been populated with that |
63 // set of headers, and is safe to read, until/unless ReadResponseHeaders is | 63 // set of headers, and is safe to read, until/unless ReadResponseHeaders is |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // subclass does not support renewing the stream, NULL is returned. | 183 // subclass does not support renewing the stream, NULL is returned. |
184 virtual HttpStream* RenewStreamForAuth() = 0; | 184 virtual HttpStream* RenewStreamForAuth() = 0; |
185 | 185 |
186 private: | 186 private: |
187 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 187 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace net | 190 } // namespace net |
191 | 191 |
192 #endif // NET_HTTP_HTTP_STREAM_H_ | 192 #endif // NET_HTTP_HTTP_STREAM_H_ |
OLD | NEW |