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

Unified Diff: net/quic/quic_time_wait_list_manager.h

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
Index: net/quic/quic_time_wait_list_manager.h
diff --git a/net/quic/quic_time_wait_list_manager.h b/net/quic/quic_time_wait_list_manager.h
index d6be4c0c5d7b9f30778b57191a13ed157f5f2b90..0fff1588e3fb9b9b1423924ddc004b0ce935e89f 100644
--- a/net/quic/quic_time_wait_list_manager.h
+++ b/net/quic/quic_time_wait_list_manager.h
@@ -85,6 +85,10 @@ class QuicTimeWaitListManager : public QuicBlockedWriterInterface {
// period.
void CleanUpOldConnectionIds();
+ // If necessary, trims the oldest connections from the time-wait list until
+ // the size is under the configured maximum.
+ void TrimTimeWaitListIfNeeded();
+
// Given a ConnectionId that exists in the time wait list, returns the
// QuicVersion associated with it.
QuicVersion GetQuicVersionFromConnectionId(QuicConnectionId connection_id);
@@ -125,6 +129,15 @@ class QuicTimeWaitListManager : public QuicBlockedWriterInterface {
// Register the alarm to wake up at appropriate time.
void SetConnectionIdCleanUpAlarm();
+ // Removes the oldest connection from the time-wait list if it was added prior
+ // to "expiration_time". To unconditionally remove the oldest connection, use
+ // a QuicTime::Delta:Infinity(). This function modifies the
+ // connection_id_map_. If you plan to call this function in a loop, any
+ // iterators that you hold before the call to this function may be invalid
+ // afterward. Returns true if the oldest connection was expired. Returns
+ // false if the map is empty or the oldest connection has not expired.
+ bool MaybeExpireOldestConnection(QuicTime expiration_time);
+
// A map from a recently closed connection_id to the number of packets
// received after the termination of the connection bound to the
// connection_id.

Powered by Google App Engine
This is Rietveld 408576698