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

Unified Diff: net/quic/test_tools/quic_connection_peer.cc

Issue 2183493002: Add a merely pass-through QuicMultipathSentPacketManager. Protected behind blocked flag FLAGS_quic_… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/test_tools/quic_connection_peer.cc
diff --git a/net/quic/test_tools/quic_connection_peer.cc b/net/quic/test_tools/quic_connection_peer.cc
index c9a8901b67e02f89902658013a8f40654ffed4ac..61e948dde35142fd33695a54277c3a6990dce8d2 100644
--- a/net/quic/test_tools/quic_connection_peer.cc
+++ b/net/quic/test_tools/quic_connection_peer.cc
@@ -6,6 +6,7 @@
#include "base/stl_util.h"
#include "net/quic/congestion_control/send_algorithm_interface.h"
+#include "net/quic/quic_multipath_sent_packet_manager.h"
#include "net/quic/quic_packet_writer.h"
#include "net/quic/quic_received_packet_manager.h"
#include "net/quic/test_tools/quic_framer_peer.h"
@@ -23,13 +24,22 @@ void QuicConnectionPeer::SendAck(QuicConnection* connection) {
// static
void QuicConnectionPeer::SetSendAlgorithm(
QuicConnection* connection,
+ QuicPathId path_id,
SendAlgorithmInterface* send_algorithm) {
- // TODO(fayang): Remove this method when there is a MockSentPacketManager.
- static_cast<QuicSentPacketManager*>(connection->sent_packet_manager_.get())
+ GetSentPacketManager(connection, path_id)
->send_algorithm_.reset(send_algorithm);
}
// static
+void QuicConnectionPeer::SetLossAlgorithm(
+ QuicConnection* connection,
+ QuicPathId path_id,
+ LossDetectionInterface* loss_algorithm) {
+ GetSentPacketManager(connection, path_id)
+ ->loss_algorithm_.reset(loss_algorithm);
+}
+
+// static
const QuicFrame QuicConnectionPeer::GetUpdatedAckFrame(
QuicConnection* connection) {
return connection->GetUpdatedAckFrame();
@@ -63,8 +73,14 @@ QuicPacketGenerator* QuicConnectionPeer::GetPacketGenerator(
// static
QuicSentPacketManager* QuicConnectionPeer::GetSentPacketManager(
- QuicConnection* connection) {
- // TODO(fayang): Remove this method when there is a MockSentPacketManager.
+ QuicConnection* connection,
+ QuicPathId path_id) {
+ if (FLAGS_quic_enable_multipath) {
+ return static_cast<QuicSentPacketManager*>(
+ static_cast<QuicMultipathSentPacketManager*>(
+ connection->sent_packet_manager_.get())
+ ->MaybeGetSentPacketManagerForPath(path_id));
+ }
return static_cast<QuicSentPacketManager*>(
connection->sent_packet_manager_.get());
}

Powered by Google App Engine
This is Rietveld 408576698