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" | |
Ryan Hamilton
2012/03/02 16:46:53
Is this import needed?
ramant (doing other things)
2012/03/02 18:40:41
It is needed because of NUM_ALTERNATE_PROTOCOLS.
| |
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 next protocol negotiation value used during the SSL handshake. |
Ryan Hamilton
2012/03/02 16:46:53
Please update comment. I believe this vector is us
ramant (doing other things)
2012/03/02 18:40:41
Done.
| |
233 static void set_next_protos(const std::vector<std::string>& value) { | 234 static void SetNextProtos(const std::vector<std::string>& value); |
234 if (!next_protos_) | |
235 next_protos_ = new std::vector<std::string>; | |
236 *next_protos_ = value; | |
237 } | |
238 static bool has_next_protos() { return next_protos_ != NULL; } | 235 static bool has_next_protos() { return next_protos_ != NULL; } |
239 static const std::vector<std::string>& next_protos() { | 236 static const std::vector<std::string>& next_protos() { |
240 return *next_protos_; | 237 return *next_protos_; |
241 } | 238 } |
242 | 239 |
243 // Sets the HttpStreamFactoryImpl into a mode where it can ignore certificate | 240 // Sets the HttpStreamFactoryImpl into a mode where it can ignore certificate |
244 // errors. This is for testing. | 241 // errors. This is for testing. |
245 static void set_ignore_certificate_errors(bool value) { | 242 static void set_ignore_certificate_errors(bool value) { |
246 ignore_certificate_errors_ = value; | 243 ignore_certificate_errors_ = value; |
247 } | 244 } |
(...skipping 19 matching lines...) Expand all Loading... | |
267 static uint16 testing_fixed_https_port() { return testing_fixed_https_port_; } | 264 static uint16 testing_fixed_https_port() { return testing_fixed_https_port_; } |
268 | 265 |
269 protected: | 266 protected: |
270 HttpStreamFactory(); | 267 HttpStreamFactory(); |
271 | 268 |
272 private: | 269 private: |
273 static const HostMappingRules& host_mapping_rules(); | 270 static const HostMappingRules& host_mapping_rules(); |
274 | 271 |
275 static const HostMappingRules* host_mapping_rules_; | 272 static const HostMappingRules* host_mapping_rules_; |
276 static std::vector<std::string>* next_protos_; | 273 static std::vector<std::string>* next_protos_; |
274 static bool supported_protocols_[NUM_ALTERNATE_PROTOCOLS]; | |
Ryan Hamilton
2012/03/02 16:46:53
nit: I think I would call this enabled_protocols_,
ramant (doing other things)
2012/03/02 18:40:41
Done.
| |
277 static bool spdy_enabled_; | 275 static bool spdy_enabled_; |
278 static bool use_alternate_protocols_; | 276 static bool use_alternate_protocols_; |
279 static bool force_spdy_over_ssl_; | 277 static bool force_spdy_over_ssl_; |
280 static bool force_spdy_always_; | 278 static bool force_spdy_always_; |
281 static std::list<HostPortPair>* forced_spdy_exclusions_; | 279 static std::list<HostPortPair>* forced_spdy_exclusions_; |
282 static bool ignore_certificate_errors_; | 280 static bool ignore_certificate_errors_; |
283 static bool http_pipelining_enabled_; | 281 static bool http_pipelining_enabled_; |
284 static uint16 testing_fixed_http_port_; | 282 static uint16 testing_fixed_http_port_; |
285 static uint16 testing_fixed_https_port_; | 283 static uint16 testing_fixed_https_port_; |
286 | 284 |
287 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 285 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
288 }; | 286 }; |
289 | 287 |
290 } // namespace net | 288 } // namespace net |
291 | 289 |
292 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 290 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
OLD | NEW |