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

Unified Diff: net/quic/quic_protocol.h

Issue 11377096: Change from re-transmitting an packet with a retransmit number to sending a new packet with a new s… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/quic_packet_creator.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('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 e49b6230fbad1b67112545aa84e21b360756b7c6..b91377a3a08f7f0bc2b0a45edaa9ba9c0732afc9 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -35,18 +35,21 @@ const size_t kMaxPacketSize = 1200; // Maximum size in bytes of a QUIC packet.
const size_t kDefaultMaxStreamsPerConnection = 100;
// Size in bytes of the packet header common across all packets.
-const size_t kPacketHeaderSize = 25;
+const size_t kPacketHeaderSize = 24;
// Index of the first byte in a QUIC packet of FEC protected data.
const size_t kStartOfFecProtectedData = kPacketHeaderSize;
// Index of the first byte in a QUIC packet of encrypted data.
const size_t kStartOfEncryptedData = kPacketHeaderSize - 1;
// Index of the first byte in a QUIC packet which is hashed.
const size_t kStartOfHashData = 0;
-// Index into the retransmission offset in the header.
-// (After GUID and sequence number.)
-const int kRetransmissionOffset = 14;
+// Index into the sequence number offset in the header.
+const int kSequenceNumberOffset = 8;
// Index into the transmission time offset in the header.
-const int kTransmissionTimeOffset = 15;
+const int kTransmissionTimeOffset = 14;
+// Index into the flags offset in the header.
+const int kFlagsOffset = 22;
+// Index into the fec group offset in the header.
+const int kFecGroupOffset = 23;
// Size in bytes of all stream frame fields.
const size_t kMinStreamFrameLength = 15;
@@ -145,7 +148,6 @@ struct NET_EXPORT_PRIVATE QuicPacketHeader {
// from the design docs, as well as some elements of DecryptedData.
QuicGuid guid;
QuicPacketSequenceNumber packet_sequence_number;
- uint8 retransmission_count;
QuicTransmissionTime transmission_time;
QuicPacketFlags flags;
QuicFecGroupNumber fec_group;
@@ -352,9 +354,11 @@ class NET_EXPORT_PRIVATE QuicData {
class NET_EXPORT_PRIVATE QuicPacket : public QuicData {
public:
- QuicPacket(char* buffer, size_t length, bool owns_buffer)
+ QuicPacket(
+ char* buffer, size_t length, bool owns_buffer, QuicPacketFlags flags)
: QuicData(buffer, length, owns_buffer),
- buffer_(buffer) { }
+ buffer_(buffer),
+ flags_(flags) { }
base::StringPiece FecProtectedData() const {
return base::StringPiece(data() + kStartOfFecProtectedData,
@@ -369,10 +373,16 @@ class NET_EXPORT_PRIVATE QuicPacket : public QuicData {
return base::StringPiece(data() + kStartOfEncryptedData,
length() - kStartOfEncryptedData);
}
+
+ bool IsFecPacket() const {
+ return flags_ == PACKET_FLAGS_FEC;
+ }
+
char* mutable_data() { return buffer_; }
private:
char* buffer_;
+ const QuicPacketFlags flags_;
DISALLOW_COPY_AND_ASSIGN(QuicPacket);
};
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698