| 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_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ |
| 6 #define NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ | 6 #define NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace net { | 24 namespace net { |
| 25 | 25 |
| 26 class QuicAckNotifier; | 26 class QuicAckNotifier; |
| 27 | 27 |
| 28 // The AckNotifierManager is used by the QuicSentPacketManager to keep track of | 28 // The AckNotifierManager is used by the QuicSentPacketManager to keep track of |
| 29 // all the AckNotifiers currently active. It owns the AckNotifiers which it gets | 29 // all the AckNotifiers currently active. It owns the AckNotifiers which it gets |
| 30 // from the serialized packets passed into OnSerializedPacket. It maintains both | 30 // from the serialized packets passed into OnSerializedPacket. It maintains both |
| 31 // a set of AckNotifiers and a map from sequence number to AckNotifier the sake | 31 // a set of AckNotifiers and a map from sequence number to AckNotifier the sake |
| 32 // of efficiency - we can quickly check the map to see if any AckNotifiers are | 32 // of efficiency - we can quickly check the map to see if any AckNotifiers are |
| 33 // interested in a given sequence number. | 33 // interested in a given sequence number. |
| 34 | |
| 35 class NET_EXPORT_PRIVATE AckNotifierManager { | 34 class NET_EXPORT_PRIVATE AckNotifierManager { |
| 36 public: | 35 public: |
| 37 AckNotifierManager(); | 36 AckNotifierManager(); |
| 38 virtual ~AckNotifierManager(); | 37 virtual ~AckNotifierManager(); |
| 39 | 38 |
| 40 // Called when the connection receives a new AckFrame. If |sequence_number| | 39 // Called when the connection receives a new AckFrame. If |sequence_number| |
| 41 // exists in ack_notifier_map_ then the corresponding AckNotifiers will have | 40 // exists in ack_notifier_map_ then the corresponding AckNotifiers will have |
| 42 // their OnAck method called. | 41 // their OnAck method called. |
| 43 void OnPacketAcked(QuicPacketSequenceNumber sequence_number, | 42 void OnPacketAcked(QuicPacketSequenceNumber sequence_number, |
| 44 QuicTime::Delta delta_largest_observed); | 43 QuicTime::Delta delta_largest_observed); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 65 // Once a given QuicAckNotifier has seen all the sequence numbers it is | 64 // Once a given QuicAckNotifier has seen all the sequence numbers it is |
| 66 // interested in, it will be deleted, and removed from this set. | 65 // interested in, it will be deleted, and removed from this set. |
| 67 // Owns the AckNotifiers in this set. | 66 // Owns the AckNotifiers in this set. |
| 68 AckNotifierSet ack_notifiers_; | 67 AckNotifierSet ack_notifiers_; |
| 69 | 68 |
| 70 // Maps from sequence number to the AckNotifiers which are registered | 69 // Maps from sequence number to the AckNotifiers which are registered |
| 71 // for that sequence number. On receipt of an ACK for a given sequence | 70 // for that sequence number. On receipt of an ACK for a given sequence |
| 72 // number, call OnAck for all mapped AckNotifiers. | 71 // number, call OnAck for all mapped AckNotifiers. |
| 73 // Does not own the AckNotifiers. | 72 // Does not own the AckNotifiers. |
| 74 AckNotifierMap ack_notifier_map_; | 73 AckNotifierMap ack_notifier_map_; |
| 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(AckNotifierManager); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace net | 78 } // namespace net |
| 78 | 79 |
| 79 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ | 80 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ |
| OLD | NEW |