OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ios_chrome_io_thread.h" | 5 #include "ios/chrome/browser/ios_chrome_io_thread.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 globals.quic_enable_non_blocking_io.CopyToIfSet( | 656 globals.quic_enable_non_blocking_io.CopyToIfSet( |
657 ¶ms->quic_enable_non_blocking_io); | 657 ¶ms->quic_enable_non_blocking_io); |
658 globals.quic_prefer_aes.CopyToIfSet(¶ms->quic_prefer_aes); | 658 globals.quic_prefer_aes.CopyToIfSet(¶ms->quic_prefer_aes); |
659 globals.quic_disable_disk_cache.CopyToIfSet(¶ms->quic_disable_disk_cache); | 659 globals.quic_disable_disk_cache.CopyToIfSet(¶ms->quic_disable_disk_cache); |
660 globals.quic_max_number_of_lossy_connections.CopyToIfSet( | 660 globals.quic_max_number_of_lossy_connections.CopyToIfSet( |
661 ¶ms->quic_max_number_of_lossy_connections); | 661 ¶ms->quic_max_number_of_lossy_connections); |
662 globals.quic_packet_loss_threshold.CopyToIfSet( | 662 globals.quic_packet_loss_threshold.CopyToIfSet( |
663 ¶ms->quic_packet_loss_threshold); | 663 ¶ms->quic_packet_loss_threshold); |
664 globals.quic_socket_receive_buffer_size.CopyToIfSet( | 664 globals.quic_socket_receive_buffer_size.CopyToIfSet( |
665 ¶ms->quic_socket_receive_buffer_size); | 665 ¶ms->quic_socket_receive_buffer_size); |
| 666 globals.quic_delay_tcp_race.CopyToIfSet(¶ms->quic_delay_tcp_race); |
666 params->enable_quic_port_selection = false; | 667 params->enable_quic_port_selection = false; |
667 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 668 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
668 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 669 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
669 globals.quic_supported_versions.CopyToIfSet(¶ms->quic_supported_versions); | 670 globals.quic_supported_versions.CopyToIfSet(¶ms->quic_supported_versions); |
670 params->quic_connection_options = globals.quic_connection_options; | 671 params->quic_connection_options = globals.quic_connection_options; |
671 globals.quic_close_sessions_on_ip_change.CopyToIfSet( | 672 globals.quic_close_sessions_on_ip_change.CopyToIfSet( |
672 ¶ms->quic_close_sessions_on_ip_change); | 673 ¶ms->quic_close_sessions_on_ip_change); |
673 | 674 |
674 params->enable_user_alternate_protocol_ports = false; | 675 params->enable_user_alternate_protocol_ports = false; |
675 } | 676 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 762 |
762 if (enable_quic) { | 763 if (enable_quic) { |
763 globals->quic_always_require_handshake_confirmation.set( | 764 globals->quic_always_require_handshake_confirmation.set( |
764 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); | 765 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); |
765 globals->quic_disable_connection_pooling.set( | 766 globals->quic_disable_connection_pooling.set( |
766 ShouldQuicDisableConnectionPooling(quic_trial_params)); | 767 ShouldQuicDisableConnectionPooling(quic_trial_params)); |
767 int receive_buffer_size = GetQuicSocketReceiveBufferSize(quic_trial_params); | 768 int receive_buffer_size = GetQuicSocketReceiveBufferSize(quic_trial_params); |
768 if (receive_buffer_size != 0) { | 769 if (receive_buffer_size != 0) { |
769 globals->quic_socket_receive_buffer_size.set(receive_buffer_size); | 770 globals->quic_socket_receive_buffer_size.set(receive_buffer_size); |
770 } | 771 } |
| 772 globals->quic_delay_tcp_race.set(ShouldQuicDelayTcpRace(quic_trial_params)); |
771 float load_server_info_timeout_srtt_multiplier = | 773 float load_server_info_timeout_srtt_multiplier = |
772 GetQuicLoadServerInfoTimeoutSrttMultiplier(quic_trial_params); | 774 GetQuicLoadServerInfoTimeoutSrttMultiplier(quic_trial_params); |
773 if (load_server_info_timeout_srtt_multiplier != 0) { | 775 if (load_server_info_timeout_srtt_multiplier != 0) { |
774 globals->quic_load_server_info_timeout_srtt_multiplier.set( | 776 globals->quic_load_server_info_timeout_srtt_multiplier.set( |
775 load_server_info_timeout_srtt_multiplier); | 777 load_server_info_timeout_srtt_multiplier); |
776 } | 778 } |
777 globals->quic_enable_connection_racing.set( | 779 globals->quic_enable_connection_racing.set( |
778 ShouldQuicEnableConnectionRacing(quic_trial_params)); | 780 ShouldQuicEnableConnectionRacing(quic_trial_params)); |
779 globals->quic_enable_non_blocking_io.set( | 781 globals->quic_enable_non_blocking_io.set( |
780 ShouldQuicEnableNonBlockingIO(quic_trial_params)); | 782 ShouldQuicEnableNonBlockingIO(quic_trial_params)); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 const VariationParameters& quic_trial_params) { | 925 const VariationParameters& quic_trial_params) { |
924 int value; | 926 int value; |
925 if (base::StringToInt( | 927 if (base::StringToInt( |
926 GetVariationParam(quic_trial_params, "receive_buffer_size"), | 928 GetVariationParam(quic_trial_params, "receive_buffer_size"), |
927 &value)) { | 929 &value)) { |
928 return value; | 930 return value; |
929 } | 931 } |
930 return 0; | 932 return 0; |
931 } | 933 } |
932 | 934 |
| 935 bool IOSChromeIOThread::ShouldQuicDelayTcpRace( |
| 936 const VariationParameters& quic_trial_params) { |
| 937 return base::LowerCaseEqualsASCII( |
| 938 GetVariationParam(quic_trial_params, "delay_tcp_race"), "true"); |
| 939 } |
| 940 |
933 bool IOSChromeIOThread::ShouldQuicCloseSessionsOnIpChange( | 941 bool IOSChromeIOThread::ShouldQuicCloseSessionsOnIpChange( |
934 const VariationParameters& quic_trial_params) { | 942 const VariationParameters& quic_trial_params) { |
935 return base::LowerCaseEqualsASCII( | 943 return base::LowerCaseEqualsASCII( |
936 GetVariationParam(quic_trial_params, "close_sessions_on_ip_change"), | 944 GetVariationParam(quic_trial_params, "close_sessions_on_ip_change"), |
937 "true"); | 945 "true"); |
938 } | 946 } |
939 | 947 |
940 size_t IOSChromeIOThread::GetQuicMaxPacketLength( | 948 size_t IOSChromeIOThread::GetQuicMaxPacketLength( |
941 const VariationParameters& quic_trial_params) { | 949 const VariationParameters& quic_trial_params) { |
942 unsigned value; | 950 unsigned value; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 | 1018 |
1011 globals->system_http_network_session.reset( | 1019 globals->system_http_network_session.reset( |
1012 new net::HttpNetworkSession(system_params)); | 1020 new net::HttpNetworkSession(system_params)); |
1013 globals->system_http_transaction_factory.reset( | 1021 globals->system_http_transaction_factory.reset( |
1014 new net::HttpNetworkLayer(globals->system_http_network_session.get())); | 1022 new net::HttpNetworkLayer(globals->system_http_network_session.get())); |
1015 context->set_http_transaction_factory( | 1023 context->set_http_transaction_factory( |
1016 globals->system_http_transaction_factory.get()); | 1024 globals->system_http_transaction_factory.get()); |
1017 | 1025 |
1018 return context; | 1026 return context; |
1019 } | 1027 } |
OLD | NEW |