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

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

Issue 2509033004: Move QuicBufferAllocator into its own .cc/.h. No behavior change. (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 unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/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/core/quic_protocol.h" 5 #include "net/quic/core/quic_protocol.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/core/quic_flags.h" 9 #include "net/quic/core/quic_flags.h"
10 #include "net/quic/core/quic_utils.h" 10 #include "net/quic/core/quic_utils.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 QuicPacketHeader::QuicPacketHeader(const QuicPacketHeader& other) = default; 91 QuicPacketHeader::QuicPacketHeader(const QuicPacketHeader& other) = default;
92 92
93 QuicPublicResetPacket::QuicPublicResetPacket() 93 QuicPublicResetPacket::QuicPublicResetPacket()
94 : nonce_proof(0), rejected_packet_number(0) {} 94 : nonce_proof(0), rejected_packet_number(0) {}
95 95
96 QuicPublicResetPacket::QuicPublicResetPacket( 96 QuicPublicResetPacket::QuicPublicResetPacket(
97 const QuicPacketPublicHeader& header) 97 const QuicPacketPublicHeader& header)
98 : public_header(header), nonce_proof(0), rejected_packet_number(0) {} 98 : public_header(header), nonce_proof(0), rejected_packet_number(0) {}
99 99
100 QuicBufferAllocator::~QuicBufferAllocator() = default;
101
102 void StreamBufferDeleter::operator()(char* buffer) const { 100 void StreamBufferDeleter::operator()(char* buffer) const {
103 if (allocator_ != nullptr && buffer != nullptr) { 101 if (allocator_ != nullptr && buffer != nullptr) {
104 allocator_->Delete(buffer); 102 allocator_->Delete(buffer);
105 } 103 }
106 } 104 }
107 105
108 UniqueStreamBuffer NewStreamBuffer(QuicBufferAllocator* allocator, 106 UniqueStreamBuffer NewStreamBuffer(QuicBufferAllocator* allocator,
109 size_t size) { 107 size_t size) {
110 return UniqueStreamBuffer(allocator->New(size), 108 return UniqueStreamBuffer(allocator->New(size),
111 StreamBufferDeleter(allocator)); 109 StreamBufferDeleter(allocator));
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 is_unackable(false), 741 is_unackable(false),
744 has_crypto_handshake(has_crypto_handshake), 742 has_crypto_handshake(has_crypto_handshake),
745 num_padding_bytes(num_padding_bytes), 743 num_padding_bytes(num_padding_bytes),
746 retransmission(0) {} 744 retransmission(0) {}
747 745
748 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 746 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
749 747
750 TransmissionInfo::~TransmissionInfo() {} 748 TransmissionInfo::~TransmissionInfo() {}
751 749
752 } // namespace net 750 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_simple_buffer_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698