Chromium Code Reviews| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 class SSLClientSocketPool; | 63 class SSLClientSocketPool; |
| 64 class SSLConfigService; | 64 class SSLConfigService; |
| 65 class TransportClientSocketPool; | 65 class TransportClientSocketPool; |
| 66 class TransportSecurityState; | 66 class TransportSecurityState; |
| 67 | 67 |
| 68 // This class holds session objects used by HttpNetworkTransaction objects. | 68 // This class holds session objects used by HttpNetworkTransaction objects. |
| 69 class NET_EXPORT HttpNetworkSession | 69 class NET_EXPORT HttpNetworkSession |
| 70 : NON_EXPORTED_BASE(public base::NonThreadSafe), | 70 : NON_EXPORTED_BASE(public base::NonThreadSafe), |
| 71 public base::MemoryCoordinatorClient { | 71 public base::MemoryCoordinatorClient { |
| 72 public: | 72 public: |
| 73 // Shared Dynamic Parameters - holds parameters which can change at run time. | |
| 74 // One instance of this struct is intended to be shared accross multiple | |
| 75 // HttpNetworkSessions (the default copy constructor of Params just copies the | |
| 76 // pointer to SharedParams). | |
| 77 struct NET_EXPORT DynamicSharedParams { | |
| 78 DynamicSharedParams(); | |
| 79 DynamicSharedParams(const DynamicSharedParams& other); | |
| 80 ~DynamicSharedParams(); | |
| 81 | |
| 82 // Enables QUIC for new streams (if QUIC is enabled). | |
| 83 // If DynamicSharedParams is missing, assume false. | |
| 84 bool enable_quic; | |
|
Ryan Hamilton
2016/12/20 15:38:12
nit: quic_enabled might be a better choice since i
pmarko
2016/12/20 18:00:37
I also thought so at first, but then I wanted to m
Ryan Hamilton
2016/12/21 21:23:58
Ah, fair enough. Let's remain consistent.
pmarko
2016/12/23 19:19:46
(obsolete - Params has been reverted)
| |
| 85 }; | |
| 86 | |
| 73 struct NET_EXPORT Params { | 87 struct NET_EXPORT Params { |
| 74 Params(); | 88 Params(); |
| 75 Params(const Params& other); | 89 Params(const Params& other); |
| 76 ~Params(); | 90 ~Params(); |
| 77 | 91 |
| 78 ClientSocketFactory* client_socket_factory; | 92 ClientSocketFactory* client_socket_factory; |
| 79 HostResolver* host_resolver; | 93 HostResolver* host_resolver; |
| 80 CertVerifier* cert_verifier; | 94 CertVerifier* cert_verifier; |
| 81 ChannelIDService* channel_id_service; | 95 ChannelIDService* channel_id_service; |
| 82 TransportSecurityState* transport_security_state; | 96 TransportSecurityState* transport_security_state; |
| 83 CTVerifier* cert_transparency_verifier; | 97 CTVerifier* cert_transparency_verifier; |
| 84 CTPolicyEnforcer* ct_policy_enforcer; | 98 CTPolicyEnforcer* ct_policy_enforcer; |
| 85 ProxyService* proxy_service; | 99 ProxyService* proxy_service; |
| 86 SSLConfigService* ssl_config_service; | 100 SSLConfigService* ssl_config_service; |
| 87 HttpAuthHandlerFactory* http_auth_handler_factory; | 101 HttpAuthHandlerFactory* http_auth_handler_factory; |
| 88 HttpServerProperties* http_server_properties; | 102 HttpServerProperties* http_server_properties; |
| 89 NetLog* net_log; | 103 NetLog* net_log; |
| 90 HostMappingRules* host_mapping_rules; | 104 HostMappingRules* host_mapping_rules; |
| 91 SocketPerformanceWatcherFactory* socket_performance_watcher_factory; | 105 SocketPerformanceWatcherFactory* socket_performance_watcher_factory; |
| 92 bool ignore_certificate_errors; | 106 bool ignore_certificate_errors; |
| 93 uint16_t testing_fixed_http_port; | 107 uint16_t testing_fixed_http_port; |
| 94 uint16_t testing_fixed_https_port; | 108 uint16_t testing_fixed_https_port; |
| 95 bool enable_tcp_fast_open_for_ssl; | 109 bool enable_tcp_fast_open_for_ssl; |
| 96 | 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 nullptr | |
|
Bence
2016/12/20 14:58:07
Please append period to last sentence.
Ryan Hamilton
2016/12/20 15:38:12
I'm ramping up on this CL, so sorry for the basic
pmarko
2016/12/20 18:00:37
Bence: Done.
Ryan: Good point! Basically, by intr
Ryan Hamilton
2016/12/21 21:23:58
Hm. I think you're saying that the dynamic params
pmarko
2016/12/23 19:19:46
See my reply in comments thread - you're right tha
| |
| 115 DynamicSharedParams* dynamic_shared_params; | |
|
Ryan Hamilton
2016/12/20 15:38:12
I'm surprised not to see any cronet code which set
pmarko
2016/12/20 18:00:37
Good point! Didn't think of cronet, but it should
Ryan Hamilton
2016/12/21 21:23:58
Ah, good point.
pmarko
2016/12/23 19:19:46
(obsolete - Params has been reverted)
| |
| 116 | |
| 97 // Use SPDY ping frames to test for connection health after idle. | 117 // Use SPDY ping frames to test for connection health after idle. |
| 98 bool enable_spdy_ping_based_connection_checking; | 118 bool enable_spdy_ping_based_connection_checking; |
| 99 bool enable_http2; | 119 bool enable_http2; |
| 100 size_t spdy_session_max_recv_window_size; | 120 size_t spdy_session_max_recv_window_size; |
| 101 size_t spdy_stream_max_recv_window_size; | 121 size_t spdy_stream_max_recv_window_size; |
| 102 // Source of time for SPDY connections. | 122 // Source of time for SPDY connections. |
| 103 SpdySessionPool::TimeFunc time_func; | 123 SpdySessionPool::TimeFunc time_func; |
| 104 // 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 |
| 105 // that of the origin. | 125 // that of the origin. |
| 106 bool enable_http2_alternative_service_with_different_host; | 126 bool enable_http2_alternative_service_with_different_host; |
| 107 // Whether to enable QUIC Alt-Svc entries with hostname different than that | 127 // Whether to enable QUIC Alt-Svc entries with hostname different than that |
| 108 // of the origin. | 128 // of the origin. |
| 109 bool enable_quic_alternative_service_with_different_host; | 129 bool enable_quic_alternative_service_with_different_host; |
| 110 | 130 |
| 111 // Enables QUIC support. | |
| 112 bool enable_quic; | |
| 113 // Disable QUIC if a connection times out with open streams. | 131 // Disable QUIC if a connection times out with open streams. |
| 114 bool disable_quic_on_timeout_with_open_streams; | 132 bool disable_quic_on_timeout_with_open_streams; |
| 115 // Disables QUIC's 0-RTT behavior. | 133 // Disables QUIC's 0-RTT behavior. |
| 116 bool quic_always_require_handshake_confirmation; | 134 bool quic_always_require_handshake_confirmation; |
| 117 // Disables QUIC connection pooling. | 135 // Disables QUIC connection pooling. |
| 118 bool quic_disable_connection_pooling; | 136 bool quic_disable_connection_pooling; |
| 119 // If not zero, the task to load QUIC server configs from the disk cache | 137 // If not zero, the task to load QUIC server configs from the disk cache |
| 120 // will timeout after this value multiplied by the smoothed RTT for the | 138 // will timeout after this value multiplied by the smoothed RTT for the |
| 121 // server. | 139 // server. |
| 122 float quic_load_server_info_timeout_srtt_multiplier; | 140 float quic_load_server_info_timeout_srtt_multiplier; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 // If true, configure QUIC sockets to not fragment packets. | 205 // If true, configure QUIC sockets to not fragment packets. |
| 188 bool quic_do_not_fragment; | 206 bool quic_do_not_fragment; |
| 189 | 207 |
| 190 ProxyDelegate* proxy_delegate; | 208 ProxyDelegate* proxy_delegate; |
| 191 // Enable support for Token Binding. | 209 // Enable support for Token Binding. |
| 192 bool enable_token_binding; | 210 bool enable_token_binding; |
| 193 | 211 |
| 194 // Enable HTTP/0.9 for HTTP/HTTPS on ports other than the default one for | 212 // Enable HTTP/0.9 for HTTP/HTTPS on ports other than the default one for |
| 195 // each protocol. | 213 // each protocol. |
| 196 bool http_09_on_non_default_ports_enabled; | 214 bool http_09_on_non_default_ports_enabled; |
| 215 | |
| 216 // Evaluates if QUIC is enabled for new streams | |
|
Bence
2016/12/20 14:58:07
Please append period to this sentence.
pmarko
2016/12/20 18:00:37
Done.
| |
| 217 bool enable_quic() const; | |
|
Bence
2016/12/20 14:58:07
Please move this up to right after the destructor:
Ryan Hamilton
2016/12/20 15:38:12
The style guide prohibits methods on structs. Perh
pmarko
2016/12/20 18:00:37
Bence: Probably obselete now :)
Ryan: Ah, I didn'
| |
| 197 }; | 218 }; |
| 198 | 219 |
| 199 enum SocketPoolType { | 220 enum SocketPoolType { |
| 200 NORMAL_SOCKET_POOL, | 221 NORMAL_SOCKET_POOL, |
| 201 WEBSOCKET_SOCKET_POOL, | 222 WEBSOCKET_SOCKET_POOL, |
| 202 NUM_SOCKET_POOL_TYPES | 223 NUM_SOCKET_POOL_TYPES |
| 203 }; | 224 }; |
| 204 | 225 |
| 205 explicit HttpNetworkSession(const Params& params); | 226 explicit HttpNetworkSession(const Params& params); |
| 206 ~HttpNetworkSession() override; | 227 ~HttpNetworkSession() override; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 NextProtoVector next_protos_; | 343 NextProtoVector next_protos_; |
| 323 | 344 |
| 324 Params params_; | 345 Params params_; |
| 325 | 346 |
| 326 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 347 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 327 }; | 348 }; |
| 328 | 349 |
| 329 } // namespace net | 350 } // namespace net |
| 330 | 351 |
| 331 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ | 352 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ |
| OLD | NEW |