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

Unified Diff: net/quic/core/quic_packet_creator.cc

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_packet_creator.h ('k') | net/quic/core/quic_packet_creator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_packet_creator.cc
diff --git a/net/quic/core/quic_packet_creator.cc b/net/quic/core/quic_packet_creator.cc
index 2ed4f805d8cdf913e9cf120569cce40ebdb6edd2..b38704525e0a810812963af1f87974e317cc9eca 100644
--- a/net/quic/core/quic_packet_creator.cc
+++ b/net/quic/core/quic_packet_creator.cc
@@ -9,7 +9,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "net/quic/core/crypto/crypto_protocol.h"
-#include "net/quic/core/crypto/quic_random.h"
#include "net/quic/core/quic_bug_tracker.h"
#include "net/quic/core/quic_data_writer.h"
#include "net/quic/core/quic_flags.h"
@@ -30,13 +29,11 @@ namespace net {
QuicPacketCreator::QuicPacketCreator(QuicConnectionId connection_id,
QuicFramer* framer,
- QuicRandom* random_generator,
QuicBufferAllocator* buffer_allocator,
DelegateInterface* delegate)
: delegate_(delegate),
debug_delegate_(nullptr),
framer_(framer),
- random_bool_source_(random_generator),
buffer_allocator_(buffer_allocator),
send_version_in_packet_(framer->perspective() == Perspective::IS_CLIENT),
send_path_id_in_packet_(false),
@@ -51,7 +48,6 @@ QuicPacketCreator::QuicPacketCreator(QuicConnectionId connection_id,
PACKET_1BYTE_PACKET_NUMBER,
nullptr,
0,
- 0,
false,
false) {
SetMaxPacketLength(kDefaultMaxPacketSize);
@@ -423,7 +419,6 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
// unioned with a QuicStreamFrame and a UniqueStreamBuffer.
*num_bytes_consumed = bytes_consumed;
packet_size_ = 0;
- packet_.entropy_hash = QuicFramer::GetPacketEntropyHash(header);
packet_.encrypted_buffer = encrypted_buffer;
packet_.encrypted_length = encrypted_length;
if (listener != nullptr) {
@@ -527,7 +522,6 @@ void QuicPacketCreator::SerializePacket(char* encrypted_buffer,
packet_size_ = 0;
queued_frames_.clear();
- packet_.entropy_hash = QuicFramer::GetPacketEntropyHash(header);
packet_.encrypted_buffer = encrypted_buffer;
packet_.encrypted_length = encrypted_length;
}
@@ -547,7 +541,7 @@ QuicPacketCreator::SerializeVersionNegotiationPacket(
// TODO(jri): Make this a public method of framer?
SerializedPacket QuicPacketCreator::NoPacket() {
return SerializedPacket(kInvalidPathId, 0, PACKET_1BYTE_PACKET_NUMBER,
- nullptr, 0, 0, false, false);
+ nullptr, 0, false, false);
}
void QuicPacketCreator::FillPacketHeader(QuicPacketHeader* header) {
@@ -565,7 +559,6 @@ void QuicPacketCreator::FillPacketHeader(QuicPacketHeader* header) {
header->path_id = packet_.path_id;
header->packet_number = ++packet_.packet_number;
header->public_header.packet_number_length = packet_.packet_number_length;
- header->entropy_flag = random_bool_source_.RandBool();
}
bool QuicPacketCreator::ShouldRetransmit(const QuicFrame& frame) {
@@ -677,20 +670,4 @@ bool QuicPacketCreator::IncludeNonceInPublicHeader() {
packet_.encryption_level == ENCRYPTION_INITIAL;
}
-QuicPacketCreator::QuicRandomBoolSource::QuicRandomBoolSource(
- QuicRandom* random)
- : random_(random), bit_bucket_(0), bit_mask_(0) {}
-
-QuicPacketCreator::QuicRandomBoolSource::~QuicRandomBoolSource() {}
-
-bool QuicPacketCreator::QuicRandomBoolSource::RandBool() {
- if (bit_mask_ == 0) {
- bit_bucket_ = random_->RandUint64();
- bit_mask_ = 1;
- }
- bool result = ((bit_bucket_ & bit_mask_) != 0);
- bit_mask_ <<= 1;
- return result;
-}
-
} // namespace net
« no previous file with comments | « net/quic/core/quic_packet_creator.h ('k') | net/quic/core/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698