OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/network_session_configurator/network_session_configurator.h
" | 5 #include "components/network_session_configurator/network_session_configurator.h
" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <unordered_set> | 8 #include <unordered_set> |
9 | 9 |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 | 213 |
214 bool ShouldQuicAllowServerMigration( | 214 bool ShouldQuicAllowServerMigration( |
215 const VariationParameters& quic_trial_params) { | 215 const VariationParameters& quic_trial_params) { |
216 return base::LowerCaseEqualsASCII( | 216 return base::LowerCaseEqualsASCII( |
217 GetVariationParam(quic_trial_params, | 217 GetVariationParam(quic_trial_params, |
218 "allow_server_migration"), | 218 "allow_server_migration"), |
219 "true"); | 219 "true"); |
220 } | 220 } |
221 | 221 |
222 bool ShouldQuicDoNotMarkAsBrokenOnNetworkChange( | |
223 const VariationParameters& quic_trial_params) { | |
224 return base::LowerCaseEqualsASCII( | |
225 GetVariationParam(quic_trial_params, | |
226 "do_not_mark_as_broken_on_network_change"), | |
227 "true"); | |
228 } | |
229 | |
230 size_t GetQuicMaxPacketLength(const VariationParameters& quic_trial_params) { | 222 size_t GetQuicMaxPacketLength(const VariationParameters& quic_trial_params) { |
231 unsigned value; | 223 unsigned value; |
232 if (base::StringToUint( | 224 if (base::StringToUint( |
233 GetVariationParam(quic_trial_params, "max_packet_length"), &value)) { | 225 GetVariationParam(quic_trial_params, "max_packet_length"), &value)) { |
234 return value; | 226 return value; |
235 } | 227 } |
236 return 0; | 228 return 0; |
237 } | 229 } |
238 | 230 |
239 net::QuicVersion GetQuicVersion(const VariationParameters& quic_trial_params) { | 231 net::QuicVersion GetQuicVersion(const VariationParameters& quic_trial_params) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 params->quic_do_not_fragment = | 287 params->quic_do_not_fragment = |
296 ShouldQuicDoNotFragment(quic_trial_params); | 288 ShouldQuicDoNotFragment(quic_trial_params); |
297 params->quic_estimate_initial_rtt = | 289 params->quic_estimate_initial_rtt = |
298 ShouldQuicEstimateInitialRtt(quic_trial_params); | 290 ShouldQuicEstimateInitialRtt(quic_trial_params); |
299 params->quic_migrate_sessions_on_network_change = | 291 params->quic_migrate_sessions_on_network_change = |
300 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params); | 292 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params); |
301 params->quic_migrate_sessions_early = | 293 params->quic_migrate_sessions_early = |
302 ShouldQuicMigrateSessionsEarly(quic_trial_params); | 294 ShouldQuicMigrateSessionsEarly(quic_trial_params); |
303 params->quic_allow_server_migration = | 295 params->quic_allow_server_migration = |
304 ShouldQuicAllowServerMigration(quic_trial_params); | 296 ShouldQuicAllowServerMigration(quic_trial_params); |
305 params->quic_do_not_mark_as_broken_on_network_change = | |
306 ShouldQuicDoNotMarkAsBrokenOnNetworkChange(quic_trial_params); | |
307 } | 297 } |
308 | 298 |
309 size_t max_packet_length = GetQuicMaxPacketLength(quic_trial_params); | 299 size_t max_packet_length = GetQuicMaxPacketLength(quic_trial_params); |
310 if (max_packet_length != 0) { | 300 if (max_packet_length != 0) { |
311 params->quic_max_packet_length = max_packet_length; | 301 params->quic_max_packet_length = max_packet_length; |
312 } | 302 } |
313 | 303 |
314 params->quic_user_agent_id = quic_user_agent_id; | 304 params->quic_user_agent_id = quic_user_agent_id; |
315 | 305 |
316 net::QuicVersion version = GetQuicVersion(quic_trial_params); | 306 net::QuicVersion version = GetQuicVersion(quic_trial_params); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 &http2_trial_params)) | 347 &http2_trial_params)) |
358 http2_trial_params.clear(); | 348 http2_trial_params.clear(); |
359 ConfigureHttp2Params(http2_trial_group, http2_trial_params, params); | 349 ConfigureHttp2Params(http2_trial_group, http2_trial_params, params); |
360 | 350 |
361 const std::string tfo_trial_group = | 351 const std::string tfo_trial_group = |
362 base::FieldTrialList::FindFullName(kTCPFastOpenFieldTrialName); | 352 base::FieldTrialList::FindFullName(kTCPFastOpenFieldTrialName); |
363 ConfigureTCPFastOpenParams(tfo_trial_group, params); | 353 ConfigureTCPFastOpenParams(tfo_trial_group, params); |
364 } | 354 } |
365 | 355 |
366 } // namespace network_session_configurator | 356 } // namespace network_session_configurator |
OLD | NEW |