summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_ack_notifier_manager.h
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-04 18:40:55 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-04 18:40:55 +0000
commita058f3dd9c806f8f3a83f0b9d96fb8fbef46283b (patch)
tree8b80b5aa7f4227d32cb6a69cca7d85314a02f301 /net/quic/quic_ack_notifier_manager.h
parent13621d68bc4096987471ec698468a972af2fa1de (diff)
downloadchromium_src-a058f3dd9c806f8f3a83f0b9d96fb8fbef46283b.zip
chromium_src-a058f3dd9c806f8f3a83f0b9d96fb8fbef46283b.tar.gz
chromium_src-a058f3dd9c806f8f3a83f0b9d96fb8fbef46283b.tar.bz2
Revert 226390 "Land Recent QUIC changes."
> Land Recent QUIC changes. > > Fixing minor nits (added using std::pair). > > Merge internal change: 53257699 > > Increasing the maximum tcp congestion window to 200 packets from 100. > > Merge internal change: 53185276 > > Add a DCHECK to ensure the sent packet sequence number never goes down > and separate the send alarm into a send alarm and a resume writes > alarm to be used when the socket is still writable an there may be > more pending data to write. > > Merge internal change: 53050471 > > Merged quic_epoll_connection_helper_test.cc from internal code. > > Minor nit fixes. > > Merge internal change: 53048224 > > Move QuicAckNotifierManager from QuicConnection to > QuicSentPacketManager. > > Merge internal change: 53036185 > > R=jar@chromium.org, rch@chromium.org, wtc@chromium.org > > Review URL: https://codereview.chromium.org/25443002 TBR=rtenneti@chromium.org BUG=303981 Review URL: https://codereview.chromium.org/25727012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_ack_notifier_manager.h')
-rw-r--r--net/quic/quic_ack_notifier_manager.h52
1 files changed, 23 insertions, 29 deletions
diff --git a/net/quic/quic_ack_notifier_manager.h b/net/quic/quic_ack_notifier_manager.h
index 7fe9a46..f3a7f63 100644
--- a/net/quic/quic_ack_notifier_manager.h
+++ b/net/quic/quic_ack_notifier_manager.h
@@ -5,30 +5,20 @@
#ifndef NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_
#define NET_QUIC_QUIC_ACK_NOTIFIER_MANAGER_H_
+#include <list>
#include <map>
+#include <set>
-#include "base/containers/hash_tables.h"
#include "net/quic/quic_protocol.h"
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template<>
-struct hash<net::QuicAckNotifier*> {
- std::size_t operator()(const net::QuicAckNotifier* ptr) const {
- return hash<size_t>()(reinterpret_cast<size_t>(ptr));
- }
-};
-}
-#endif
-
namespace net {
class QuicAckNotifier;
-// The AckNotifierManager is used by the QuicSentPacketManager to keep track of
-// all the AckNotifiers currently active. It owns the AckNotifiers which it gets
-// from the serialized packets passed into OnSerializedPacket. It maintains both
-// a set of AckNotifiers and a map from sequence number to AckNotifier the sake
+// The AckNotifierManager is used by the QuicConnection to keep track of all the
+// AckNotifiers currently active. It owns the AckNotifiers which it gets from
+// the serialized packets passed into OnSerializedPacket. It maintains both a
+// list of AckNotifiers and a map from sequence number to AckNotifier the sake
// of efficiency - we can quickly check the map to see if any AckNotifiers are
// interested in a given sequence number.
@@ -37,7 +27,7 @@ class NET_EXPORT_PRIVATE AckNotifierManager {
AckNotifierManager();
virtual ~AckNotifierManager();
- // Called when the connection receives a new AckFrame. For each packet
+ // Called from QuicConnection when it receives a new AckFrame. For each packet
// in |acked_packets|, if the packet sequence number exists in
// ack_notifier_map_ then the corresponding AckNotifiers will have their OnAck
// method called.
@@ -45,33 +35,37 @@ class NET_EXPORT_PRIVATE AckNotifierManager {
// If a packet has been retransmitted with a new sequence number, then this
// will be called. It updates the mapping in ack_notifier_map_, and also
- // updates the internal set of sequence numbers in each matching AckNotifier.
+ // updates the internal list of sequence numbers in each matching AckNotifier.
void UpdateSequenceNumber(QuicPacketSequenceNumber old_sequence_number,
QuicPacketSequenceNumber new_sequence_number);
- // This is called after a packet has been serialized, is ready to be sent, and
- // contains retransmittable frames (which may have associated AckNotifiers).
- // If any of the retransmittable frames included in |serialized_packet| have
- // AckNotifiers registered, then add them to our internal map and additionally
- // inform the AckNotifier of the sequence number which it should track.
+ // This is called after a packet has been serialized and is ready to be sent.
+ // If any of the frames in |serialized_packet| have AckNotifiers registered,
+ // then add them to our internal map and additionally inform the AckNotifier
+ // of the sequence number which it should track.
void OnSerializedPacket(const SerializedPacket& serialized_packet);
+ // Called from QuicConnection when data is sent which the sender would like to
+ // be notified on receipt of all ACKs. Adds the |notifier| to our map.
+ void AddAckNotifier(QuicAckNotifier* notifier);
+
private:
- typedef base::hash_set<QuicAckNotifier*> AckNotifierSet;
+ typedef std::list<QuicAckNotifier*> AckNotifierList;
+ typedef std::set<QuicAckNotifier*> AckNotifierSet;
typedef std::map<QuicPacketSequenceNumber, AckNotifierSet> AckNotifierMap;
- // On every ACK frame received by the connection, all the ack_notifiers_ will
+ // On every ACK frame received by this connection, all the ack_notifiers_ will
// be told which sequeunce numbers were ACKed.
// Once a given QuicAckNotifier has seen all the sequence numbers it is
- // interested in, it will be deleted, and removed from this set.
- // Owns the AckNotifiers in this set.
- AckNotifierSet ack_notifiers_;
+ // interested in, it will be deleted, and removed from this list.
+ // Owns the AckNotifiers in this list.
+ AckNotifierList ack_notifiers_;
// Maps from sequence number to the AckNotifiers which are registered
// for that sequence number. On receipt of an ACK for a given sequence
// number, call OnAck for all mapped AckNotifiers.
// Does not own the AckNotifiers.
- AckNotifierMap ack_notifier_map_;
+ std::map<QuicPacketSequenceNumber, AckNotifierSet> ack_notifier_map_;
};
} // namespace net