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

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

Issue 1495243002: Remove EncryptionLevel from QUIC's RetransmittableFrames and add it to TransmissionInfo. No functi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108735153
Patch Set: Created 5 years 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_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.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 #include "net/quic/quic_sent_packet_manager.h" 5 #include "net/quic/quic_sent_packet_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 void QuicSentPacketManager::RetransmitUnackedPackets( 340 void QuicSentPacketManager::RetransmitUnackedPackets(
341 TransmissionType retransmission_type) { 341 TransmissionType retransmission_type) {
342 DCHECK(retransmission_type == ALL_UNACKED_RETRANSMISSION || 342 DCHECK(retransmission_type == ALL_UNACKED_RETRANSMISSION ||
343 retransmission_type == ALL_INITIAL_RETRANSMISSION); 343 retransmission_type == ALL_INITIAL_RETRANSMISSION);
344 QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked(); 344 QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
345 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); 345 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
346 it != unacked_packets_.end(); ++it, ++packet_number) { 346 it != unacked_packets_.end(); ++it, ++packet_number) {
347 const RetransmittableFrames* frames = it->retransmittable_frames; 347 const RetransmittableFrames* frames = it->retransmittable_frames;
348 if (frames != nullptr && 348 if (frames != nullptr &&
349 (retransmission_type == ALL_UNACKED_RETRANSMISSION || 349 (retransmission_type == ALL_UNACKED_RETRANSMISSION ||
350 frames->encryption_level() == ENCRYPTION_INITIAL)) { 350 it->encryption_level == ENCRYPTION_INITIAL)) {
351 MarkForRetransmission(packet_number, retransmission_type); 351 MarkForRetransmission(packet_number, retransmission_type);
352 } else if (it->is_fec_packet) { 352 } else if (it->is_fec_packet) {
353 // Remove FEC packets from the packet map, since we can't retransmit them. 353 // Remove FEC packets from the packet map, since we can't retransmit them.
354 unacked_packets_.RemoveFromInFlight(packet_number); 354 unacked_packets_.RemoveFromInFlight(packet_number);
355 } 355 }
356 } 356 }
357 } 357 }
358 358
359 void QuicSentPacketManager::NeuterUnencryptedPackets() { 359 void QuicSentPacketManager::NeuterUnencryptedPackets() {
360 QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked(); 360 QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
361 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); 361 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
362 it != unacked_packets_.end(); ++it, ++packet_number) { 362 it != unacked_packets_.end(); ++it, ++packet_number) {
363 const RetransmittableFrames* frames = it->retransmittable_frames; 363 if (it->retransmittable_frames != nullptr &&
364 if (frames != nullptr && frames->encryption_level() == ENCRYPTION_NONE) { 364 it->encryption_level == ENCRYPTION_NONE) {
365 // Once you're forward secure, no unencrypted packets will be sent, crypto 365 // Once you're forward secure, no unencrypted packets will be sent, crypto
366 // or otherwise. Unencrypted packets are neutered and abandoned, to ensure 366 // or otherwise. Unencrypted packets are neutered and abandoned, to ensure
367 // they are not retransmitted or considered lost from a congestion control 367 // they are not retransmitted or considered lost from a congestion control
368 // perspective. 368 // perspective.
369 pending_retransmissions_.erase(packet_number); 369 pending_retransmissions_.erase(packet_number);
370 unacked_packets_.RemoveFromInFlight(packet_number); 370 unacked_packets_.RemoveFromInFlight(packet_number);
371 unacked_packets_.RemoveRetransmittability(packet_number); 371 unacked_packets_.RemoveRetransmittability(packet_number);
372 } 372 }
373 } 373 }
374 } 374 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 } 459 }
460 } 460 }
461 DCHECK(unacked_packets_.IsUnacked(packet_number)) << packet_number; 461 DCHECK(unacked_packets_.IsUnacked(packet_number)) << packet_number;
462 const TransmissionInfo& transmission_info = 462 const TransmissionInfo& transmission_info =
463 unacked_packets_.GetTransmissionInfo(packet_number); 463 unacked_packets_.GetTransmissionInfo(packet_number);
464 DCHECK(transmission_info.retransmittable_frames); 464 DCHECK(transmission_info.retransmittable_frames);
465 465
466 return PendingRetransmission(packet_number, transmission_type, 466 return PendingRetransmission(packet_number, transmission_type,
467 *transmission_info.retransmittable_frames, 467 *transmission_info.retransmittable_frames,
468 transmission_info.encryption_level,
468 transmission_info.packet_number_length); 469 transmission_info.packet_number_length);
469 } 470 }
470 471
471 QuicPacketNumber QuicSentPacketManager::GetNewestRetransmission( 472 QuicPacketNumber QuicSentPacketManager::GetNewestRetransmission(
472 QuicPacketNumber packet_number, 473 QuicPacketNumber packet_number,
473 const TransmissionInfo& transmission_info) const { 474 const TransmissionInfo& transmission_info) const {
474 if (unacked_packets_.track_single_retransmission()) { 475 if (unacked_packets_.track_single_retransmission()) {
475 QuicPacketNumber retransmission = transmission_info.retransmission; 476 QuicPacketNumber retransmission = transmission_info.retransmission;
476 while (retransmission != 0) { 477 while (retransmission != 0) {
477 packet_number = retransmission; 478 packet_number = retransmission;
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 // Rtt and cwnd do not need to be reset when the peer address change is 998 // Rtt and cwnd do not need to be reset when the peer address change is
998 // considered to be caused by NATs. 999 // considered to be caused by NATs.
999 return; 1000 return;
1000 } 1001 }
1001 1002
1002 rtt_stats_.OnConnectionMigration(); 1003 rtt_stats_.OnConnectionMigration();
1003 send_algorithm_->OnConnectionMigration(); 1004 send_algorithm_->OnConnectionMigration();
1004 } 1005 }
1005 1006
1006 } // namespace net 1007 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698