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