Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: net/quic/quic_time_wait_list_manager.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_time_wait_list_manager.h ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_time_wait_list_manager.cc
diff --git a/net/quic/quic_time_wait_list_manager.cc b/net/quic/quic_time_wait_list_manager.cc
index 8f1f564117ec07180de4ed6532330d6395abf006..984d95faa7dd248f6b57751e379deab7ff5b0408 100644
--- a/net/quic/quic_time_wait_list_manager.cc
+++ b/net/quic/quic_time_wait_list_manager.cc
@@ -112,10 +112,10 @@ void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
QuicConnectionId connection_id,
QuicVersion version,
QuicEncryptedPacket* close_packet) {
- DVLOG(1) << "Adding " << connection_id << " to the time wait list.";
int num_packets = 0;
ConnectionIdMap::iterator it = connection_id_map_.find(connection_id);
- if (it != connection_id_map_.end()) { // Replace record if it is reinserted.
+ const bool new_connection_id = it == connection_id_map_.end();
+ if (!new_connection_id) { // Replace record if it is reinserted.
num_packets = it->second.num_packets;
delete it->second.close_packet;
connection_id_map_.erase(it);
@@ -125,6 +125,9 @@ void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
helper_->GetClock()->ApproximateNow(),
close_packet);
connection_id_map_.insert(make_pair(connection_id, data));
+ if (new_connection_id) {
+ visitor_->OnConnectionAddedToTimeWaitList(connection_id);
+ }
}
bool QuicTimeWaitListManager::IsConnectionIdInTimeWait(
@@ -277,10 +280,11 @@ void QuicTimeWaitListManager::CleanUpOldConnectionIds() {
if (now.Subtract(oldest_connection_id) < kTimeWaitPeriod_) {
break;
}
+ const QuicConnectionId connection_id = it->first;
// This connection_id has lived its age, retire it now.
- DVLOG(1) << "Retiring " << it->first << " from the time-wait state.";
delete it->second.close_packet;
connection_id_map_.erase(it);
+ visitor_->OnConnectionRemovedFromTimeWaitList(connection_id);
}
SetConnectionIdCleanUpAlarm();
}
« no previous file with comments | « net/quic/quic_time_wait_list_manager.h ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698