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

Unified Diff: net/quic/quic_packet_creator.cc

Issue 1411953005: Remove the QuicPacketGenerator from the PacketTooLarge EndToEndTest and no longer allow too large p… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106400931
Patch Set: Created 5 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 | « no previous file | net/quic/test_tools/quic_packet_creator_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator.cc
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index 2a4a00bce1d9c41cd167ad618f1fe7bc9d3ba49a..e5cda5366f6dba13303a76eb00e284a86a461fbb 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -500,17 +500,8 @@ SerializedPacket QuicPacketCreator::SerializePacket(
ALIGNAS(64) char buffer[kMaxPacketSize];
// Use the packet_size_ instead of the buffer size to ensure smaller
// packet sizes are properly used.
- scoped_ptr<char[]> large_buffer;
- size_t length = 0;
- const bool use_stack_buffer = packet_size_ <= kMaxPacketSize;
- if (use_stack_buffer) {
- length =
- framer_->BuildDataPacket(header, queued_frames_, buffer, packet_size_);
- } else {
- large_buffer.reset(new char[packet_size_]);
- length = framer_->BuildDataPacket(header, queued_frames_,
- large_buffer.get(), packet_size_);
- }
+ size_t length =
+ framer_->BuildDataPacket(header, queued_frames_, buffer, packet_size_);
if (length == 0) {
LOG(DFATAL) << "Failed to serialize " << queued_frames_.size()
<< " frames.";
@@ -519,7 +510,7 @@ SerializedPacket QuicPacketCreator::SerializePacket(
// TODO(ianswett) Consider replacing QuicPacket with something else,
// since it's only used to provide convenience methods to FEC and encryption.
- QuicPacket packet(use_stack_buffer ? buffer : large_buffer.get(), length,
+ QuicPacket packet(buffer, length,
/* owns_buffer */ false,
header.public_header.connection_id_length,
header.public_header.version_flag,
« no previous file with comments | « no previous file | net/quic/test_tools/quic_packet_creator_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698