Commit 7c2db774 authored by Zhongyi Shi's avatar Zhongyi Shi Committed by Commit Bot

Add configuration for port migration via "allow_port_migration" for desktop.

Note this change also removes server migration configuration path on desktop.
This feature has been minimally tested on a local machine, see more metials
in the associated bug.

Bug: 999285
Change-Id: Iffb2fc6c1b02bedaf91491a2f1831d3a43ca6cbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1820042
Auto-Submit: Zhongyi Shi <zhongyi@chromium.org>
Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699352}
parent d4ca0e6e
...@@ -321,6 +321,12 @@ bool ShouldQuicMigrateSessionsEarlyV2( ...@@ -321,6 +321,12 @@ bool ShouldQuicMigrateSessionsEarlyV2(
"true"); "true");
} }
bool ShouldQuicAllowPortMigration(
const VariationParameters& quic_trial_params) {
return base::LowerCaseEqualsASCII(
GetVariationParam(quic_trial_params, "allow_port_migration"), "true");
}
bool ShouldQuicRetryOnAlternateNetworkBeforeHandshake( bool ShouldQuicRetryOnAlternateNetworkBeforeHandshake(
const VariationParameters& quic_trial_params) { const VariationParameters& quic_trial_params) {
return base::LowerCaseEqualsASCII( return base::LowerCaseEqualsASCII(
...@@ -404,12 +410,6 @@ int GetQuicMaxNumMigrationsToNonDefaultNetworkOnPathDegrading( ...@@ -404,12 +410,6 @@ int GetQuicMaxNumMigrationsToNonDefaultNetworkOnPathDegrading(
return 0; return 0;
} }
bool ShouldQuicAllowServerMigration(
const VariationParameters& quic_trial_params) {
return base::LowerCaseEqualsASCII(
GetVariationParam(quic_trial_params, "allow_server_migration"), "true");
}
int GetQuicInitialRttForHandshakeMilliseconds( int GetQuicInitialRttForHandshakeMilliseconds(
const VariationParameters& quic_trial_params) { const VariationParameters& quic_trial_params) {
int value; int value;
...@@ -533,6 +533,8 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group, ...@@ -533,6 +533,8 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group,
ShouldQuicMigrateSessionsOnNetworkChangeV2(quic_trial_params); ShouldQuicMigrateSessionsOnNetworkChangeV2(quic_trial_params);
params->quic_params.migrate_sessions_early_v2 = params->quic_params.migrate_sessions_early_v2 =
ShouldQuicMigrateSessionsEarlyV2(quic_trial_params); ShouldQuicMigrateSessionsEarlyV2(quic_trial_params);
params->quic_params.allow_port_migration =
ShouldQuicAllowPortMigration(quic_trial_params);
params->quic_params.retry_on_alternate_network_before_handshake = params->quic_params.retry_on_alternate_network_before_handshake =
ShouldQuicRetryOnAlternateNetworkBeforeHandshake(quic_trial_params); ShouldQuicRetryOnAlternateNetworkBeforeHandshake(quic_trial_params);
params->quic_params.go_away_on_path_degrading = params->quic_params.go_away_on_path_degrading =
...@@ -580,8 +582,6 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group, ...@@ -580,8 +582,6 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group,
.max_migrations_to_non_default_network_on_path_degrading = .max_migrations_to_non_default_network_on_path_degrading =
max_migrations_to_non_default_network_on_path_degrading; max_migrations_to_non_default_network_on_path_degrading;
} }
params->quic_params.allow_server_migration =
ShouldQuicAllowServerMigration(quic_trial_params);
params->quic_host_allowlist = GetQuicHostAllowlist(quic_trial_params); params->quic_host_allowlist = GetQuicHostAllowlist(quic_trial_params);
SetQuicFlags(quic_trial_params); SetQuicFlags(quic_trial_params);
......
...@@ -458,15 +458,15 @@ TEST_F( ...@@ -458,15 +458,15 @@ TEST_F(
} }
TEST_F(NetworkSessionConfiguratorTest, TEST_F(NetworkSessionConfiguratorTest,
QuicAllowServerMigrationFromFieldTrialParams) { QuicAllowPortMigrationFromFieldTrialParams) {
std::map<std::string, std::string> field_trial_params; std::map<std::string, std::string> field_trial_params;
field_trial_params["allow_server_migration"] = "true"; field_trial_params["allow_port_migration"] = "true";
variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params);
base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");
ParseFieldTrials(); ParseFieldTrials();
EXPECT_TRUE(params_.quic_params.allow_server_migration); EXPECT_TRUE(params_.quic_params.allow_port_migration);
} }
TEST_F(NetworkSessionConfiguratorTest, PacketLengthFromFieldTrialParams) { TEST_F(NetworkSessionConfiguratorTest, PacketLengthFromFieldTrialParams) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment