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

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

Issue 1493483002: relnote: Refactor stream buffer allocation out into a unique_ptr with a custom deleter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add back a comment for deleter Created 5 years 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_packet_creator.cc ('k') | net/quic/quic_protocol.cc » ('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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_
6 #define NET_QUIC_QUIC_PROTOCOL_H_ 6 #define NET_QUIC_QUIC_PROTOCOL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <limits> 10 #include <limits>
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 struct NET_EXPORT_PRIVATE QuicPaddingFrame {}; 701 struct NET_EXPORT_PRIVATE QuicPaddingFrame {};
702 702
703 // A ping frame contains no payload, though it is retransmittable, 703 // A ping frame contains no payload, though it is retransmittable,
704 // and ACK'd just like other normal frames. 704 // and ACK'd just like other normal frames.
705 struct NET_EXPORT_PRIVATE QuicPingFrame {}; 705 struct NET_EXPORT_PRIVATE QuicPingFrame {};
706 706
707 // A path MTU discovery frame contains no payload and is serialized as a ping 707 // A path MTU discovery frame contains no payload and is serialized as a ping
708 // frame. 708 // frame.
709 struct NET_EXPORT_PRIVATE QuicMtuDiscoveryFrame {}; 709 struct NET_EXPORT_PRIVATE QuicMtuDiscoveryFrame {};
710 710
711 typedef scoped_ptr<char[]> UniqueStreamBuffer; 711 // Deleter for stream buffers.
712 class NET_EXPORT_PRIVATE StreamBufferDeleter {
713 public:
714 void operator()(char* buf) const;
715 };
716
717 using UniqueStreamBuffer = std::unique_ptr<char[], StreamBufferDeleter>;
712 718
713 // Allocates memory of size |size| for a QUIC stream buffer. 719 // Allocates memory of size |size| for a QUIC stream buffer.
714 UniqueStreamBuffer NewStreamBuffer(size_t size); 720 UniqueStreamBuffer NewStreamBuffer(size_t size);
715 721
716 struct NET_EXPORT_PRIVATE QuicStreamFrame { 722 struct NET_EXPORT_PRIVATE QuicStreamFrame {
717 QuicStreamFrame(); 723 QuicStreamFrame();
718 QuicStreamFrame(QuicStreamId stream_id, 724 QuicStreamFrame(QuicStreamId stream_id,
719 bool fin, 725 bool fin,
720 QuicStreamOffset offset, 726 QuicStreamOffset offset,
721 base::StringPiece data); 727 base::StringPiece data);
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 : iov(iov), iov_count(iov_count), total_length(total_length) {} 1261 : iov(iov), iov_count(iov_count), total_length(total_length) {}
1256 1262
1257 const struct iovec* iov; 1263 const struct iovec* iov;
1258 const int iov_count; 1264 const int iov_count;
1259 const size_t total_length; 1265 const size_t total_length;
1260 }; 1266 };
1261 1267
1262 } // namespace net 1268 } // namespace net
1263 1269
1264 #endif // NET_QUIC_QUIC_PROTOCOL_H_ 1270 #endif // NET_QUIC_QUIC_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698