| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "net/base/linked_hash_map.h" | 17 #include "net/base/linked_hash_map.h" |
| 18 #include "net/quic/core/congestion_control/general_loss_algorithm.h" | 18 #include "net/quic/core/congestion_control/general_loss_algorithm.h" |
| 19 #include "net/quic/core/congestion_control/loss_detection_interface.h" | 19 #include "net/quic/core/congestion_control/loss_detection_interface.h" |
| 20 #include "net/quic/core/congestion_control/pacing_sender.h" |
| 20 #include "net/quic/core/congestion_control/rtt_stats.h" | 21 #include "net/quic/core/congestion_control/rtt_stats.h" |
| 21 #include "net/quic/core/congestion_control/send_algorithm_interface.h" | 22 #include "net/quic/core/congestion_control/send_algorithm_interface.h" |
| 22 #include "net/quic/core/quic_protocol.h" | 23 #include "net/quic/core/quic_protocol.h" |
| 23 #include "net/quic/core/quic_sent_packet_manager_interface.h" | 24 #include "net/quic/core/quic_sent_packet_manager_interface.h" |
| 24 #include "net/quic/core/quic_unacked_packet_map.h" | 25 #include "net/quic/core/quic_unacked_packet_map.h" |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 | 28 |
| 28 namespace test { | 29 namespace test { |
| 29 class QuicConnectionPeer; | 30 class QuicConnectionPeer; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 QuicPacketNumber acked_packet_number); | 310 QuicPacketNumber acked_packet_number); |
| 310 | 311 |
| 311 // Returns mutable TransmissionInfo associated with |packet_number|, which | 312 // Returns mutable TransmissionInfo associated with |packet_number|, which |
| 312 // must be unacked. | 313 // must be unacked. |
| 313 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); | 314 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); |
| 314 | 315 |
| 315 // Remove any packets no longer needed for retransmission, congestion, or | 316 // Remove any packets no longer needed for retransmission, congestion, or |
| 316 // RTT measurement purposes. | 317 // RTT measurement purposes. |
| 317 void RemoveObsoletePackets(); | 318 void RemoveObsoletePackets(); |
| 318 | 319 |
| 319 // Enables pacing if it has not already been enabled. | 320 // Sets the send algorithm to the given congestion control type and points the |
| 320 void EnablePacing(); | 321 // pacing sender at |send_algorithm_|. Can be called any number of times. |
| 322 void SetSendAlgorithm(CongestionControlType congestion_control_type); |
| 323 |
| 324 // Sets the send algorithm to |send_algorithm| and points the pacing sender at |
| 325 // |send_algorithm_|. Takes ownership of |send_algorithm|. Can be called any |
| 326 // number of times. |
| 327 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm); |
| 321 | 328 |
| 322 // Newly serialized retransmittable packets are added to this map, which | 329 // Newly serialized retransmittable packets are added to this map, which |
| 323 // contains owning pointers to any contained frames. If a packet is | 330 // contains owning pointers to any contained frames. If a packet is |
| 324 // retransmitted, this map will contain entries for both the old and the new | 331 // retransmitted, this map will contain entries for both the old and the new |
| 325 // packet. The old packet's retransmittable frames entry will be nullptr, | 332 // packet. The old packet's retransmittable frames entry will be nullptr, |
| 326 // while the new packet's entry will contain the frames to retransmit. | 333 // while the new packet's entry will contain the frames to retransmit. |
| 327 // If the old packet is acked before the new packet, then the old entry will | 334 // If the old packet is acked before the new packet, then the old entry will |
| 328 // be removed from the map and the new entry's retransmittable frames will be | 335 // be removed from the map and the new entry's retransmittable frames will be |
| 329 // set to nullptr. | 336 // set to nullptr. |
| 330 QuicUnackedPacketMap unacked_packets_; | 337 QuicUnackedPacketMap unacked_packets_; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 bool undo_pending_retransmits_; | 390 bool undo_pending_retransmits_; |
| 384 | 391 |
| 385 // Vectors packets acked and lost as a result of the last congestion event. | 392 // Vectors packets acked and lost as a result of the last congestion event. |
| 386 SendAlgorithmInterface::CongestionVector packets_acked_; | 393 SendAlgorithmInterface::CongestionVector packets_acked_; |
| 387 SendAlgorithmInterface::CongestionVector packets_lost_; | 394 SendAlgorithmInterface::CongestionVector packets_lost_; |
| 388 // Largest newly acknowledged packet. | 395 // Largest newly acknowledged packet. |
| 389 QuicPacketNumber largest_newly_acked_; | 396 QuicPacketNumber largest_newly_acked_; |
| 390 // Largest packet in bytes ever acknowledged. | 397 // Largest packet in bytes ever acknowledged. |
| 391 QuicPacketLength largest_mtu_acked_; | 398 QuicPacketLength largest_mtu_acked_; |
| 392 | 399 |
| 400 // Replaces certain calls to |send_algorithm_| when |using_pacing_| is true. |
| 401 // Calls into |send_algorithm_| for the underlying congestion control. |
| 402 PacingSender pacing_sender_; |
| 403 |
| 393 // Set to true after the crypto handshake has successfully completed. After | 404 // Set to true after the crypto handshake has successfully completed. After |
| 394 // this is true we no longer use HANDSHAKE_MODE, and further frames sent on | 405 // this is true we no longer use HANDSHAKE_MODE, and further frames sent on |
| 395 // the crypto stream (i.e. SCUP messages) are treated like normal | 406 // the crypto stream (i.e. SCUP messages) are treated like normal |
| 396 // retransmittable frames. | 407 // retransmittable frames. |
| 397 bool handshake_confirmed_; | 408 bool handshake_confirmed_; |
| 398 | 409 |
| 399 // Records bandwidth from server to client in normal operation, over periods | 410 // Records bandwidth from server to client in normal operation, over periods |
| 400 // of time with no loss events. | 411 // of time with no loss events. |
| 401 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 412 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 402 | 413 |
| 403 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 414 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 404 }; | 415 }; |
| 405 | 416 |
| 406 } // namespace net | 417 } // namespace net |
| 407 | 418 |
| 408 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 419 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |