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

Side by Side Diff: net/quic/core/quic_buffered_packet_store.cc

Issue 2403983002: 35. relnote: Call QuicBufferedPacketStore::MaybeSetExpirationAlarm instead of setting alarm directl… (Closed)
Patch Set: Created 4 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/core/quic_buffered_packet_store.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/core/quic_buffered_packet_store.h" 5 #include "net/quic/core/quic_buffered_packet_store.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/quic/core/quic_bug_tracker.h" 10 #include "net/quic/core/quic_bug_tracker.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 auto& entry = undecryptable_packets_.front(); 167 auto& entry = undecryptable_packets_.front();
168 if (entry.second.creation_time > expiration_time) { 168 if (entry.second.creation_time > expiration_time) {
169 break; 169 break;
170 } 170 }
171 QuicConnectionId connection_id = entry.first; 171 QuicConnectionId connection_id = entry.first;
172 visitor_->OnExpiredPackets(connection_id, std::move(entry.second)); 172 visitor_->OnExpiredPackets(connection_id, std::move(entry.second));
173 undecryptable_packets_.erase(undecryptable_packets_.begin()); 173 undecryptable_packets_.erase(undecryptable_packets_.begin());
174 connections_with_chlo_.erase(connection_id); 174 connections_with_chlo_.erase(connection_id);
175 } 175 }
176 if (!undecryptable_packets_.empty()) { 176 if (!undecryptable_packets_.empty()) {
177 expiration_alarm_->Set(clock_->ApproximateNow() + connection_life_span_); 177 MaybeSetExpirationAlarm();
178 } 178 }
179 } 179 }
180 180
181 void QuicBufferedPacketStore::MaybeSetExpirationAlarm() { 181 void QuicBufferedPacketStore::MaybeSetExpirationAlarm() {
182 if (!expiration_alarm_->IsSet()) { 182 if (!expiration_alarm_->IsSet()) {
183 expiration_alarm_->Set(clock_->ApproximateNow() + connection_life_span_); 183 expiration_alarm_->Set(clock_->ApproximateNow() + connection_life_span_);
184 } 184 }
185 } 185 }
186 186
187 bool QuicBufferedPacketStore::ShouldBufferPacket(bool is_chlo) { 187 bool QuicBufferedPacketStore::ShouldBufferPacket(bool is_chlo) {
(...skipping 26 matching lines...) Expand all
214 DCHECK(!packets.empty()) << "Try to deliver connectons without CHLO"; 214 DCHECK(!packets.empty()) << "Try to deliver connectons without CHLO";
215 return packets; 215 return packets;
216 } 216 }
217 217
218 bool QuicBufferedPacketStore::HasChloForConnection( 218 bool QuicBufferedPacketStore::HasChloForConnection(
219 QuicConnectionId connection_id) { 219 QuicConnectionId connection_id) {
220 return base::ContainsKey(connections_with_chlo_, connection_id); 220 return base::ContainsKey(connections_with_chlo_, connection_id);
221 } 221 }
222 222
223 } // namespace net 223 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_buffered_packet_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698