Refactor QuicConnection::OnConnectionMigration() to use active_effective_peer_migration_type_ instead of passing in the address change type as a parameter.
PiperOrigin-RevId: 352666230
Change-Id: Iff80da71aac480f3b3752c30ffefeb1e8444c9a9
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index 86872de..771a1e5 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -4618,20 +4618,21 @@
active_effective_peer_migration_type_ = type;
// TODO(wub): Move these calls to OnEffectivePeerMigrationValidated.
- OnConnectionMigration(type);
+ OnConnectionMigration();
}
-void QuicConnection::OnConnectionMigration(AddressChangeType addr_change_type) {
+void QuicConnection::OnConnectionMigration() {
if (debug_visitor_ != nullptr) {
const QuicTime now = clock_->ApproximateNow();
if (now >= stats_.handshake_completion_time) {
debug_visitor_->OnPeerAddressChange(
- addr_change_type, now - stats_.handshake_completion_time);
+ active_effective_peer_migration_type_,
+ now - stats_.handshake_completion_time);
}
}
- visitor_->OnConnectionMigration(addr_change_type);
- if (addr_change_type != PORT_CHANGE &&
- addr_change_type != IPV4_SUBNET_CHANGE) {
+ visitor_->OnConnectionMigration(active_effective_peer_migration_type_);
+ if (active_effective_peer_migration_type_ != PORT_CHANGE &&
+ active_effective_peer_migration_type_ != IPV4_SUBNET_CHANGE) {
sent_packet_manager_.OnConnectionMigration(/*reset_send_algorithm=*/false);
}
}
diff --git a/quic/core/quic_connection.h b/quic/core/quic_connection.h
index b96952e..8814a68 100644
--- a/quic/core/quic_connection.h
+++ b/quic/core/quic_connection.h
@@ -1255,7 +1255,7 @@
// Notify various components(SendPacketManager, Session etc.) that this
// connection has been migrated.
- virtual void OnConnectionMigration(AddressChangeType addr_change_type);
+ virtual void OnConnectionMigration();
// Return whether the packet being processed is a connectivity probing.
// A packet is a connectivity probing if it is a padded ping packet with self