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

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

Issue 1729583003: Deprecate FLAGS_use_stream_frame_freelist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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_flags.cc ('k') | no next file » | 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 QuicPublicResetPacket::QuicPublicResetPacket( 102 QuicPublicResetPacket::QuicPublicResetPacket(
103 const QuicPacketPublicHeader& header) 103 const QuicPacketPublicHeader& header)
104 : public_header(header), nonce_proof(0), rejected_packet_number(0) {} 104 : public_header(header), nonce_proof(0), rejected_packet_number(0) {}
105 105
106 QuicBufferAllocator::~QuicBufferAllocator() = default; 106 QuicBufferAllocator::~QuicBufferAllocator() = default;
107 107
108 void StreamBufferDeleter::operator()(char* buffer) const { 108 void StreamBufferDeleter::operator()(char* buffer) const {
109 if (allocator_ != nullptr && buffer != nullptr) { 109 if (allocator_ != nullptr && buffer != nullptr) {
110 allocator_->Delete(buffer); 110 allocator_->Delete(buffer);
111 if (!FLAGS_use_stream_frame_freelist) {
112 allocator_->MarkAllocatorIdle();
113 }
114 } 111 }
115 } 112 }
116 113
117 UniqueStreamBuffer NewStreamBuffer(QuicBufferAllocator* allocator, 114 UniqueStreamBuffer NewStreamBuffer(QuicBufferAllocator* allocator,
118 size_t size) { 115 size_t size) {
119 return UniqueStreamBuffer( 116 return UniqueStreamBuffer(allocator->New(size),
120 allocator->New(size, FLAGS_use_stream_frame_freelist), 117 StreamBufferDeleter(allocator));
121 StreamBufferDeleter(allocator));
122 } 118 }
123 119
124 QuicStreamFrame::QuicStreamFrame() 120 QuicStreamFrame::QuicStreamFrame()
125 : QuicStreamFrame(0, false, 0, nullptr, 0, nullptr) {} 121 : QuicStreamFrame(0, false, 0, nullptr, 0, nullptr) {}
126 122
127 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, 123 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
128 bool fin, 124 bool fin,
129 QuicStreamOffset offset, 125 QuicStreamOffset offset,
130 StringPiece data) 126 StringPiece data)
131 : QuicStreamFrame(stream_id, 127 : QuicStreamFrame(stream_id,
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 in_flight(false), 794 in_flight(false),
799 is_unackable(false), 795 is_unackable(false),
800 is_fec_packet(is_fec_packet), 796 is_fec_packet(is_fec_packet),
801 has_crypto_handshake(has_crypto_handshake), 797 has_crypto_handshake(has_crypto_handshake),
802 needs_padding(needs_padding), 798 needs_padding(needs_padding),
803 retransmission(0) {} 799 retransmission(0) {}
804 800
805 TransmissionInfo::~TransmissionInfo() {} 801 TransmissionInfo::~TransmissionInfo() {}
806 802
807 } // namespace net 803 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698