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

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

Issue 523813003: Revert of Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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.cc ('k') | net/quic/quic_sent_packet_manager.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_sent_entropy_manager.h" 5 #include "net/quic/quic_sent_entropy_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/base/linked_hash_map.h" 8 #include "net/base/linked_hash_map.h"
9 9
10 using std::make_pair; 10 using std::make_pair;
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 } 42 }
43 43
44 void QuicSentEntropyManager::RecordPacketEntropyHash( 44 void QuicSentEntropyManager::RecordPacketEntropyHash(
45 QuicPacketSequenceNumber sequence_number, 45 QuicPacketSequenceNumber sequence_number,
46 QuicPacketEntropyHash entropy_hash) { 46 QuicPacketEntropyHash entropy_hash) {
47 if (!packets_entropy_.empty()) { 47 if (!packets_entropy_.empty()) {
48 // Ensure packets always are recorded in order. 48 // Ensure packets always are recorded in order.
49 // Every packet's entropy is recorded, even if it's not sent, so there 49 // Every packet's entropy is recorded, even if it's not sent, so there
50 // are not sequence number gaps. 50 // are not sequence number gaps.
51 DCHECK_EQ(GetLargestPacketWithEntropy() + 1, sequence_number); 51 DCHECK_LT(GetLargestPacketWithEntropy(), sequence_number);
52 } 52 }
53 packets_entropy_.push_back(entropy_hash); 53 packets_entropy_.push_back(entropy_hash);
54 DVLOG(2) << "Recorded sequence number " << sequence_number 54 DVLOG(2) << "Recorded sequence number " << sequence_number
55 << " with entropy hash: " << static_cast<int>(entropy_hash); 55 << " with entropy hash: " << static_cast<int>(entropy_hash);
56 } 56 }
57 57
58 QuicPacketEntropyHash QuicSentEntropyManager::GetCumulativeEntropy( 58 QuicPacketEntropyHash QuicSentEntropyManager::GetCumulativeEntropy(
59 QuicPacketSequenceNumber sequence_number) { 59 QuicPacketSequenceNumber sequence_number) {
60 DCHECK_LE(last_cumulative_entropy_.sequence_number, sequence_number); 60 DCHECK_LE(last_cumulative_entropy_.sequence_number, sequence_number);
61 DCHECK_GE(GetLargestPacketWithEntropy(), sequence_number); 61 DCHECK_GE(GetLargestPacketWithEntropy(), sequence_number);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 UpdateCumulativeEntropy(sequence_number, &last_valid_entropy_); 103 UpdateCumulativeEntropy(sequence_number, &last_valid_entropy_);
104 } 104 }
105 while (map_offset_ < sequence_number) { 105 while (map_offset_ < sequence_number) {
106 packets_entropy_.pop_front(); 106 packets_entropy_.pop_front();
107 ++map_offset_; 107 ++map_offset_;
108 } 108 }
109 DVLOG(2) << "Cleared entropy before: " << sequence_number; 109 DVLOG(2) << "Cleared entropy before: " << sequence_number;
110 } 110 }
111 111
112 } // namespace net 112 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698