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

Unified Diff: net/quic/quic_packet_creator.h

Issue 1464153002: Add ConsumeData method to QuicPacketCreator, ConsumeData wraps both CreateStreamFrame and AddFrame.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@107699435
Patch Set: Created 5 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 | « no previous file | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator.h
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index 31646ec7bdf8cba269ef6be80e813981aa8db22e..c89a382476122cfd78661a333eeb321102912482 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -74,22 +74,22 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
QuicStreamOffset offset,
InFecGroup is_in_fec_group);
+ // Converts a raw payload to a stream frame (which fits into the currently
+ // open packet) and adds the frame to the packet. The payload begins at
+ // |iov_offset| into the |iov|.
+ // Creates |frame| and returns true if succeeds, false otherwise.
+ bool ConsumeData(QuicStreamId id,
+ QuicIOVector iov,
+ size_t iov_offset,
+ QuicStreamOffset offset,
+ bool fin,
+ bool needs_padding,
+ QuicFrame* frame);
+
+ // Returns true if currently open packet can accommodate more stream frames of
+ // stream |id| at |offset|, false otherwise.
bool HasRoomForStreamFrame(QuicStreamId id, QuicStreamOffset offset) const;
- // Converts a raw payload to a frame which fits into the currently open
- // packet. The payload begins at |iov_offset| into the |iov|.
- // Returns the number of bytes consumed from data.
- // If data is empty and fin is true, the expected behavior is to consume the
- // fin but return 0. If any data is consumed, it will be copied into a
- // new buffer that |frame| will point to and will be stored in |buffer|.
- size_t CreateStreamFrame(QuicStreamId id,
- QuicIOVector iov,
- size_t iov_offset,
- QuicStreamOffset offset,
- bool fin,
- QuicFrame* frame,
- UniqueStreamBuffer* buffer);
-
// Serializes all frames into a single packet. All frames must fit into a
// single packet. Also, sets the entropy hash of the serialized packet to a
// random bool and returns that value as a member of SerializedPacket.
@@ -235,6 +235,20 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
static bool ShouldRetransmit(const QuicFrame& frame);
+ // Converts a raw payload to a frame which fits into the currently open
+ // packet. The payload begins at |iov_offset| into the |iov|.
+ // Returns the number of bytes consumed from data.
+ // If data is empty and fin is true, the expected behavior is to consume the
+ // fin but return 0. If any data is consumed, it will be copied into a
+ // new buffer that |frame| will point to and will be stored in |buffer|.
+ size_t CreateStreamFrame(QuicStreamId id,
+ QuicIOVector iov,
+ size_t iov_offset,
+ QuicStreamOffset offset,
+ bool fin,
+ QuicFrame* frame,
+ UniqueStreamBuffer* buffer);
+
// Copies |length| bytes from iov starting at offset |iov_offset| into buffer.
// |iov| must be at least iov_offset+length total length and buffer must be
// at least |length| long.
« no previous file with comments | « no previous file | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698