| 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_ACK_NOTIFIER_H_ | 5 #ifndef NET_QUIC_QUIC_ACK_NOTIFIER_H_ |
| 6 #define NET_QUIC_QUIC_ACK_NOTIFIER_H_ | 6 #define NET_QUIC_QUIC_ACK_NOTIFIER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 virtual ~DelegateInterface(); | 36 virtual ~DelegateInterface(); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // QuicAckNotifier is expected to keep its own reference to the delegate. | 39 // QuicAckNotifier is expected to keep its own reference to the delegate. |
| 40 explicit QuicAckNotifier(DelegateInterface* delegate); | 40 explicit QuicAckNotifier(DelegateInterface* delegate); |
| 41 virtual ~QuicAckNotifier(); | 41 virtual ~QuicAckNotifier(); |
| 42 | 42 |
| 43 // Register a serialized packet the notifier should track. | 43 // Register a serialized packet the notifier should track. |
| 44 void OnSerializedPacket(); | 44 void OnSerializedPacket(); |
| 45 | 45 |
| 46 // Called by the QuicConnection on receipt of new ACK frame, with the sequence | 46 // Called on receipt of new ACK frame for an unacked packet. |
| 47 // number referenced by the ACK frame. | 47 // Decrements the number of unacked packets and if there are none left, calls |
| 48 // Deletes the matching sequence number from the stored set of sequence | 48 // the stored delegate's OnAckNotification method. |
| 49 // numbers. If this set is now empty, call the stored delegate's | |
| 50 // OnAckNotification method. | |
| 51 // | 49 // |
| 52 // Returns true if the provided sequence_number caused the delegate to be | 50 // Returns true if the delegate was called, false otherwise. |
| 53 // called, false otherwise. | 51 bool OnAck(QuicTime::Delta delta_largest_observed); |
| 54 bool OnAck(QuicPacketSequenceNumber sequence_number, | |
| 55 QuicTime::Delta delta_largest_observed); | |
| 56 | 52 |
| 57 // Called when we've given up waiting for a sequence number, typically when | 53 // Called when we've given up waiting for a sequence number, typically when |
| 58 // the connection is torn down. | 54 // the connection is torn down. |
| 59 // Returns true if there are no more unacked packets being tracked. | 55 // Returns true if there are no more unacked packets being tracked. |
| 60 bool OnPacketAbandoned(); | 56 bool OnPacketAbandoned(); |
| 61 | 57 |
| 62 bool HasUnackedPackets() const { return unacked_packets_ > 0; } | 58 bool HasUnackedPackets() const { return unacked_packets_ > 0; } |
| 63 | 59 |
| 64 // If a packet is retransmitted by the connection, it will be sent with a | 60 // If a packet is retransmitted by the connection, it will be sent with a |
| 65 // different sequence number. | 61 // different sequence number. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 int retransmitted_packet_count_; | 74 int retransmitted_packet_count_; |
| 79 // Number of bytes that had to be retransmitted. | 75 // Number of bytes that had to be retransmitted. |
| 80 int retransmitted_byte_count_; | 76 int retransmitted_byte_count_; |
| 81 | 77 |
| 82 DISALLOW_COPY_AND_ASSIGN(QuicAckNotifier); | 78 DISALLOW_COPY_AND_ASSIGN(QuicAckNotifier); |
| 83 }; | 79 }; |
| 84 | 80 |
| 85 } // namespace net | 81 } // namespace net |
| 86 | 82 |
| 87 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_H_ | 83 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_H_ |
| OLD | NEW |