OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_H_ |
6 #define NET_HTTP_HTTP_STREAM_FACTORY_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
14 #include "net/base/load_states.h" | 14 #include "net/base/load_states.h" |
15 #include "net/base/net_api.h" | 15 #include "net/base/net_export.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 class BoundNetLog; | 21 class BoundNetLog; |
22 class HostMappingRules; | 22 class HostMappingRules; |
23 class HostPortPair; | 23 class HostPortPair; |
24 class HttpAlternateProtocols; | 24 class HttpAlternateProtocols; |
25 class HttpAuthController; | 25 class HttpAuthController; |
26 class HttpNetworkSession; | 26 class HttpNetworkSession; |
27 class HttpResponseInfo; | 27 class HttpResponseInfo; |
28 class HttpStream; | 28 class HttpStream; |
29 class ProxyInfo; | 29 class ProxyInfo; |
30 class SSLCertRequestInfo; | 30 class SSLCertRequestInfo; |
31 class SSLInfo; | 31 class SSLInfo; |
32 class X509Certificate; | 32 class X509Certificate; |
33 struct HttpRequestInfo; | 33 struct HttpRequestInfo; |
34 struct SSLConfig; | 34 struct SSLConfig; |
35 | 35 |
36 // The HttpStreamRequest is the client's handle to the worker object which | 36 // The HttpStreamRequest is the client's handle to the worker object which |
37 // handles the creation of an HttpStream. While the HttpStream is being | 37 // handles the creation of an HttpStream. While the HttpStream is being |
38 // created, this object is the creator's handle for interacting with the | 38 // created, this object is the creator's handle for interacting with the |
39 // HttpStream creation process. The request is cancelled by deleting it, after | 39 // HttpStream creation process. The request is cancelled by deleting it, after |
40 // which no callbacks will be invoked. | 40 // which no callbacks will be invoked. |
41 class NET_TEST HttpStreamRequest { | 41 class NET_EXPORT_PRIVATE HttpStreamRequest { |
42 public: | 42 public: |
43 // The HttpStreamRequest::Delegate is a set of callback methods for a | 43 // The HttpStreamRequest::Delegate is a set of callback methods for a |
44 // HttpStreamRequestJob. Generally, only one of these methods will be | 44 // HttpStreamRequestJob. Generally, only one of these methods will be |
45 // called as a result of a stream request. | 45 // called as a result of a stream request. |
46 class NET_TEST Delegate { | 46 class NET_EXPORT_PRIVATE Delegate { |
47 public: | 47 public: |
48 virtual ~Delegate() {} | 48 virtual ~Delegate() {} |
49 | 49 |
50 // This is the success case. | 50 // This is the success case. |
51 // |stream| is now owned by the delegate. | 51 // |stream| is now owned by the delegate. |
52 // |used_ssl_config| indicates the actual SSL configuration used for this | 52 // |used_ssl_config| indicates the actual SSL configuration used for this |
53 // stream, since the HttpStreamRequest may have modified the configuration | 53 // stream, since the HttpStreamRequest may have modified the configuration |
54 // during stream processing. | 54 // during stream processing. |
55 // |used_proxy_info| indicates the actual ProxyInfo used for this stream, | 55 // |used_proxy_info| indicates the actual ProxyInfo used for this stream, |
56 // since the HttpStreamRequest performs the proxy resolution. | 56 // since the HttpStreamRequest performs the proxy resolution. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 virtual LoadState GetLoadState() const = 0; | 137 virtual LoadState GetLoadState() const = 0; |
138 | 138 |
139 // Returns true if TLS/NPN was negotiated for this stream. | 139 // Returns true if TLS/NPN was negotiated for this stream. |
140 virtual bool was_npn_negotiated() const = 0; | 140 virtual bool was_npn_negotiated() const = 0; |
141 | 141 |
142 // Returns true if this stream is being fetched over SPDY. | 142 // Returns true if this stream is being fetched over SPDY. |
143 virtual bool using_spdy() const = 0; | 143 virtual bool using_spdy() const = 0; |
144 }; | 144 }; |
145 | 145 |
146 // The HttpStreamFactory defines an interface for creating usable HttpStreams. | 146 // The HttpStreamFactory defines an interface for creating usable HttpStreams. |
147 class NET_API HttpStreamFactory { | 147 class NET_EXPORT HttpStreamFactory { |
148 public: | 148 public: |
149 virtual ~HttpStreamFactory(); | 149 virtual ~HttpStreamFactory(); |
150 | 150 |
151 void ProcessAlternateProtocol( | 151 void ProcessAlternateProtocol( |
152 HttpAlternateProtocols* alternate_protocols, | 152 HttpAlternateProtocols* alternate_protocols, |
153 const std::string& alternate_protocol_str, | 153 const std::string& alternate_protocol_str, |
154 const HostPortPair& http_host_port_pair); | 154 const HostPortPair& http_host_port_pair); |
155 | 155 |
156 // Virtual interface methods. | 156 // Virtual interface methods. |
157 | 157 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 static bool force_spdy_always_; | 240 static bool force_spdy_always_; |
241 static std::list<HostPortPair>* forced_spdy_exclusions_; | 241 static std::list<HostPortPair>* forced_spdy_exclusions_; |
242 static bool ignore_certificate_errors_; | 242 static bool ignore_certificate_errors_; |
243 | 243 |
244 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 244 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
245 }; | 245 }; |
246 | 246 |
247 } // namespace net | 247 } // namespace net |
248 | 248 |
249 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 249 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
OLD | NEW |