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