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, |