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

Unified Diff: net/quic/quic_protocol.h

Issue 1397113003: relnote: Refactor stream buffer allocation out into a scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with TOT Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_protocol.h
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 800b3496a62aa5023fe707b4322fd981d4780994..c942b8d1e3f5436b532d5f12dcfa92a6199d1e38 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -19,6 +19,7 @@
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/int128.h"
#include "net/base/iovec.h"
@@ -696,6 +697,11 @@ struct NET_EXPORT_PRIVATE QuicPingFrame {
// frame.
struct NET_EXPORT_PRIVATE QuicMtuDiscoveryFrame {};
+typedef scoped_ptr<char[]> UniqueStreamBuffer;
+
+// Allocates memory of size |size| for a QUIC stream buffer.
+UniqueStreamBuffer NewStreamBuffer(size_t size);
+
struct NET_EXPORT_PRIVATE QuicStreamFrame {
QuicStreamFrame();
QuicStreamFrame(const QuicStreamFrame& frame);
@@ -1108,7 +1114,7 @@ class NET_EXPORT_PRIVATE RetransmittableFrames {
// Takes ownership of the frame inside |frame|.
const QuicFrame& AddFrame(const QuicFrame& frame);
// Takes ownership of the frame inside |frame| and |buffer|.
- const QuicFrame& AddFrame(const QuicFrame& frame, char* buffer);
+ const QuicFrame& AddFrame(const QuicFrame& frame, UniqueStreamBuffer buffer);
// Removes all stream frames associated with |stream_id|.
void RemoveFramesForStream(QuicStreamId stream_id);
@@ -1132,6 +1138,10 @@ class NET_EXPORT_PRIVATE RetransmittableFrames {
IsHandshake has_crypto_handshake_;
bool needs_padding_;
// Data referenced by the StringPiece of a QuicStreamFrame.
+ //
+ // TODO(rtenneti): Change const char* to UniqueStreamBuffer once chrome has
+ // c++11 library support.
+ // std::vector<UniqueStreamBuffer> stream_data_;
std::vector<const char*> stream_data_;
DISALLOW_COPY_AND_ASSIGN(RetransmittableFrames);
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698