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

Unified Diff: net/quic/core/quic_buffer_allocator.h

Issue 2516033003: Landing Recent QUIC changes until Mon Nov 14 04:43:50 2016 +0000 (Closed)
Patch Set: Remove unused UpdatePacketGapSentHistogram() function. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_bandwidth.h ('k') | net/quic/core/quic_buffer_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_buffer_allocator.h
diff --git a/net/quic/core/quic_buffer_allocator.h b/net/quic/core/quic_buffer_allocator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d9b878ad19d6062314dbadd30f002a2609aa0d47
--- /dev/null
+++ b/net/quic/core/quic_buffer_allocator.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_QUIC_QUIC_BUFFER_ALLOCATOR_H_
+#define NET_QUIC_QUIC_BUFFER_ALLOCATOR_H_
+
+#include <stddef.h>
+
+#include "net/base/net_export.h"
+
+namespace net {
+
+// Abstract base class for classes which allocate and delete buffers.
+class NET_EXPORT_PRIVATE QuicBufferAllocator {
+ public:
+ virtual ~QuicBufferAllocator();
+
+ // Returns or allocates a new buffer of |size|. Never returns null.
+ virtual char* New(size_t size) = 0;
+
+ // Returns or allocates a new buffer of |size| if |flag_enable| is true.
+ // Otherwise, returns a buffer that is compatible with this class directly
+ // with operator new. Never returns null.
+ virtual char* New(size_t size, bool flag_enable) = 0;
+
+ // Releases a buffer.
+ virtual void Delete(char* buffer) = 0;
+
+ // Marks the allocator as being idle. Serves as a hint to notify the allocator
+ // that it should release any resources it's still holding on to.
+ virtual void MarkAllocatorIdle() {}
+};
+
+} // namespace net
+
+#endif // NET_QUIC_QUIC_BUFFER_ALLOCATOR_H_
« no previous file with comments | « net/quic/core/quic_bandwidth.h ('k') | net/quic/core/quic_buffer_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698