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

Unified Diff: net/quic/quic_framer.h

Issue 1421593004: Change QuicFramer::BuildDataPacket to return a length instead of QuicPacket* in order to reduce mem… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@105596142
Patch Set: 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 | « no previous file | net/quic/quic_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.h
diff --git a/net/quic/quic_framer.h b/net/quic/quic_framer.h
index b3f5724eda03e97adf54ee03f4bc7357aa0e5b22..26e6995950544954a8c1212bcbed31d01649ce2a 100644
--- a/net/quic/quic_framer.h
+++ b/net/quic/quic_framer.h
@@ -286,13 +286,13 @@ class NET_EXPORT_PRIVATE QuicFramer {
bool includes_version,
QuicPacketNumberLength packet_number_length);
- // Returns a QuicPacket* that is owned by the caller, is created from
- // |frames|. Returns nullptr if the packet could not be created.
- // The packet must be of size |packet_size|.
- QuicPacket* BuildDataPacket(const QuicPacketHeader& header,
- const QuicFrames& frames,
- char* buffer,
- size_t packet_length);
+ // Serializes a packet containing |frames| into |buffer|.
+ // Returns the length of the packet, which must not be longer than
+ // |packet_length|. Returns 0 if it fails to serialize.
+ size_t BuildDataPacket(const QuicPacketHeader& header,
+ const QuicFrames& frames,
+ char* buffer,
+ size_t packet_length);
// Returns a QuicPacket* that is owned by the caller, and is populated with
// the fields in |header| and |fec|. Returns nullptr if the packet could
« no previous file with comments | « no previous file | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698