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

Unified Diff: net/quic/core/quic_sent_packet_manager.h

Issue 2228783004: Fix memory corruption from SetMaxPacingRate by inlining PacingSender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129351671
Patch Set: git pull from upper 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 | « net/quic/core/congestion_control/pacing_sender_test.cc ('k') | net/quic/core/quic_sent_packet_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_sent_packet_manager.h
diff --git a/net/quic/core/quic_sent_packet_manager.h b/net/quic/core/quic_sent_packet_manager.h
index 0333e98336fae13f026ac95b826cdd532c104705..17e22034042f8ae888df89592601453d1512b424 100644
--- a/net/quic/core/quic_sent_packet_manager.h
+++ b/net/quic/core/quic_sent_packet_manager.h
@@ -17,6 +17,7 @@
#include "net/base/linked_hash_map.h"
#include "net/quic/core/congestion_control/general_loss_algorithm.h"
#include "net/quic/core/congestion_control/loss_detection_interface.h"
+#include "net/quic/core/congestion_control/pacing_sender.h"
#include "net/quic/core/congestion_control/rtt_stats.h"
#include "net/quic/core/congestion_control/send_algorithm_interface.h"
#include "net/quic/core/quic_protocol.h"
@@ -316,8 +317,14 @@ class NET_EXPORT_PRIVATE QuicSentPacketManager
// RTT measurement purposes.
void RemoveObsoletePackets();
- // Enables pacing if it has not already been enabled.
- void EnablePacing();
+ // Sets the send algorithm to the given congestion control type and points the
+ // pacing sender at |send_algorithm_|. Can be called any number of times.
+ void SetSendAlgorithm(CongestionControlType congestion_control_type);
+
+ // Sets the send algorithm to |send_algorithm| and points the pacing sender at
+ // |send_algorithm_|. Takes ownership of |send_algorithm|. Can be called any
+ // number of times.
+ void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm);
// Newly serialized retransmittable packets are added to this map, which
// contains owning pointers to any contained frames. If a packet is
@@ -390,6 +397,10 @@ class NET_EXPORT_PRIVATE QuicSentPacketManager
// Largest packet in bytes ever acknowledged.
QuicPacketLength largest_mtu_acked_;
+ // Replaces certain calls to |send_algorithm_| when |using_pacing_| is true.
+ // Calls into |send_algorithm_| for the underlying congestion control.
+ PacingSender pacing_sender_;
+
// Set to true after the crypto handshake has successfully completed. After
// this is true we no longer use HANDSHAKE_MODE, and further frames sent on
// the crypto stream (i.e. SCUP messages) are treated like normal
« no previous file with comments | « net/quic/core/congestion_control/pacing_sender_test.cc ('k') | net/quic/core/quic_sent_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698