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

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

Issue 969443002: Deprecating FLAGS_quic_attach_ack_notifiers_to_packets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Remove_RevertRetransmissionTimeout_86651704
Patch Set: Created 5 years, 9 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_flags.h » ('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 #include "net/quic/quic_ack_notifier_manager.h" 5 #include "net/quic/quic_ack_notifier_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 // The old sequence number is no longer of interest, copy the updated 71 // The old sequence number is no longer of interest, copy the updated
72 // AckNotifiers to the new sequence number before deleting the old. 72 // AckNotifiers to the new sequence number before deleting the old.
73 ack_notifier_map_[new_sequence_number] = ack_notifier_list; 73 ack_notifier_map_[new_sequence_number] = ack_notifier_list;
74 ack_notifier_map_.erase(map_it); 74 ack_notifier_map_.erase(map_it);
75 } 75 }
76 76
77 void AckNotifierManager::OnSerializedPacket( 77 void AckNotifierManager::OnSerializedPacket(
78 const SerializedPacket& serialized_packet) { 78 const SerializedPacket& serialized_packet) {
79 if (FLAGS_quic_attach_ack_notifiers_to_packets) { 79 // Inform each attached AckNotifier of the packet's serialization.
80 // Inform each attached AckNotifier of the packet's serialization. 80 AckNotifierList& notifier_list =
81 AckNotifierList& notifier_list = 81 ack_notifier_map_[serialized_packet.sequence_number];
82 ack_notifier_map_[serialized_packet.sequence_number]; 82 for (QuicAckNotifier* notifier : serialized_packet.notifiers) {
83 for (QuicAckNotifier* notifier : serialized_packet.notifiers) { 83 if (notifier == nullptr) {
84 if (notifier == nullptr) { 84 LOG(DFATAL) << "AckNotifier should not be nullptr.";
85 LOG(DFATAL) << "AckNotifier should not be nullptr."; 85 continue;
86 continue;
87 }
88 notifier->OnSerializedPacket();
89
90 // Update the mapping in the other direction, from sequence number to
91 // AckNotifier.
92 notifier_list.push_back(notifier);
93 } 86 }
94 } else { 87 notifier->OnSerializedPacket();
95 // AckNotifiers can only be attached to retransmittable frames. 88 notifier_list.push_back(notifier);
96 RetransmittableFrames* frames = serialized_packet.retransmittable_frames;
97 if (frames == nullptr) {
98 return;
99 }
100
101 // For each frame in |serialized_packet|, inform any attached AckNotifiers
102 // of the packet's sequence number.
103 for (const QuicFrame& quic_frame : frames->frames()) {
104 if (quic_frame.type != STREAM_FRAME ||
105 quic_frame.stream_frame->notifier == nullptr) {
106 continue;
107 }
108
109 QuicAckNotifier* notifier = quic_frame.stream_frame->notifier;
110 notifier->OnSerializedPacket();
111
112 // Update the mapping in the other direction, from sequence number to
113 // AckNotifier.
114 ack_notifier_map_[serialized_packet.sequence_number].push_back(notifier);
115 }
116 } 89 }
117 } 90 }
118 91
119 } // namespace net 92 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698