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

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

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_flags.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 10
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 // frame. 733 // frame.
734 struct NET_EXPORT_PRIVATE QuicMtuDiscoveryFrame {}; 734 struct NET_EXPORT_PRIVATE QuicMtuDiscoveryFrame {};
735 735
736 class NET_EXPORT_PRIVATE QuicBufferAllocator { 736 class NET_EXPORT_PRIVATE QuicBufferAllocator {
737 public: 737 public:
738 virtual ~QuicBufferAllocator(); 738 virtual ~QuicBufferAllocator();
739 739
740 // Returns or allocates a new buffer of |size|. Never returns null. 740 // Returns or allocates a new buffer of |size|. Never returns null.
741 virtual char* New(size_t size) = 0; 741 virtual char* New(size_t size) = 0;
742 742
743 // Returns or allocates a new buffer of |size| if |flag_enable| is true.
744 // Otherwise, returns a buffer that is compatible with this class directly
745 // with operator new. Never returns null.
746 virtual char* New(size_t size, bool flag_enable) = 0;
747
743 // Releases a buffer. 748 // Releases a buffer.
744 virtual void Delete(char* buffer) = 0; 749 virtual void Delete(char* buffer) = 0;
750
751 // Marks the allocator as being idle. Serves as a hint to notify the allocator
752 // that it should release any resources it's still holding on to.
753 virtual void MarkAllocatorIdle() {}
745 }; 754 };
746 755
747 // Deleter for stream buffers. Copyable to support platforms where the deleter 756 // Deleter for stream buffers. Copyable to support platforms where the deleter
748 // of a unique_ptr must be copyable. Otherwise it would be nice for this to be 757 // of a unique_ptr must be copyable. Otherwise it would be nice for this to be
749 // move-only. 758 // move-only.
750 class NET_EXPORT_PRIVATE StreamBufferDeleter { 759 class NET_EXPORT_PRIVATE StreamBufferDeleter {
751 public: 760 public:
752 StreamBufferDeleter() : allocator_(nullptr) {} 761 StreamBufferDeleter() : allocator_(nullptr) {}
753 explicit StreamBufferDeleter(QuicBufferAllocator* allocator) 762 explicit StreamBufferDeleter(QuicBufferAllocator* allocator)
754 : allocator_(allocator) {} 763 : allocator_(allocator) {}
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 : iov(iov), iov_count(iov_count), total_length(total_length) {} 1338 : iov(iov), iov_count(iov_count), total_length(total_length) {}
1330 1339
1331 const struct iovec* iov; 1340 const struct iovec* iov;
1332 const int iov_count; 1341 const int iov_count;
1333 const size_t total_length; 1342 const size_t total_length;
1334 }; 1343 };
1335 1344
1336 } // namespace net 1345 } // namespace net
1337 1346
1338 #endif // NET_QUIC_QUIC_PROTOCOL_H_ 1347 #endif // NET_QUIC_QUIC_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698