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

Unified Diff: net/tools/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/tools/quic/quic_time_wait_list_manager.h
diff --git a/net/tools/quic/quic_time_wait_list_manager.h b/net/tools/quic/quic_time_wait_list_manager.h
index a00a646de86f7d2ff7de44766e15e8fe338a4cae..fe5f020a263a273df276bb71b66160b1a764b160 100644
--- a/net/tools/quic/quic_time_wait_list_manager.h
+++ b/net/tools/quic/quic_time_wait_list_manager.h
@@ -89,6 +89,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);
@@ -129,6 +133,15 @@ class QuicTimeWaitListManager : public QuicBlockedWriterInterface {
// Register the alarm with the epoll server 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