| 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 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 // Used to register with a QuicConnection for notification once a set of packets | 13 // Used to register with a QuicConnection for notification once a set of packets |
| 14 // have all been ACKed. | 14 // have all been ACKed. |
| 15 // The connection informs this class of newly ACKed sequence numbers, and once | 15 // The connection informs this class of newly ACKed sequence numbers, and once |
| 16 // we have seen ACKs for all the sequence numbers we are interested in, we | 16 // we have seen ACKs for all the sequence numbers we are interested in, we |
| 17 // trigger a call to a provided Closure. | 17 // trigger a call to a provided Closure. |
| 18 class NET_EXPORT_PRIVATE QuicAckNotifier { | 18 class NET_EXPORT_PRIVATE QuicAckNotifier { |
| 19 public: | 19 public: |
| 20 class NET_EXPORT_PRIVATE DelegateInterface | 20 class NET_EXPORT_PRIVATE DelegateInterface |
| 21 : public base::RefCounted<DelegateInterface> { | 21 : public base::RefCounted<DelegateInterface> { |
| 22 public: | 22 public: |
| 23 DelegateInterface(); | 23 DelegateInterface(); |
| 24 // Args: | 24 // Args: |
| 25 // num_original_packets - Number of packets in the original transmission. | 25 // num_original_packets - Number of packets in the original transmission. |
| 26 // num_original_bytes - Number of packets in the original transmission. | 26 // num_original_bytes - Number of packets in the original transmission. |
| 27 // num_retransmitted_packets - Number of packets that had to be | 27 // num_retransmitted_packets - Number of packets that had to be |
| 28 // retransmitted. | 28 // retransmitted. |
| 29 // num_retransmitted_bytes - Number of bytes that had to be retransmitted. | 29 // num_retransmitted_bytes - Number of bytes that had to be retransmitted. |
| 30 virtual void OnAckNotification(int num_original_packets, | 30 virtual void OnAckNotification(int num_original_packets, |
| 31 int num_original_bytes, | 31 int num_original_bytes, |
| 32 int num_retransmitted_packets, | 32 int num_retransmitted_packets, |
| 33 int num_retransmitted_bytes, | 33 int num_retransmitted_bytes, |
| 34 QuicTime::Delta delta_largest_observed) = 0; | 34 QuicTime::Delta delta_largest_observed) = 0; |
| 35 |
| 35 protected: | 36 protected: |
| 36 friend class base::RefCounted<DelegateInterface>; | 37 friend class base::RefCounted<DelegateInterface>; |
| 37 | 38 |
| 38 // Delegates are ref counted. | 39 // Delegates are ref counted. |
| 39 virtual ~DelegateInterface(); | 40 virtual ~DelegateInterface(); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 // QuicAckNotifier is expected to keep its own reference to the delegate. | 43 // QuicAckNotifier is expected to keep its own reference to the delegate. |
| 43 explicit QuicAckNotifier(DelegateInterface* delegate); | 44 explicit QuicAckNotifier(DelegateInterface* delegate); |
| 44 virtual ~QuicAckNotifier(); | 45 virtual ~QuicAckNotifier(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 int retransmitted_packet_count_; | 93 int retransmitted_packet_count_; |
| 93 // Number of bytes that had to be retransmitted. | 94 // Number of bytes that had to be retransmitted. |
| 94 int retransmitted_byte_count_; | 95 int retransmitted_byte_count_; |
| 95 | 96 |
| 96 DISALLOW_COPY_AND_ASSIGN(QuicAckNotifier); | 97 DISALLOW_COPY_AND_ASSIGN(QuicAckNotifier); |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 }; // namespace net | 100 }; // namespace net |
| 100 | 101 |
| 101 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_H_ | 102 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_H_ |
| OLD | NEW |