| 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 #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 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 #include "net/base/load_states.h" | 16 #include "net/base/load_states.h" |
| 17 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
| 18 #include "net/http/http_server_properties.h" |
| 18 #include "net/socket/ssl_client_socket.h" | 19 #include "net/socket/ssl_client_socket.h" |
| 19 | 20 |
| 20 class GURL; | 21 class GURL; |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class Value; | 24 class Value; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 | 28 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 static void set_force_spdy_always(bool value) { | 223 static void set_force_spdy_always(bool value) { |
| 223 force_spdy_always_ = value; | 224 force_spdy_always_ = value; |
| 224 } | 225 } |
| 225 static bool force_spdy_always() { return force_spdy_always_; } | 226 static bool force_spdy_always() { return force_spdy_always_; } |
| 226 | 227 |
| 227 // Add a URL to exclude from forced SPDY. | 228 // Add a URL to exclude from forced SPDY. |
| 228 static void add_forced_spdy_exclusion(const std::string& value); | 229 static void add_forced_spdy_exclusion(const std::string& value); |
| 229 // Check if a HostPortPair is excluded from using spdy. | 230 // Check if a HostPortPair is excluded from using spdy. |
| 230 static bool HasSpdyExclusion(const HostPortPair& endpoint); | 231 static bool HasSpdyExclusion(const HostPortPair& endpoint); |
| 231 | 232 |
| 232 // Sets the next protocol negotiation value used during the SSL handshake. | 233 // Sets the protocols supported by NPN (next protocol negotiation) during the |
| 233 static void set_next_protos(const std::vector<std::string>& value) { | 234 // SSL handshake as well as by HTTP Alternate-Protocol. |
| 234 if (!next_protos_) | 235 static void SetNextProtos(const std::vector<std::string>& value); |
| 235 next_protos_ = new std::vector<std::string>; | |
| 236 *next_protos_ = value; | |
| 237 } | |
| 238 static bool has_next_protos() { return next_protos_ != NULL; } | 236 static bool has_next_protos() { return next_protos_ != NULL; } |
| 239 static const std::vector<std::string>& next_protos() { | 237 static const std::vector<std::string>& next_protos() { |
| 240 return *next_protos_; | 238 return *next_protos_; |
| 241 } | 239 } |
| 242 | 240 |
| 243 // Sets the HttpStreamFactoryImpl into a mode where it can ignore certificate | 241 // Sets the HttpStreamFactoryImpl into a mode where it can ignore certificate |
| 244 // errors. This is for testing. | 242 // errors. This is for testing. |
| 245 static void set_ignore_certificate_errors(bool value) { | 243 static void set_ignore_certificate_errors(bool value) { |
| 246 ignore_certificate_errors_ = value; | 244 ignore_certificate_errors_ = value; |
| 247 } | 245 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 267 static uint16 testing_fixed_https_port() { return testing_fixed_https_port_; } | 265 static uint16 testing_fixed_https_port() { return testing_fixed_https_port_; } |
| 268 | 266 |
| 269 protected: | 267 protected: |
| 270 HttpStreamFactory(); | 268 HttpStreamFactory(); |
| 271 | 269 |
| 272 private: | 270 private: |
| 273 static const HostMappingRules& host_mapping_rules(); | 271 static const HostMappingRules& host_mapping_rules(); |
| 274 | 272 |
| 275 static const HostMappingRules* host_mapping_rules_; | 273 static const HostMappingRules* host_mapping_rules_; |
| 276 static std::vector<std::string>* next_protos_; | 274 static std::vector<std::string>* next_protos_; |
| 275 static bool enabled_protocols_[NUM_ALTERNATE_PROTOCOLS]; |
| 277 static bool spdy_enabled_; | 276 static bool spdy_enabled_; |
| 278 static bool use_alternate_protocols_; | 277 static bool use_alternate_protocols_; |
| 279 static bool force_spdy_over_ssl_; | 278 static bool force_spdy_over_ssl_; |
| 280 static bool force_spdy_always_; | 279 static bool force_spdy_always_; |
| 281 static std::list<HostPortPair>* forced_spdy_exclusions_; | 280 static std::list<HostPortPair>* forced_spdy_exclusions_; |
| 282 static bool ignore_certificate_errors_; | 281 static bool ignore_certificate_errors_; |
| 283 static bool http_pipelining_enabled_; | 282 static bool http_pipelining_enabled_; |
| 284 static uint16 testing_fixed_http_port_; | 283 static uint16 testing_fixed_http_port_; |
| 285 static uint16 testing_fixed_https_port_; | 284 static uint16 testing_fixed_https_port_; |
| 286 | 285 |
| 287 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 286 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
| 288 }; | 287 }; |
| 289 | 288 |
| 290 } // namespace net | 289 } // namespace net |
| 291 | 290 |
| 292 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 291 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
| OLD | NEW |