| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "net/base/linked_hash_map.h" | 15 #include "net/base/linked_hash_map.h" |
| 16 #include "net/quic/congestion_control/loss_detection_interface.h" | 16 #include "net/quic/congestion_control/loss_detection_interface.h" |
| 17 #include "net/quic/congestion_control/rtt_stats.h" | 17 #include "net/quic/congestion_control/rtt_stats.h" |
| 18 #include "net/quic/congestion_control/send_algorithm_interface.h" | 18 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 19 #include "net/quic/crypto/cached_network_parameters.h" |
| 19 #include "net/quic/quic_ack_notifier_manager.h" | 20 #include "net/quic/quic_ack_notifier_manager.h" |
| 20 #include "net/quic/quic_protocol.h" | 21 #include "net/quic/quic_protocol.h" |
| 21 #include "net/quic/quic_sustained_bandwidth_recorder.h" | 22 #include "net/quic/quic_sustained_bandwidth_recorder.h" |
| 22 #include "net/quic/quic_unacked_packet_map.h" | 23 #include "net/quic/quic_unacked_packet_map.h" |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 | 26 |
| 26 namespace test { | 27 namespace test { |
| 27 class QuicConnectionPeer; | 28 class QuicConnectionPeer; |
| 28 class QuicSentPacketManagerPeer; | 29 class QuicSentPacketManagerPeer; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 QuicSentPacketManager(bool is_server, | 93 QuicSentPacketManager(bool is_server, |
| 93 const QuicClock* clock, | 94 const QuicClock* clock, |
| 94 QuicConnectionStats* stats, | 95 QuicConnectionStats* stats, |
| 95 CongestionControlType congestion_control_type, | 96 CongestionControlType congestion_control_type, |
| 96 LossDetectionType loss_type, | 97 LossDetectionType loss_type, |
| 97 bool is_secure); | 98 bool is_secure); |
| 98 virtual ~QuicSentPacketManager(); | 99 virtual ~QuicSentPacketManager(); |
| 99 | 100 |
| 100 virtual void SetFromConfig(const QuicConfig& config); | 101 virtual void SetFromConfig(const QuicConfig& config); |
| 101 | 102 |
| 103 // Pass the CachedNetworkParameters to the send algorithm. |
| 104 void ResumeConnectionState( |
| 105 const CachedNetworkParameters& cached_network_params); |
| 106 |
| 102 void SetNumOpenStreams(size_t num_streams); | 107 void SetNumOpenStreams(size_t num_streams); |
| 103 | 108 |
| 104 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } | 109 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } |
| 105 | 110 |
| 106 // Processes the incoming ack. | 111 // Processes the incoming ack. |
| 107 void OnIncomingAck(const QuicAckFrame& ack_frame, | 112 void OnIncomingAck(const QuicAckFrame& ack_frame, |
| 108 QuicTime ack_receive_time); | 113 QuicTime ack_receive_time); |
| 109 | 114 |
| 110 // Returns true if the non-FEC packet |sequence_number| is unacked. | 115 // Returns true if the non-FEC packet |sequence_number| is unacked. |
| 111 bool IsUnacked(QuicPacketSequenceNumber sequence_number) const; | 116 bool IsUnacked(QuicPacketSequenceNumber sequence_number) const; |
| 112 | 117 |
| 113 // Requests retransmission of all unacked packets of |retransmission_type|. | 118 // Requests retransmission of all unacked packets of |retransmission_type|. |
| 119 // The behavior of this method depends on the value of |retransmission_type|: |
| 120 // ALL_UNACKED_RETRANSMISSION - All unacked packets will be retransmitted. |
| 121 // This can happen, for example, after a version negotiation packet has been |
| 122 // received and all packets needs to be retransmitted with the new version. |
| 123 // ALL_INITIAL_RETRANSMISSION - Only initially encrypted packets will be |
| 124 // retransmitted. This can happen, for example, when a CHLO has been rejected |
| 125 // and the previously encrypted data needs to be encrypted with a new key. |
| 114 void RetransmitUnackedPackets(TransmissionType retransmission_type); | 126 void RetransmitUnackedPackets(TransmissionType retransmission_type); |
| 115 | 127 |
| 116 // Retransmits the oldest pending packet there is still a tail loss probe | 128 // Retransmits the oldest pending packet there is still a tail loss probe |
| 117 // pending. Invoked after OnRetransmissionTimeout. | 129 // pending. Invoked after OnRetransmissionTimeout. |
| 118 bool MaybeRetransmitTailLossProbe(); | 130 bool MaybeRetransmitTailLossProbe(); |
| 119 | 131 |
| 120 // Removes the retransmittable frames from all unencrypted packets to ensure | 132 // Removes the retransmittable frames from all unencrypted packets to ensure |
| 121 // they don't get retransmitted. | 133 // they don't get retransmitted. |
| 122 void NeuterUnencryptedPackets(); | 134 void NeuterUnencryptedPackets(); |
| 123 | 135 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 // Records bandwidth from server to client in normal operation, over periods | 404 // Records bandwidth from server to client in normal operation, over periods |
| 393 // of time with no loss events. | 405 // of time with no loss events. |
| 394 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 406 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 395 | 407 |
| 396 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 408 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 397 }; | 409 }; |
| 398 | 410 |
| 399 } // namespace net | 411 } // namespace net |
| 400 | 412 |
| 401 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 413 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |