Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: net/http/http_network_session.h

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: Fixed accesses to iothread globals from UI thread Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 Parameters - one instance of this struct is intended to be shared
72 // accross multiple HttpNetworkSessions (the default copy constructor of
73 // Params just copies the pointer to SharedParams).
74 struct NET_EXPORT SharedParams {
75 SharedParams();
76 SharedParams(const SharedParams& other);
77 ~SharedParams();
78
79 // Enables QUIC for new streams (if QUIC is enabled).
80 // If SharedParams is missing, assume true.
81 // This is intended for disabling QUIC for new streams by user policy
82 // after the net stack has been initialized.
83 bool enable_quic_for_new_streams;
84 };
85
71 struct NET_EXPORT Params { 86 struct NET_EXPORT Params {
72 Params(); 87 Params();
73 Params(const Params& other); 88 Params(const Params& other);
74 ~Params(); 89 ~Params();
75 90
76 ClientSocketFactory* client_socket_factory; 91 ClientSocketFactory* client_socket_factory;
77 HostResolver* host_resolver; 92 HostResolver* host_resolver;
78 CertVerifier* cert_verifier; 93 CertVerifier* cert_verifier;
79 ChannelIDService* channel_id_service; 94 ChannelIDService* channel_id_service;
80 TransportSecurityState* transport_security_state; 95 TransportSecurityState* transport_security_state;
81 CTVerifier* cert_transparency_verifier; 96 CTVerifier* cert_transparency_verifier;
82 CTPolicyEnforcer* ct_policy_enforcer; 97 CTPolicyEnforcer* ct_policy_enforcer;
83 ProxyService* proxy_service; 98 ProxyService* proxy_service;
84 SSLConfigService* ssl_config_service; 99 SSLConfigService* ssl_config_service;
85 HttpAuthHandlerFactory* http_auth_handler_factory; 100 HttpAuthHandlerFactory* http_auth_handler_factory;
86 HttpServerProperties* http_server_properties; 101 HttpServerProperties* http_server_properties;
87 NetLog* net_log; 102 NetLog* net_log;
88 HostMappingRules* host_mapping_rules; 103 HostMappingRules* host_mapping_rules;
89 SocketPerformanceWatcherFactory* socket_performance_watcher_factory; 104 SocketPerformanceWatcherFactory* socket_performance_watcher_factory;
90 bool ignore_certificate_errors; 105 bool ignore_certificate_errors;
91 uint16_t testing_fixed_http_port; 106 uint16_t testing_fixed_http_port;
92 uint16_t testing_fixed_https_port; 107 uint16_t testing_fixed_https_port;
93 bool enable_tcp_fast_open_for_ssl; 108 bool enable_tcp_fast_open_for_ssl;
94 109
110 // Holds parameters which can change after initialization
111 // and can be shared accross multiple HttpNetworkSessions.
112 // By default, the pointer is inherited on copy.
113 // May be NULL.
114 SharedParams* shared_dynamic_params;
115
95 // Use SPDY ping frames to test for connection health after idle. 116 // Use SPDY ping frames to test for connection health after idle.
96 bool enable_spdy_ping_based_connection_checking; 117 bool enable_spdy_ping_based_connection_checking;
97 bool enable_http2; 118 bool enable_http2;
98 size_t spdy_session_max_recv_window_size; 119 size_t spdy_session_max_recv_window_size;
99 size_t spdy_stream_max_recv_window_size; 120 size_t spdy_stream_max_recv_window_size;
100 // Source of time for SPDY connections. 121 // Source of time for SPDY connections.
101 SpdySessionPool::TimeFunc time_func; 122 SpdySessionPool::TimeFunc time_func;
102 // Whether to enable HTTP/2 Alt-Svc entries with hostname different than 123 // Whether to enable HTTP/2 Alt-Svc entries with hostname different than
103 // that of the origin. 124 // that of the origin.
104 bool enable_http2_alternative_service_with_different_host; 125 bool enable_http2_alternative_service_with_different_host;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // If true, configure QUIC sockets to not fragment packets. 209 // If true, configure QUIC sockets to not fragment packets.
189 bool quic_do_not_fragment; 210 bool quic_do_not_fragment;
190 211
191 ProxyDelegate* proxy_delegate; 212 ProxyDelegate* proxy_delegate;
192 // Enable support for Token Binding. 213 // Enable support for Token Binding.
193 bool enable_token_binding; 214 bool enable_token_binding;
194 215
195 // Enable HTTP/0.9 for HTTP/HTTPS on ports other than the default one for 216 // Enable HTTP/0.9 for HTTP/HTTPS on ports other than the default one for
196 // each protocol. 217 // each protocol.
197 bool http_09_on_non_default_ports_enabled; 218 bool http_09_on_non_default_ports_enabled;
219
220 // Evaluates if QUIC is enabled for new streams
221 bool is_enable_quic_for_new_streams() const;
Bence 2016/12/02 18:53:26 Rename to |enable_quic_for_new_streams| in accorda
pmarko 2016/12/08 17:02:00 Done.
198 }; 222 };
199 223
200 enum SocketPoolType { 224 enum SocketPoolType {
201 NORMAL_SOCKET_POOL, 225 NORMAL_SOCKET_POOL,
202 WEBSOCKET_SOCKET_POOL, 226 WEBSOCKET_SOCKET_POOL,
203 NUM_SOCKET_POOL_TYPES 227 NUM_SOCKET_POOL_TYPES
204 }; 228 };
205 229
206 explicit HttpNetworkSession(const Params& params); 230 explicit HttpNetworkSession(const Params& params);
207 ~HttpNetworkSession() override; 231 ~HttpNetworkSession() override;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 NextProtoVector next_protos_; 339 NextProtoVector next_protos_;
316 340
317 Params params_; 341 Params params_;
318 342
319 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; 343 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
320 }; 344 };
321 345
322 } // namespace net 346 } // namespace net
323 347
324 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ 348 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698