Inline ShouldDestroySessionAsynchronously as it has only one behavior. PiperOrigin-RevId: 455627280
diff --git a/quiche/quic/core/quic_dispatcher.cc b/quiche/quic/core/quic_dispatcher.cc index 3d97b1e..30a93df 100644 --- a/quiche/quic/core/quic_dispatcher.cc +++ b/quiche/quic/core/quic_dispatcher.cc
@@ -1064,15 +1064,13 @@ << ", with details: " << error_details; QuicConnection* connection = it->second->connection(); - if (ShouldDestroySessionAsynchronously()) { - // Set up alarm to fire immediately to bring destruction of this session - // out of current call stack. - if (closed_session_list_.empty()) { - delete_sessions_alarm_->Update(helper()->GetClock()->ApproximateNow(), - QuicTime::Delta::Zero()); - } - closed_session_list_.push_back(std::move(it->second)); + // Set up alarm to fire immediately to bring destruction of this session + // out of current call stack. + if (closed_session_list_.empty()) { + delete_sessions_alarm_->Update(helper()->GetClock()->ApproximateNow(), + QuicTime::Delta::Zero()); } + closed_session_list_.push_back(std::move(it->second)); CleanUpSession(it->first, connection, error, error_details, source); for (const QuicConnectionId& cid : connection->GetActiveServerConnectionIds()) { @@ -1376,8 +1374,6 @@ --new_sessions_allowed_per_event_loop_; } -bool QuicDispatcher::ShouldDestroySessionAsynchronously() { return true; } - void QuicDispatcher::SetLastError(QuicErrorCode error) { last_error_ = error; } bool QuicDispatcher::OnFailedToDispatchPacket(
diff --git a/quiche/quic/core/quic_dispatcher.h b/quiche/quic/core/quic_dispatcher.h index f53df8b..0a103cd 100644 --- a/quiche/quic/core/quic_dispatcher.h +++ b/quiche/quic/core/quic_dispatcher.h
@@ -244,10 +244,6 @@ void ProcessChlo(ParsedClientHello parsed_chlo, ReceivedPacketInfo* packet_info); - // Return true if dispatcher wants to destroy session outside of - // OnConnectionClosed() call stack. - virtual bool ShouldDestroySessionAsynchronously(); - QuicTimeWaitListManager* time_wait_list_manager() { return time_wait_list_manager_.get(); }