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_NETWORK_SESSION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_SESSION_H_ |
6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 class SSLClientSocketPool; | 61 class SSLClientSocketPool; |
62 class SSLConfigService; | 62 class SSLConfigService; |
63 class TransportClientSocketPool; | 63 class TransportClientSocketPool; |
64 class TransportSecurityState; | 64 class TransportSecurityState; |
65 | 65 |
66 // This class holds session objects used by HttpNetworkTransaction objects. | 66 // This class holds session objects used by HttpNetworkTransaction objects. |
67 class NET_EXPORT HttpNetworkSession | 67 class NET_EXPORT HttpNetworkSession |
68 : NON_EXPORTED_BASE(public base::NonThreadSafe), | 68 : NON_EXPORTED_BASE(public base::NonThreadSafe), |
69 public base::MemoryCoordinatorClient { | 69 public base::MemoryCoordinatorClient { |
70 public: | 70 public: |
71 // Shared Dynamic Parameters - holds parameters which can change at run time. | |
72 // One e instance of this struct is intended to be shared accross multiple | |
mmenke
2016/12/13 18:48:54
"One e" -> "One"
pmarko
2016/12/19 21:25:11
Done.
| |
73 // HttpNetworkSessions (the default copy constructor of Params just copies the | |
74 // pointer to SharedParams). | |
75 struct NET_EXPORT DynamicSharedParams { | |
76 DynamicSharedParams(); | |
77 DynamicSharedParams(const DynamicSharedParams& other); | |
78 ~DynamicSharedParams(); | |
79 | |
80 // Enables QUIC for new streams (if QUIC is enabled). | |
81 // If DynamicSharedParams is missing, assume true. | |
82 // This is intended for disabling QUIC for new streams by user policy | |
83 // after the net stack has been initialized. | |
84 bool enable_quic_for_new_streams; | |
85 }; | |
86 | |
71 struct NET_EXPORT Params { | 87 struct NET_EXPORT Params { |
72 Params(); | 88 Params(); |
73 Params(const Params& other); | 89 Params(const Params& other); |
74 ~Params(); | 90 ~Params(); |
75 | 91 |
76 ClientSocketFactory* client_socket_factory; | 92 ClientSocketFactory* client_socket_factory; |
77 HostResolver* host_resolver; | 93 HostResolver* host_resolver; |
78 CertVerifier* cert_verifier; | 94 CertVerifier* cert_verifier; |
79 ChannelIDService* channel_id_service; | 95 ChannelIDService* channel_id_service; |
80 TransportSecurityState* transport_security_state; | 96 TransportSecurityState* transport_security_state; |
81 CTVerifier* cert_transparency_verifier; | 97 CTVerifier* cert_transparency_verifier; |
82 CTPolicyEnforcer* ct_policy_enforcer; | 98 CTPolicyEnforcer* ct_policy_enforcer; |
83 ProxyService* proxy_service; | 99 ProxyService* proxy_service; |
84 SSLConfigService* ssl_config_service; | 100 SSLConfigService* ssl_config_service; |
85 HttpAuthHandlerFactory* http_auth_handler_factory; | 101 HttpAuthHandlerFactory* http_auth_handler_factory; |
86 HttpServerProperties* http_server_properties; | 102 HttpServerProperties* http_server_properties; |
87 NetLog* net_log; | 103 NetLog* net_log; |
88 HostMappingRules* host_mapping_rules; | 104 HostMappingRules* host_mapping_rules; |
89 SocketPerformanceWatcherFactory* socket_performance_watcher_factory; | 105 SocketPerformanceWatcherFactory* socket_performance_watcher_factory; |
90 bool ignore_certificate_errors; | 106 bool ignore_certificate_errors; |
91 uint16_t testing_fixed_http_port; | 107 uint16_t testing_fixed_http_port; |
92 uint16_t testing_fixed_https_port; | 108 uint16_t testing_fixed_https_port; |
93 bool enable_tcp_fast_open_for_ssl; | 109 bool enable_tcp_fast_open_for_ssl; |
94 | 110 |
111 // Holds parameters which can change after initialization | |
112 // and can be shared accross multiple HttpNetworkSessions. | |
113 // By default, the pointer is inherited on copy. | |
114 // May be NULL. | |
115 DynamicSharedParams* dynamic_shared_params; | |
116 | |
95 // Use SPDY ping frames to test for connection health after idle. | 117 // Use SPDY ping frames to test for connection health after idle. |
96 bool enable_spdy_ping_based_connection_checking; | 118 bool enable_spdy_ping_based_connection_checking; |
97 bool enable_http2; | 119 bool enable_http2; |
98 size_t spdy_session_max_recv_window_size; | 120 size_t spdy_session_max_recv_window_size; |
99 size_t spdy_stream_max_recv_window_size; | 121 size_t spdy_stream_max_recv_window_size; |
100 // Source of time for SPDY connections. | 122 // Source of time for SPDY connections. |
101 SpdySessionPool::TimeFunc time_func; | 123 SpdySessionPool::TimeFunc time_func; |
102 // Whether to enable HTTP/2 Alt-Svc entries with hostname different than | 124 // Whether to enable HTTP/2 Alt-Svc entries with hostname different than |
103 // that of the origin. | 125 // that of the origin. |
104 bool enable_http2_alternative_service_with_different_host; | 126 bool enable_http2_alternative_service_with_different_host; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 // If true, configure QUIC sockets to not fragment packets. | 210 // If true, configure QUIC sockets to not fragment packets. |
189 bool quic_do_not_fragment; | 211 bool quic_do_not_fragment; |
190 | 212 |
191 ProxyDelegate* proxy_delegate; | 213 ProxyDelegate* proxy_delegate; |
192 // Enable support for Token Binding. | 214 // Enable support for Token Binding. |
193 bool enable_token_binding; | 215 bool enable_token_binding; |
194 | 216 |
195 // Enable HTTP/0.9 for HTTP/HTTPS on ports other than the default one for | 217 // Enable HTTP/0.9 for HTTP/HTTPS on ports other than the default one for |
196 // each protocol. | 218 // each protocol. |
197 bool http_09_on_non_default_ports_enabled; | 219 bool http_09_on_non_default_ports_enabled; |
220 | |
221 // Evaluates if QUIC is enabled for new streams | |
222 // This takes into account the general quic_enabled Params member as well | |
223 // as shared_params, if shared_params was set. | |
224 bool enable_quic_for_new_streams() const; | |
198 }; | 225 }; |
199 | 226 |
200 enum SocketPoolType { | 227 enum SocketPoolType { |
201 NORMAL_SOCKET_POOL, | 228 NORMAL_SOCKET_POOL, |
202 WEBSOCKET_SOCKET_POOL, | 229 WEBSOCKET_SOCKET_POOL, |
203 NUM_SOCKET_POOL_TYPES | 230 NUM_SOCKET_POOL_TYPES |
204 }; | 231 }; |
205 | 232 |
206 explicit HttpNetworkSession(const Params& params); | 233 explicit HttpNetworkSession(const Params& params); |
207 ~HttpNetworkSession() override; | 234 ~HttpNetworkSession() override; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 NextProtoVector next_protos_; | 342 NextProtoVector next_protos_; |
316 | 343 |
317 Params params_; | 344 Params params_; |
318 | 345 |
319 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 346 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
320 }; | 347 }; |
321 | 348 |
322 } // namespace net | 349 } // namespace net |
323 | 350 |
324 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ | 351 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ |
OLD | NEW |