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

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

Issue 241483004: Fixed a bug in QuicPacketCreator when FEC was used for unsupported (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/quic/quic_packet_creator.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 // Accumulates frames for the next packet until more frames no longer fit or 5 // Accumulates frames for the next packet until more frames no longer fit or
6 // it's time to create a packet from them. Also provides packet creation of 6 // it's time to create a packet from them. Also provides packet creation of
7 // FEC packets based on previously created packets. 7 // FEC packets based on previously created packets.
8 8
9 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ 9 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_
10 #define NET_QUIC_QUIC_PACKET_CREATOR_H_ 10 #define NET_QUIC_QUIC_PACKET_CREATOR_H_
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 SerializedPacket SerializeAllFrames(const QuicFrames& frames); 108 SerializedPacket SerializeAllFrames(const QuicFrames& frames);
109 109
110 // Re-serializes frames with the original packet's sequence number length. 110 // Re-serializes frames with the original packet's sequence number length.
111 // Used for retransmitting packets to ensure they aren't too long. 111 // Used for retransmitting packets to ensure they aren't too long.
112 SerializedPacket ReserializeAllFrames( 112 SerializedPacket ReserializeAllFrames(
113 const QuicFrames& frames, QuicSequenceNumberLength original_length); 113 const QuicFrames& frames, QuicSequenceNumberLength original_length);
114 114
115 // Returns true if there are frames pending to be serialized. 115 // Returns true if there are frames pending to be serialized.
116 bool HasPendingFrames(); 116 bool HasPendingFrames();
117 117
118 // Returns IN_FEC_GROUP or NOT_IN_FEC_GROUP, depending on whether FEC is
119 // enabled or not. Note: This does not mean that an FEC group is currently
120 // active; i.e., fec_group_.get() may still be NULL.
121 // TODO(jri): Straighten out naming: Enabling FEC for the connection
122 // should use FEC_ENABLED/DISABLED, and IN_FEC_GROUP/NOT_IN_FEC_GROUP should
123 // be used if a given packet is in an fec group.
124 InFecGroup IsFecEnabled() const;
125
118 // Returns the number of bytes which are available to be used by additional 126 // Returns the number of bytes which are available to be used by additional
119 // frames in the packet. Since stream frames are slightly smaller when they 127 // frames in the packet. Since stream frames are slightly smaller when they
120 // are the last frame in a packet, this method will return a different 128 // are the last frame in a packet, this method will return a different
121 // value than max_packet_size - PacketSize(), in this case. 129 // value than max_packet_size - PacketSize(), in this case.
122 size_t BytesFree() const; 130 size_t BytesFree() const;
123 131
124 // Returns the number of bytes that the packet will expand by if a new frame 132 // Returns the number of bytes that the packet will expand by if a new frame
125 // is added to the packet. If the last frame was a stream frame, it will 133 // is added to the packet. If the last frame was a stream frame, it will
126 // expand slightly when a new frame is added, and this method returns the 134 // expand slightly when a new frame is added, and this method returns the
127 // amount of expected expansion. If the packet is in an FEC group, no 135 // amount of expected expansion. If the packet is in an FEC group, no
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 mutable size_t packet_size_; 233 mutable size_t packet_size_;
226 QuicFrames queued_frames_; 234 QuicFrames queued_frames_;
227 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; 235 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_;
228 236
229 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); 237 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator);
230 }; 238 };
231 239
232 } // namespace net 240 } // namespace net
233 241
234 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ 242 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_
OLDNEW
« 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