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_export.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 HttpPipelinedHost; |
27 class HttpResponseInfo; | 28 class HttpResponseInfo; |
28 class HttpStream; | 29 class HttpStream; |
29 class ProxyInfo; | 30 class ProxyInfo; |
30 class SSLCertRequestInfo; | 31 class SSLCertRequestInfo; |
31 class SSLInfo; | 32 class SSLInfo; |
32 class X509Certificate; | 33 class X509Certificate; |
33 struct HttpRequestInfo; | 34 struct HttpRequestInfo; |
34 struct SSLConfig; | 35 struct SSLConfig; |
35 | 36 |
36 // The HttpStreamRequest is the client's handle to the worker object which | 37 // The HttpStreamRequest is the client's handle to the worker object which |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Requests that enough connections for |num_streams| be opened. | 168 // Requests that enough connections for |num_streams| be opened. |
168 virtual void PreconnectStreams(int num_streams, | 169 virtual void PreconnectStreams(int num_streams, |
169 const HttpRequestInfo& info, | 170 const HttpRequestInfo& info, |
170 const SSLConfig& server_ssl_config, | 171 const SSLConfig& server_ssl_config, |
171 const SSLConfig& proxy_ssl_config, | 172 const SSLConfig& proxy_ssl_config, |
172 const BoundNetLog& net_log) = 0; | 173 const BoundNetLog& net_log) = 0; |
173 | 174 |
174 virtual void AddTLSIntolerantServer(const HostPortPair& server) = 0; | 175 virtual void AddTLSIntolerantServer(const HostPortPair& server) = 0; |
175 virtual bool IsTLSIntolerantServer(const HostPortPair& server) const = 0; | 176 virtual bool IsTLSIntolerantServer(const HostPortPair& server) const = 0; |
176 | 177 |
| 178 // Called when a HttpPipelinedHost has new capacity. Attempts to allocate any |
| 179 // pending pipeline-capable requests to the host. |
| 180 virtual void OnHttpPipelinedHostHasAdditionalCapacity( |
| 181 HttpPipelinedHost* host) = 0; |
| 182 |
177 // Static settings | 183 // Static settings |
178 static GURL ApplyHostMappingRules(const GURL& url, HostPortPair* endpoint); | 184 static GURL ApplyHostMappingRules(const GURL& url, HostPortPair* endpoint); |
179 | 185 |
180 // Turns spdy on or off. | 186 // Turns spdy on or off. |
181 static void set_spdy_enabled(bool value) { | 187 static void set_spdy_enabled(bool value) { |
182 spdy_enabled_ = value; | 188 spdy_enabled_ = value; |
183 if (value == false) | 189 if (value == false) |
184 set_next_protos(""); | 190 set_next_protos(""); |
185 } | 191 } |
186 static bool spdy_enabled() { return spdy_enabled_; } | 192 static bool spdy_enabled() { return spdy_enabled_; } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // errors. This is for testing. | 227 // errors. This is for testing. |
222 static void set_ignore_certificate_errors(bool value) { | 228 static void set_ignore_certificate_errors(bool value) { |
223 ignore_certificate_errors_ = value; | 229 ignore_certificate_errors_ = value; |
224 } | 230 } |
225 static bool ignore_certificate_errors() { | 231 static bool ignore_certificate_errors() { |
226 return ignore_certificate_errors_; | 232 return ignore_certificate_errors_; |
227 } | 233 } |
228 | 234 |
229 static void SetHostMappingRules(const std::string& rules); | 235 static void SetHostMappingRules(const std::string& rules); |
230 | 236 |
| 237 static void set_http_pipelining_enabled(bool value) { |
| 238 http_pipelining_enabled_ = value; |
| 239 } |
| 240 static bool http_pipelining_enabled() { return http_pipelining_enabled_; } |
| 241 |
231 protected: | 242 protected: |
232 HttpStreamFactory(); | 243 HttpStreamFactory(); |
233 | 244 |
234 private: | 245 private: |
235 static const HostMappingRules& host_mapping_rules(); | 246 static const HostMappingRules& host_mapping_rules(); |
236 | 247 |
237 static const HostMappingRules* host_mapping_rules_; | 248 static const HostMappingRules* host_mapping_rules_; |
238 static const std::string* next_protos_; | 249 static const std::string* next_protos_; |
239 static bool spdy_enabled_; | 250 static bool spdy_enabled_; |
240 static bool use_alternate_protocols_; | 251 static bool use_alternate_protocols_; |
241 static bool force_spdy_over_ssl_; | 252 static bool force_spdy_over_ssl_; |
242 static bool force_spdy_always_; | 253 static bool force_spdy_always_; |
243 static std::list<HostPortPair>* forced_spdy_exclusions_; | 254 static std::list<HostPortPair>* forced_spdy_exclusions_; |
244 static bool ignore_certificate_errors_; | 255 static bool ignore_certificate_errors_; |
| 256 static bool http_pipelining_enabled_; |
245 | 257 |
246 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 258 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
247 }; | 259 }; |
248 | 260 |
249 } // namespace net | 261 } // namespace net |
250 | 262 |
251 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 263 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
OLD | NEW |