| 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 <deque> |
| 9 #include <list> |
| 8 #include <map> | 10 #include <map> |
| 11 #include <queue> |
| 9 #include <set> | 12 #include <set> |
| 10 #include <utility> | 13 #include <utility> |
| 11 #include <vector> | 14 #include <vector> |
| 12 | 15 |
| 13 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 15 #include "net/base/linked_hash_map.h" | 18 #include "net/base/linked_hash_map.h" |
| 16 #include "net/quic/congestion_control/loss_detection_interface.h" | 19 #include "net/quic/congestion_control/loss_detection_interface.h" |
| 17 #include "net/quic/congestion_control/rtt_stats.h" | 20 #include "net/quic/congestion_control/rtt_stats.h" |
| 18 #include "net/quic/congestion_control/send_algorithm_interface.h" | 21 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 47 virtual ~DebugDelegate() {} | 50 virtual ~DebugDelegate() {} |
| 48 | 51 |
| 49 // Called when a spurious retransmission is detected. | 52 // Called when a spurious retransmission is detected. |
| 50 virtual void OnSpuriousPacketRetransmition( | 53 virtual void OnSpuriousPacketRetransmition( |
| 51 TransmissionType transmission_type, | 54 TransmissionType transmission_type, |
| 52 QuicByteCount byte_size) {} | 55 QuicByteCount byte_size) {} |
| 53 | 56 |
| 54 virtual void OnSentPacket( | 57 virtual void OnSentPacket( |
| 55 QuicPacketSequenceNumber sequence_number, | 58 QuicPacketSequenceNumber sequence_number, |
| 56 QuicTime sent_time, | 59 QuicTime sent_time, |
| 57 QuicByteCount bytes, | 60 QuicByteCount bytes) {} |
| 58 TransmissionType transmission_type) {} | |
| 59 | 61 |
| 60 virtual void OnRetransmittedPacket( | 62 virtual void OnRetransmittedPacket( |
| 61 QuicPacketSequenceNumber old_sequence_number, | 63 QuicPacketSequenceNumber old_sequence_number, |
| 62 QuicPacketSequenceNumber new_sequence_number, | 64 QuicPacketSequenceNumber new_sequence_number, |
| 63 TransmissionType transmission_type, | 65 TransmissionType transmission_type, |
| 64 QuicTime time) {} | 66 QuicTime time) {} |
| 65 | 67 |
| 66 virtual void OnIncomingAck( | 68 virtual void OnIncomingAck( |
| 67 const QuicAckFrame& ack_frame, | 69 const QuicAckFrame& ack_frame, |
| 68 QuicTime ack_receive_time, | 70 QuicTime ack_receive_time, |
| 69 QuicPacketSequenceNumber largest_observed, | 71 QuicPacketSequenceNumber largest_observed, |
| 70 bool largest_observed_acked, | 72 bool largest_observed_acked, |
| 71 QuicPacketSequenceNumber least_unacked_sent_packet) {} | 73 QuicPacketSequenceNumber least_unacked_sent_packet) {} |
| 72 | |
| 73 virtual void OnSerializedPacket( | |
| 74 const SerializedPacket& packet) {} | |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 // Interface which gets callbacks from the QuicSentPacketManager when | 76 // Interface which gets callbacks from the QuicSentPacketManager when |
| 78 // network-related state changes. Implementations must not mutate the | 77 // network-related state changes. Implementations must not mutate the |
| 79 // state of the packet manager as a result of these callbacks. | 78 // state of the packet manager as a result of these callbacks. |
| 80 class NET_EXPORT_PRIVATE NetworkChangeVisitor { | 79 class NET_EXPORT_PRIVATE NetworkChangeVisitor { |
| 81 public: | 80 public: |
| 82 virtual ~NetworkChangeVisitor() {} | 81 virtual ~NetworkChangeVisitor() {} |
| 83 | 82 |
| 84 // Called when congestion window may have changed. | 83 // Called when congestion window may have changed. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 307 |
| 309 // Marks |sequence_number| as having been revived by the peer, but not | 308 // Marks |sequence_number| as having been revived by the peer, but not |
| 310 // received, so the packet remains pending if it is and the congestion control | 309 // received, so the packet remains pending if it is and the congestion control |
| 311 // does not consider the packet acked. | 310 // does not consider the packet acked. |
| 312 void MarkPacketRevived(QuicPacketSequenceNumber sequence_number, | 311 void MarkPacketRevived(QuicPacketSequenceNumber sequence_number, |
| 313 QuicTime::Delta delta_largest_observed); | 312 QuicTime::Delta delta_largest_observed); |
| 314 | 313 |
| 315 // Removes the retransmittability and pending properties from the packet at | 314 // Removes the retransmittability and pending properties from the packet at |
| 316 // |it| due to receipt by the peer. Returns an iterator to the next remaining | 315 // |it| due to receipt by the peer. Returns an iterator to the next remaining |
| 317 // unacked packet. | 316 // unacked packet. |
| 318 void MarkPacketHandled(QuicPacketSequenceNumber sequence_number, | 317 QuicUnackedPacketMap::const_iterator MarkPacketHandled( |
| 319 const TransmissionInfo& info, | 318 QuicUnackedPacketMap::const_iterator it, |
| 320 QuicTime::Delta delta_largest_observed); | 319 QuicTime::Delta delta_largest_observed); |
| 321 | 320 |
| 322 // Request that |sequence_number| be retransmitted after the other pending | 321 // Request that |sequence_number| be retransmitted after the other pending |
| 323 // retransmissions. Does not add it to the retransmissions if it's already | 322 // retransmissions. Does not add it to the retransmissions if it's already |
| 324 // a pending retransmission. | 323 // a pending retransmission. |
| 325 void MarkForRetransmission(QuicPacketSequenceNumber sequence_number, | 324 void MarkForRetransmission(QuicPacketSequenceNumber sequence_number, |
| 326 TransmissionType transmission_type); | 325 TransmissionType transmission_type); |
| 327 | 326 |
| 328 // Notify observers about spurious retransmits. | 327 // Notify observers about spurious retransmits. |
| 329 void RecordSpuriousRetransmissions( | 328 void RecordSpuriousRetransmissions( |
| 330 const SequenceNumberList& all_transmissions, | 329 const SequenceNumberSet& all_transmissions, |
| 331 QuicPacketSequenceNumber acked_sequence_number); | 330 QuicPacketSequenceNumber acked_sequence_number); |
| 332 | 331 |
| 333 // Newly serialized retransmittable and fec packets are added to this map, | 332 // Newly serialized retransmittable and fec packets are added to this map, |
| 334 // which contains owning pointers to any contained frames. If a packet is | 333 // which contains owning pointers to any contained frames. If a packet is |
| 335 // retransmitted, this map will contain entries for both the old and the new | 334 // retransmitted, this map will contain entries for both the old and the new |
| 336 // packet. The old packet's retransmittable frames entry will be NULL, while | 335 // packet. The old packet's retransmittable frames entry will be NULL, while |
| 337 // the new packet's entry will contain the frames to retransmit. | 336 // the new packet's entry will contain the frames to retransmit. |
| 338 // If the old packet is acked before the new packet, then the old entry will | 337 // If the old packet is acked before the new packet, then the old entry will |
| 339 // be removed from the map and the new entry's retransmittable frames will be | 338 // be removed from the map and the new entry's retransmittable frames will be |
| 340 // set to NULL. | 339 // set to NULL. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 // Records bandwidth from server to client in normal operation, over periods | 389 // Records bandwidth from server to client in normal operation, over periods |
| 391 // of time with no loss events. | 390 // of time with no loss events. |
| 392 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 391 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 393 | 392 |
| 394 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 393 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 395 }; | 394 }; |
| 396 | 395 |
| 397 } // namespace net | 396 } // namespace net |
| 398 | 397 |
| 399 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 398 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |