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

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

Issue 1577473002: relnote: QUIC streamable frames can now use a freelist for their packet buffers, Guarded by gfe2_fe… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@19_CL_111440524
Patch Set: cast to size_t Created 4 years, 11 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.h ('k') | net/quic/quic_simple_buffer_allocator.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_protocol.h" 5 #include "net/quic/quic_protocol.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/quic_flags.h" 8 #include "net/quic/quic_flags.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 QuicPublicResetPacket::QuicPublicResetPacket( 100 QuicPublicResetPacket::QuicPublicResetPacket(
101 const QuicPacketPublicHeader& header) 101 const QuicPacketPublicHeader& header)
102 : public_header(header), nonce_proof(0), rejected_packet_number(0) {} 102 : public_header(header), nonce_proof(0), rejected_packet_number(0) {}
103 103
104 QuicBufferAllocator::~QuicBufferAllocator() = default; 104 QuicBufferAllocator::~QuicBufferAllocator() = default;
105 105
106 void StreamBufferDeleter::operator()(char* buffer) const { 106 void StreamBufferDeleter::operator()(char* buffer) const {
107 if (allocator_ != nullptr && buffer != nullptr) { 107 if (allocator_ != nullptr && buffer != nullptr) {
108 allocator_->Delete(buffer); 108 allocator_->Delete(buffer);
109 if (!FLAGS_use_stream_frame_freelist) {
110 allocator_->MarkAllocatorIdle();
111 }
109 } 112 }
110 } 113 }
111 114
112 UniqueStreamBuffer NewStreamBuffer(QuicBufferAllocator* allocator, 115 UniqueStreamBuffer NewStreamBuffer(QuicBufferAllocator* allocator,
113 size_t size) { 116 size_t size) {
114 return UniqueStreamBuffer(allocator->New(size), 117 return UniqueStreamBuffer(
115 StreamBufferDeleter(allocator)); 118 allocator->New(size, FLAGS_use_stream_frame_freelist),
119 StreamBufferDeleter(allocator));
116 } 120 }
117 121
118 QuicStreamFrame::QuicStreamFrame() 122 QuicStreamFrame::QuicStreamFrame()
119 : QuicStreamFrame(0, false, 0, nullptr, 0, nullptr) {} 123 : QuicStreamFrame(0, false, 0, nullptr, 0, nullptr) {}
120 124
121 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, 125 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
122 bool fin, 126 bool fin,
123 QuicStreamOffset offset, 127 QuicStreamOffset offset,
124 StringPiece data) 128 StringPiece data)
125 : QuicStreamFrame(stream_id, 129 : QuicStreamFrame(stream_id,
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 transmission_type(transmission_type), 870 transmission_type(transmission_type),
867 in_flight(false), 871 in_flight(false),
868 is_unackable(false), 872 is_unackable(false),
869 is_fec_packet(is_fec_packet), 873 is_fec_packet(is_fec_packet),
870 all_transmissions(nullptr), 874 all_transmissions(nullptr),
871 retransmission(0) {} 875 retransmission(0) {}
872 876
873 TransmissionInfo::~TransmissionInfo() {} 877 TransmissionInfo::~TransmissionInfo() {}
874 878
875 } // namespace net 879 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_simple_buffer_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698