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

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

Issue 870733002: Change some of QUIC's AckNotifier datastructures from maps to hashmaps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Add_new_RTO_connection_option_84036848
Patch Set: Created 5 years, 11 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 | « no previous file | 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 <map> 9 #include <map>
9 10
10 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
11 #include "net/quic/quic_protocol.h" 12 #include "net/quic/quic_protocol.h"
12 13
13 namespace net { 14 namespace net {
14 15
15 class QuicAckNotifier; 16 class QuicAckNotifier;
16 17
17 // The AckNotifierManager is used by the QuicSentPacketManager to keep track of 18 // The AckNotifierManager is used by the QuicSentPacketManager to keep track of
(...skipping 20 matching lines...) Expand all
38 QuicPacketSequenceNumber new_sequence_number); 39 QuicPacketSequenceNumber new_sequence_number);
39 40
40 // This is called after a packet has been serialized, is ready to be sent, and 41 // This is called after a packet has been serialized, is ready to be sent, and
41 // contains retransmittable frames (which may have associated AckNotifiers). 42 // contains retransmittable frames (which may have associated AckNotifiers).
42 // If any of the retransmittable frames included in |serialized_packet| have 43 // If any of the retransmittable frames included in |serialized_packet| have
43 // AckNotifiers registered, then add them to our internal map and additionally 44 // AckNotifiers registered, then add them to our internal map and additionally
44 // inform the AckNotifier of the sequence number which it should track. 45 // inform the AckNotifier of the sequence number which it should track.
45 void OnSerializedPacket(const SerializedPacket& serialized_packet); 46 void OnSerializedPacket(const SerializedPacket& serialized_packet);
46 47
47 private: 48 private:
49 typedef std::list<QuicAckNotifier*> AckNotifierList;
48 typedef base::hash_set<QuicAckNotifier*> AckNotifierSet; 50 typedef base::hash_set<QuicAckNotifier*> AckNotifierSet;
49 typedef std::map<QuicPacketSequenceNumber, AckNotifierSet> AckNotifierMap; 51 // TODO(ianswett): Further improvement may come from changing this to a deque.
52 typedef base::hash_map<QuicPacketSequenceNumber, AckNotifierList>
53 AckNotifierMap;
50 54
51 // On every ACK frame received by the connection, all the ack_notifiers_ will 55 // On every ACK frame received by the connection, all the ack_notifiers_ will
52 // be told which sequeunce numbers were ACKed. 56 // be told which sequeunce numbers were ACKed.
53 // Once a given QuicAckNotifier has seen all the sequence numbers it is 57 // Once a given QuicAckNotifier has seen all the sequence numbers it is
54 // interested in, it will be deleted, and removed from this set. 58 // interested in, it will be deleted, and removed from this set.
55 // Owns the AckNotifiers in this set. 59 // Owns the AckNotifiers in this set.
56 AckNotifierSet ack_notifiers_; 60 AckNotifierSet ack_notifiers_;
57 61
58 // Maps from sequence number to the AckNotifiers which are registered 62 // Maps from sequence number to the AckNotifiers which are registered
59 // for that sequence number. On receipt of an ACK for a given sequence 63 // for that sequence number. On receipt of an ACK for a given sequence
60 // number, call OnAck for all mapped AckNotifiers. 64 // number, call OnAck for all mapped AckNotifiers.
61 // Does not own the AckNotifiers. 65 // Does not own the AckNotifiers.
62 AckNotifierMap ack_notifier_map_; 66 AckNotifierMap ack_notifier_map_;
63 67
64 DISALLOW_COPY_AND_ASSIGN(AckNotifierManager); 68 DISALLOW_COPY_AND_ASSIGN(AckNotifierManager);
65 }; 69 };
66 70
67 } // namespace net 71 } // namespace net
68 72
69 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_ 73 #endif // NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_ack_notifier_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698