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 #include "net/http/http_network_session.h" | 5 #include "net/http/http_network_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 net_log(NULL), | 86 net_log(NULL), |
87 host_mapping_rules(NULL), | 87 host_mapping_rules(NULL), |
88 socket_performance_watcher_factory(NULL), | 88 socket_performance_watcher_factory(NULL), |
89 ignore_certificate_errors(false), | 89 ignore_certificate_errors(false), |
90 testing_fixed_http_port(0), | 90 testing_fixed_http_port(0), |
91 testing_fixed_https_port(0), | 91 testing_fixed_https_port(0), |
92 enable_tcp_fast_open_for_ssl(false), | 92 enable_tcp_fast_open_for_ssl(false), |
93 enable_spdy_ping_based_connection_checking(true), | 93 enable_spdy_ping_based_connection_checking(true), |
94 enable_http2(true), | 94 enable_http2(true), |
95 spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), | 95 spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), |
96 spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), | |
97 time_func(&base::TimeTicks::Now), | 96 time_func(&base::TimeTicks::Now), |
98 enable_http2_alternative_service_with_different_host(false), | 97 enable_http2_alternative_service_with_different_host(false), |
99 enable_quic_alternative_service_with_different_host(true), | 98 enable_quic_alternative_service_with_different_host(true), |
100 enable_quic(false), | 99 enable_quic(false), |
101 disable_quic_on_timeout_with_open_streams(false), | 100 disable_quic_on_timeout_with_open_streams(false), |
102 quic_always_require_handshake_confirmation(false), | 101 quic_always_require_handshake_confirmation(false), |
103 quic_disable_connection_pooling(false), | 102 quic_disable_connection_pooling(false), |
104 quic_load_server_info_timeout_srtt_multiplier(0.25f), | 103 quic_load_server_info_timeout_srtt_multiplier(0.25f), |
105 quic_enable_connection_racing(false), | 104 quic_enable_connection_racing(false), |
106 quic_enable_non_blocking_io(false), | 105 quic_enable_non_blocking_io(false), |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 params.quic_race_cert_verification, | 189 params.quic_race_cert_verification, |
191 params.quic_do_not_fragment, | 190 params.quic_do_not_fragment, |
192 params.quic_connection_options, | 191 params.quic_connection_options, |
193 params.enable_token_binding), | 192 params.enable_token_binding), |
194 spdy_session_pool_(params.host_resolver, | 193 spdy_session_pool_(params.host_resolver, |
195 params.ssl_config_service, | 194 params.ssl_config_service, |
196 params.http_server_properties, | 195 params.http_server_properties, |
197 params.transport_security_state, | 196 params.transport_security_state, |
198 params.enable_spdy_ping_based_connection_checking, | 197 params.enable_spdy_ping_based_connection_checking, |
199 params.spdy_session_max_recv_window_size, | 198 params.spdy_session_max_recv_window_size, |
200 params.spdy_stream_max_recv_window_size, | 199 AddDefaultHttp2Settings(params.http2_settings), |
201 params.time_func, | 200 params.time_func, |
202 params.proxy_delegate), | 201 params.proxy_delegate), |
203 http_stream_factory_(new HttpStreamFactoryImpl(this, false)), | 202 http_stream_factory_(new HttpStreamFactoryImpl(this, false)), |
204 http_stream_factory_for_websocket_(new HttpStreamFactoryImpl(this, true)), | 203 http_stream_factory_for_websocket_(new HttpStreamFactoryImpl(this, true)), |
205 network_stream_throttler_(new NetworkThrottleManagerImpl()), | 204 network_stream_throttler_(new NetworkThrottleManagerImpl()), |
206 params_(params) { | 205 params_(params) { |
207 DCHECK(proxy_service_); | 206 DCHECK(proxy_service_); |
208 DCHECK(ssl_config_service_.get()); | 207 DCHECK(ssl_config_service_.get()); |
209 CHECK(http_server_properties_); | 208 CHECK(http_server_properties_); |
210 | 209 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
452 CloseIdleConnections(); | 451 CloseIdleConnections(); |
453 break; | 452 break; |
454 case base::MemoryState::SUSPENDED: | 453 case base::MemoryState::SUSPENDED: |
455 // Note: Not supported at present. Fall through. | 454 // Note: Not supported at present. Fall through. |
456 case base::MemoryState::UNKNOWN: | 455 case base::MemoryState::UNKNOWN: |
457 NOTREACHED(); | 456 NOTREACHED(); |
458 break; | 457 break; |
459 } | 458 } |
460 } | 459 } |
461 | 460 |
461 SettingsMap HttpNetworkSession::AddDefaultHttp2Settings( | |
462 SettingsMap http2_settings) { | |
463 // Set default values only if |http2_settings| does not have | |
464 // a value set for given setting. | |
465 SettingsMap::iterator it = http2_settings.find(SETTINGS_HEADER_TABLE_SIZE); | |
466 if (it == http2_settings.end()) | |
467 http2_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize; | |
468 | |
469 it = http2_settings.find(SETTINGS_MAX_CONCURRENT_STREAMS); | |
470 if (it == http2_settings.end()) | |
471 http2_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = | |
472 kSpdyMaxConcurrentPushedStreams; | |
473 | |
474 it = http2_settings.find(SETTINGS_INITIAL_WINDOW_SIZE); | |
475 if (it == http2_settings.end()) | |
476 http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = kSpdyStreamMaxRecvWindowSize; | |
477 | |
478 return http2_settings; | |
479 } | |
Ryan Hamilton
2016/12/27 22:32:43
nit: I think this method can be a free function in
Bence
2016/12/28 00:53:24
Done.
| |
480 | |
462 } // namespace net | 481 } // namespace net |
OLD | NEW |