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 // This class is useful for building a simple URLRequestContext. Most creators | 5 // This class is useful for building a simple URLRequestContext. Most creators |
6 // of new URLRequestContexts should use this helper class to construct it. Call | 6 // of new URLRequestContexts should use this helper class to construct it. Call |
7 // any configuration params, and when done, invoke Build() to construct the | 7 // any configuration params, and when done, invoke Build() to construct the |
8 // URLRequestContext. This URLRequestContext will own all its own storage. | 8 // URLRequestContext. This URLRequestContext will own all its own storage. |
9 // | 9 // |
10 // URLRequestContextBuilder and its associated params classes are initially | 10 // URLRequestContextBuilder and its associated params classes are initially |
11 // populated with "sane" default values. Read through the comments to figure out | 11 // populated with "sane" default values. Read through the comments to figure out |
12 // what these are. | 12 // what these are. |
13 | 13 |
14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
16 | 16 |
17 #include <stdint.h> | 17 #include <stdint.h> |
18 | 18 |
19 #include <map> | 19 #include <map> |
20 #include <memory> | 20 #include <memory> |
| 21 #include <set> |
21 #include <string> | 22 #include <string> |
22 #include <unordered_map> | 23 #include <unordered_map> |
23 #include <utility> | 24 #include <utility> |
24 #include <vector> | 25 #include <vector> |
25 | 26 |
26 #include "base/files/file_path.h" | 27 #include "base/files/file_path.h" |
27 #include "base/macros.h" | 28 #include "base/macros.h" |
28 #include "base/memory/ref_counted.h" | 29 #include "base/memory/ref_counted.h" |
29 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 31 #include "net/base/host_port_pair.h" |
30 #include "net/base/net_export.h" | 32 #include "net/base/net_export.h" |
31 #include "net/base/network_delegate.h" | 33 #include "net/base/network_delegate.h" |
32 #include "net/base/proxy_delegate.h" | 34 #include "net/base/proxy_delegate.h" |
33 #include "net/dns/host_resolver.h" | 35 #include "net/dns/host_resolver.h" |
34 #include "net/http/http_network_session.h" | 36 #include "net/http/http_network_session.h" |
35 #include "net/net_features.h" | 37 #include "net/net_features.h" |
36 #include "net/proxy/proxy_config_service.h" | 38 #include "net/proxy/proxy_config_service.h" |
37 #include "net/proxy/proxy_service.h" | 39 #include "net/proxy/proxy_service.h" |
38 #include "net/quic/core/quic_packets.h" | 40 #include "net/quic/core/quic_packets.h" |
| 41 #include "net/quic/core/quic_versions.h" |
39 #include "net/socket/next_proto.h" | 42 #include "net/socket/next_proto.h" |
40 #include "net/url_request/url_request_job_factory.h" | 43 #include "net/url_request/url_request_job_factory.h" |
41 | 44 |
42 namespace base { | 45 namespace base { |
43 class SingleThreadTaskRunner; | 46 class SingleThreadTaskRunner; |
44 } | 47 } |
45 | 48 |
46 namespace net { | 49 namespace net { |
47 | 50 |
48 class CertVerifier; | 51 class CertVerifier; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 int max_size; | 84 int max_size; |
82 | 85 |
83 // The cache path (when type is DISK). | 86 // The cache path (when type is DISK). |
84 base::FilePath path; | 87 base::FilePath path; |
85 }; | 88 }; |
86 | 89 |
87 struct NET_EXPORT HttpNetworkSessionParams { | 90 struct NET_EXPORT HttpNetworkSessionParams { |
88 HttpNetworkSessionParams(); | 91 HttpNetworkSessionParams(); |
89 ~HttpNetworkSessionParams(); | 92 ~HttpNetworkSessionParams(); |
90 | 93 |
91 // Configutes |params| to match the settings in |this|. | 94 // Configures |params| to match the settings in |this|. |
92 // TODO(mmenke): Temporary utility function. Once everything is using a | 95 // TODO(mmenke): Temporary utility function. Once everything is using a |
93 // URLRequestContextBuilder, can make this no longer publicly accessible. | 96 // URLRequestContextBuilder, can make this no longer publicly accessible. |
94 void ConfigureSessionParams(HttpNetworkSession::Params* params) const; | 97 void ConfigureSessionParams(HttpNetworkSession::Params* params) const; |
95 | 98 |
96 // These fields mirror those in HttpNetworkSession::Params; | 99 // These fields mirror those in HttpNetworkSession::Params; |
97 HostMappingRules host_mapping_rules; | 100 HostMappingRules host_mapping_rules; |
98 bool ignore_certificate_errors; | 101 bool ignore_certificate_errors; |
99 uint16_t testing_fixed_http_port; | 102 uint16_t testing_fixed_http_port; |
100 uint16_t testing_fixed_https_port; | 103 uint16_t testing_fixed_https_port; |
| 104 int enable_tcp_fast_open_for_ssl; |
| 105 bool enable_user_alternate_protocol_ports; |
| 106 |
101 bool enable_http2; | 107 bool enable_http2; |
| 108 |
102 bool enable_quic; | 109 bool enable_quic; |
| 110 QuicVersionVector quic_supported_versions; |
| 111 size_t quic_max_packet_length; |
103 std::string quic_user_agent_id; | 112 std::string quic_user_agent_id; |
104 int quic_max_server_configs_stored_in_properties; | 113 int quic_max_server_configs_stored_in_properties; |
105 QuicTagVector quic_connection_options; | 114 QuicTagVector quic_connection_options; |
| 115 std::set<HostPortPair> origins_to_force_quic_on; |
106 bool quic_close_sessions_on_ip_change; | 116 bool quic_close_sessions_on_ip_change; |
107 int quic_idle_connection_timeout_seconds; | 117 int quic_idle_connection_timeout_seconds; |
108 bool quic_migrate_sessions_on_network_change; | 118 bool quic_migrate_sessions_on_network_change; |
109 bool quic_migrate_sessions_early; | 119 bool quic_migrate_sessions_early; |
110 bool quic_disable_bidirectional_streams; | 120 bool quic_disable_bidirectional_streams; |
111 bool quic_race_cert_verification; | 121 bool quic_race_cert_verification; |
| 122 |
| 123 bool enable_token_binding; |
| 124 |
| 125 bool http_09_on_non_default_ports_enabled; |
112 }; | 126 }; |
113 | 127 |
114 URLRequestContextBuilder(); | 128 URLRequestContextBuilder(); |
115 virtual ~URLRequestContextBuilder(); | 129 virtual ~URLRequestContextBuilder(); |
116 | 130 |
117 // Sets a name for this URLRequestContext. Currently the name is used in | 131 // Sets a name for this URLRequestContext. Currently the name is used in |
118 // MemoryDumpProvier to annotate memory usage. The name does not need to be | 132 // MemoryDumpProvier to annotate memory usage. The name does not need to be |
119 // unique. | 133 // unique. |
120 void set_name(const char* name) { name_ = name; } | 134 void set_name(const char* name) { name_ = name; } |
121 | 135 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 // Not owned by the context builder. Once it is set to a non-null value, it | 406 // Not owned by the context builder. Once it is set to a non-null value, it |
393 // is guaranteed to be non-null during the lifetime of |this|. | 407 // is guaranteed to be non-null during the lifetime of |this|. |
394 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; | 408 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; |
395 | 409 |
396 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 410 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
397 }; | 411 }; |
398 | 412 |
399 } // namespace net | 413 } // namespace net |
400 | 414 |
401 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 415 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
OLD | NEW |