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

Unified Diff: net/quic/core/quic_received_packet_manager.h

Issue 2515613002: deprecate FLAGS_quic_disable_pre_34 (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_protocol_test.cc ('k') | net/quic/core/quic_received_packet_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_received_packet_manager.h
diff --git a/net/quic/core/quic_received_packet_manager.h b/net/quic/core/quic_received_packet_manager.h
index 16759ade20b435f6b2a2be85b7be503b0208fdff..1e5b59f143cefb951e532eb0459a66a0b006d633 100644
--- a/net/quic/core/quic_received_packet_manager.h
+++ b/net/quic/core/quic_received_packet_manager.h
@@ -1,9 +1,6 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//
-// Manages the packet entropy calculation for both sent and received packets
-// for a connection.
#ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
#define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
@@ -21,86 +18,17 @@
namespace net {
namespace test {
-class EntropyTrackerPeer;
class QuicConnectionPeer;
class QuicReceivedPacketManagerPeer;
} // namespace test
struct QuicConnectionStats;
-// Records all received packets by a connection and tracks their entropy.
-// Also calculates the correct entropy for the framer when it truncates an ack
-// frame being serialized.
-class NET_EXPORT_PRIVATE QuicReceivedPacketManager
- : public QuicReceivedEntropyHashCalculatorInterface {
+// Records all received packets by a connection.
+class NET_EXPORT_PRIVATE QuicReceivedPacketManager {
public:
- class NET_EXPORT_PRIVATE EntropyTracker {
- public:
- EntropyTracker();
- ~EntropyTracker();
-
- // Compute the XOR of the entropy of all received packets up to
- // and including packet_number.
- // Requires that either:
- // packet_number == largest_observed_
- // or:
- // packet_number > first_gap_ &&
- // packet_number < largest_observed_ &&
- // packet_number in packets_entropy_
- QuicPacketEntropyHash EntropyHash(QuicPacketNumber packet_number) const;
-
- // Record the received entropy hash against |packet_number|.
- // Performs garbage collection to advance first_gap_ if
- // packet_number == first_gap_.
- void RecordPacketEntropyHash(QuicPacketNumber packet_number,
- QuicPacketEntropyHash entropy_hash);
-
- // Sets the entropy hash up to but not including a packet number based
- // on the hash provided by a StopWaiting frame. Clears older packet
- // entropy entries and performs garbage collection up to the first gap.
- void SetCumulativeEntropyUpTo(QuicPacketNumber packet_number,
- QuicPacketEntropyHash entropy_hash);
-
- size_t size() const { return packets_entropy_.size(); }
-
- private:
- friend class test::EntropyTrackerPeer;
-
- // A deque indexed by packet number storing the packet's hash and whether
- // a hash was recorded for that packet number.
- typedef std::deque<std::pair<QuicPacketEntropyHash, bool>>
- ReceivedEntropyHashes;
-
- // Recomputes first_gap_ and removes packets_entropy_ entries that are no
- // longer needed to compute EntropyHash.
- void AdvanceFirstGapAndGarbageCollectEntropyMap();
-
- // Map of received packet numbers to their corresponding entropy.
- // Stores an entry for every received packet whose packet_number is larger
- // than first_gap_. Packets without the entropy bit set have an entropy
- // value of 0.
- ReceivedEntropyHashes packets_entropy_;
-
- // Cumulative hash of entropy of all received packets.
- QuicPacketEntropyHash packets_entropy_hash_;
-
- // packet number of the first packet that we do not know the entropy of.
- // If there are no gaps in the received packet sequence,
- // packets_entropy_ will be empty and first_gap_ will be equal to
- // 'largest_observed_ + 1' since that's the first packet for which
- // entropy is unknown. If there are gaps, packets_entropy_ will
- // contain entries for all received packets with packet_number >
- // first_gap_.
- QuicPacketNumber first_gap_;
-
- // packet number of the largest observed packet.
- QuicPacketNumber largest_observed_;
-
- DISALLOW_COPY_AND_ASSIGN(EntropyTracker);
- };
-
explicit QuicReceivedPacketManager(QuicConnectionStats* stats);
- ~QuicReceivedPacketManager() override;
+ virtual ~QuicReceivedPacketManager();
// Updates the internal state concerning which packets have been received.
// header: the packet header.
@@ -119,12 +47,6 @@ class NET_EXPORT_PRIVATE QuicReceivedPacketManager
// another packet is received, or it will change.
const QuicFrame GetUpdatedAckFrame(QuicTime approximate_now);
- // QuicReceivedEntropyHashCalculatorInterface
- // Called by QuicFramer, when the outgoing ack gets truncated, to recalculate
- // the received entropy hash for the truncated ack frame.
- QuicPacketEntropyHash EntropyHash(
- QuicPacketNumber packet_number) const override;
-
// Updates internal state based on |stop_waiting|.
virtual void UpdatePacketInformationSentByPeer(
const QuicStopWaitingFrame& stop_waiting);
@@ -136,12 +58,6 @@ class NET_EXPORT_PRIVATE QuicReceivedPacketManager
// packets of the largest observed.
virtual bool HasNewMissingPackets() const;
- // Returns the number of packets being tracked in the EntropyTracker.
- size_t NumTrackedPackets() const;
-
- // Sets the mode of packets set of ack_frame_ based on |version|.
- void SetVersion(QuicVersion version);
-
QuicPacketNumber peer_least_packet_awaiting_ack() {
return peer_least_packet_awaiting_ack_;
}
@@ -163,9 +79,6 @@ class NET_EXPORT_PRIVATE QuicReceivedPacketManager
// |least_unacked| unacked, false otherwise.
bool DontWaitForPacketsBefore(QuicPacketNumber least_unacked);
- // Tracks entropy hashes of received packets.
- EntropyTracker entropy_tracker_;
-
// Least packet number of the the packet sent by the peer for which it
// hasn't received an ack.
QuicPacketNumber peer_least_packet_awaiting_ack_;
« no previous file with comments | « net/quic/core/quic_protocol_test.cc ('k') | net/quic/core/quic_received_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698