Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: net/quic/quic_ack_notifier_manager.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_ack_notifier.cc ('k') | net/quic/quic_ack_notifier_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 30 matching lines...) Expand all
41 41
42 // This is called after a packet has been serialized, is ready to be sent, and 42 // This is called after a packet has been serialized, is ready to be sent, and
43 // contains retransmittable frames (which may have associated AckNotifiers). 43 // contains retransmittable frames (which may have associated AckNotifiers).
44 // If any of the retransmittable frames included in |serialized_packet| have 44 // If any of the retransmittable frames included in |serialized_packet| have
45 // AckNotifiers registered, then add them to our internal map and additionally 45 // AckNotifiers registered, then add them to our internal map and additionally
46 // inform the AckNotifier of the sequence number which it should track. 46 // inform the AckNotifier of the sequence number which it should track.
47 void OnSerializedPacket(const SerializedPacket& serialized_packet); 47 void OnSerializedPacket(const SerializedPacket& serialized_packet);
48 48
49 private: 49 private:
50 typedef std::list<QuicAckNotifier*> AckNotifierList; 50 typedef std::list<QuicAckNotifier*> AckNotifierList;
51 typedef base::hash_set<QuicAckNotifier*> AckNotifierSet;
52 // TODO(ianswett): Further improvement may come from changing this to a deque. 51 // TODO(ianswett): Further improvement may come from changing this to a deque.
53 typedef base::hash_map<QuicPacketSequenceNumber, AckNotifierList> 52 typedef base::hash_map<QuicPacketSequenceNumber, AckNotifierList>
54 AckNotifierMap; 53 AckNotifierMap;
55 54
56 // On every ACK frame received by the connection, all the ack_notifiers_ will
57 // be told which sequeunce numbers were ACKed.
58 // Once a given QuicAckNotifier has seen all the sequence numbers it is
59 // interested in, it will be deleted, and removed from this set.
60 // Owns the AckNotifiers in this set.
61 AckNotifierSet ack_notifiers_;
62
63 // Maps from sequence number to the AckNotifiers which are registered 55 // Maps from sequence number to the AckNotifiers which are registered
64 // for that sequence number. On receipt of an ACK for a given sequence 56 // for that sequence number. On receipt of an ACK for a given sequence
65 // number, call OnAck for all mapped AckNotifiers. 57 // number, call OnAck for all mapped AckNotifiers.
66 // Does not own the AckNotifiers. 58 // When the last reference is removed from the map, the notifier is deleted.
67 AckNotifierMap ack_notifier_map_; 59 AckNotifierMap ack_notifier_map_;
68 60
69 DISALLOW_COPY_AND_ASSIGN(AckNotifierManager); 61 DISALLOW_COPY_AND_ASSIGN(AckNotifierManager);
70 }; 62 };
71 63
72 } // namespace net 64 } // namespace net
73 65
74 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ 66 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_ack_notifier.cc ('k') | net/quic/quic_ack_notifier_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698