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

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

Issue 605163004: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0925
Patch Set: Created 6 years, 2 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_protocol_test.cc ('k') | net/quic/quic_sent_packet_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_SENT_PACKET_MANAGER_H_ 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_
6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class NET_EXPORT_PRIVATE DebugDelegate { 45 class NET_EXPORT_PRIVATE DebugDelegate {
46 public: 46 public:
47 virtual ~DebugDelegate() {} 47 virtual ~DebugDelegate() {}
48 48
49 // Called when a spurious retransmission is detected. 49 // Called when a spurious retransmission is detected.
50 virtual void OnSpuriousPacketRetransmition( 50 virtual void OnSpuriousPacketRetransmition(
51 TransmissionType transmission_type, 51 TransmissionType transmission_type,
52 QuicByteCount byte_size) {} 52 QuicByteCount byte_size) {}
53 53
54 virtual void OnSentPacket( 54 virtual void OnSentPacket(
55 QuicPacketSequenceNumber sequence_number, 55 const SerializedPacket& packet,
56 QuicPacketSequenceNumber original_sequence_number,
56 QuicTime sent_time, 57 QuicTime sent_time,
57 QuicByteCount bytes, 58 QuicByteCount bytes,
58 TransmissionType transmission_type) {} 59 TransmissionType transmission_type) {}
59 60
60 virtual void OnRetransmittedPacket(
61 QuicPacketSequenceNumber old_sequence_number,
62 QuicPacketSequenceNumber new_sequence_number,
63 TransmissionType transmission_type,
64 QuicTime time) {}
65
66 virtual void OnIncomingAck( 61 virtual void OnIncomingAck(
67 const QuicAckFrame& ack_frame, 62 const QuicAckFrame& ack_frame,
68 QuicTime ack_receive_time, 63 QuicTime ack_receive_time,
69 QuicPacketSequenceNumber largest_observed, 64 QuicPacketSequenceNumber largest_observed,
70 bool largest_observed_acked, 65 bool largest_observed_acked,
71 QuicPacketSequenceNumber least_unacked_sent_packet) {} 66 QuicPacketSequenceNumber least_unacked_sent_packet) {}
72
73 virtual void OnSerializedPacket(
74 const SerializedPacket& packet) {}
75 }; 67 };
76 68
77 // Interface which gets callbacks from the QuicSentPacketManager when 69 // Interface which gets callbacks from the QuicSentPacketManager when
78 // network-related state changes. Implementations must not mutate the 70 // network-related state changes. Implementations must not mutate the
79 // state of the packet manager as a result of these callbacks. 71 // state of the packet manager as a result of these callbacks.
80 class NET_EXPORT_PRIVATE NetworkChangeVisitor { 72 class NET_EXPORT_PRIVATE NetworkChangeVisitor {
81 public: 73 public:
82 virtual ~NetworkChangeVisitor() {} 74 virtual ~NetworkChangeVisitor() {}
83 75
84 // Called when congestion window may have changed. 76 // Called when congestion window may have changed.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // Retransmission of handshake packets prior to handshake completion. 242 // Retransmission of handshake packets prior to handshake completion.
251 HANDSHAKE_MODE, 243 HANDSHAKE_MODE,
252 // Re-invoke the loss detection when a packet is not acked before the 244 // Re-invoke the loss detection when a packet is not acked before the
253 // loss detection algorithm expects. 245 // loss detection algorithm expects.
254 LOSS_MODE, 246 LOSS_MODE,
255 }; 247 };
256 248
257 typedef linked_hash_map<QuicPacketSequenceNumber, 249 typedef linked_hash_map<QuicPacketSequenceNumber,
258 TransmissionType> PendingRetransmissionMap; 250 TransmissionType> PendingRetransmissionMap;
259 251
260 // Called when a new packet is serialized. If the packet contains
261 // retransmittable data, it will be added to the unacked packet map.
262 void OnSerializedPacket(const SerializedPacket& serialized_packet);
263
264 // Called when a packet is retransmitted with a new sequence number. 252 // Called when a packet is retransmitted with a new sequence number.
265 // Replaces the old entry in the unacked packet map with the new 253 // Replaces the old entry in the unacked packet map with the new
266 // sequence number. 254 // sequence number.
267 void OnRetransmittedPacket(QuicPacketSequenceNumber old_sequence_number, 255 void OnRetransmittedPacket(QuicPacketSequenceNumber old_sequence_number,
268 QuicPacketSequenceNumber new_sequence_number); 256 QuicPacketSequenceNumber new_sequence_number);
269 257
270 // Updates the least_packet_awaited_by_peer. 258 // Updates the least_packet_awaited_by_peer.
271 void UpdatePacketInformationReceivedByPeer(const QuicAckFrame& ack_frame); 259 void UpdatePacketInformationReceivedByPeer(const QuicAckFrame& ack_frame);
272 260
273 // Process the incoming ack looking for newly ack'd data packets. 261 // Process the incoming ack looking for newly ack'd data packets.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // retransmissions. Does not add it to the retransmissions if it's already 312 // retransmissions. Does not add it to the retransmissions if it's already
325 // a pending retransmission. 313 // a pending retransmission.
326 void MarkForRetransmission(QuicPacketSequenceNumber sequence_number, 314 void MarkForRetransmission(QuicPacketSequenceNumber sequence_number,
327 TransmissionType transmission_type); 315 TransmissionType transmission_type);
328 316
329 // Notify observers about spurious retransmits. 317 // Notify observers about spurious retransmits.
330 void RecordSpuriousRetransmissions( 318 void RecordSpuriousRetransmissions(
331 const SequenceNumberList& all_transmissions, 319 const SequenceNumberList& all_transmissions,
332 QuicPacketSequenceNumber acked_sequence_number); 320 QuicPacketSequenceNumber acked_sequence_number);
333 321
322 // Returns true if the client is sending or the server has received a
323 // connection option.
324 bool HasClientSentConnectionOption(const QuicConfig& config,
325 QuicTag tag) const;
326
334 // Newly serialized retransmittable and fec packets are added to this map, 327 // Newly serialized retransmittable and fec packets are added to this map,
335 // which contains owning pointers to any contained frames. If a packet is 328 // which contains owning pointers to any contained frames. If a packet is
336 // retransmitted, this map will contain entries for both the old and the new 329 // retransmitted, this map will contain entries for both the old and the new
337 // packet. The old packet's retransmittable frames entry will be NULL, while 330 // packet. The old packet's retransmittable frames entry will be NULL, while
338 // the new packet's entry will contain the frames to retransmit. 331 // the new packet's entry will contain the frames to retransmit.
339 // If the old packet is acked before the new packet, then the old entry will 332 // If the old packet is acked before the new packet, then the old entry will
340 // be removed from the map and the new entry's retransmittable frames will be 333 // be removed from the map and the new entry's retransmittable frames will be
341 // set to NULL. 334 // set to NULL.
342 QuicUnackedPacketMap unacked_packets_; 335 QuicUnackedPacketMap unacked_packets_;
343 336
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // Records bandwidth from server to client in normal operation, over periods 384 // Records bandwidth from server to client in normal operation, over periods
392 // of time with no loss events. 385 // of time with no loss events.
393 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; 386 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_;
394 387
395 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); 388 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager);
396 }; 389 };
397 390
398 } // namespace net 391 } // namespace net
399 392
400 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ 393 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_protocol_test.cc ('k') | net/quic/quic_sent_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698