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

Unified Diff: net/quic/core/congestion_control/send_algorithm_simulator.h

Issue 2236533002: Refactor SendAlgorithmSimulator to accept arbitrary termination predicates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129456177
Patch Set: git pull from up stream Created 4 years, 4 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 | « no previous file | net/quic/core/congestion_control/send_algorithm_simulator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/send_algorithm_simulator.h
diff --git a/net/quic/core/congestion_control/send_algorithm_simulator.h b/net/quic/core/congestion_control/send_algorithm_simulator.h
index fd93e27e9bc0ffbf3fb04a21dd309a2238c52f52..9b3974bdd2d740c6b4f0b990223ffe856bec62e4 100644
--- a/net/quic/core/congestion_control/send_algorithm_simulator.h
+++ b/net/quic/core/congestion_control/send_algorithm_simulator.h
@@ -168,10 +168,17 @@ class SendAlgorithmSimulator {
void TransferBytes();
// Transfers bytes through the connection until |max_bytes| are reached,
- // |max_time| is reached, or all senders have finished sending. If max_bytes
- // is 0, it does not apply, and if |max_time| is Zero, no time limit applies.
+ // |max_time| is reached, or all senders have finished sending. If |max_time|
+ // is Zero, no time limit applies.
void TransferBytes(QuicByteCount max_bytes, QuicTime::Delta max_time);
+ // Transfers bytes through the connection until the supplied termination
+ // predicate returns true, or until all senders have finished sending.
+ // Returns true if the transfer was terminated due to the predicate, and false
+ // otherwise.
+ template <class TerminationPredicate>
+ bool TransferBytesUntil(TerminationPredicate termination_predicate);
+
private:
// A pending packet event, either a send or an ack.
struct PacketEvent {
« no previous file with comments | « no previous file | net/quic/core/congestion_control/send_algorithm_simulator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698