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

Unified Diff: net/quic/quic_data_writer.cc

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_data_writer.h ('k') | net/quic/quic_framer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_data_writer.cc
diff --git a/net/quic/quic_data_writer.cc b/net/quic/quic_data_writer.cc
index 91d8868598bfdd82b99e675d2cfc6fc4b25c50b6..b635b38681a5456c2d79540d3ec14f7a92e2b66d 100644
--- a/net/quic/quic_data_writer.cc
+++ b/net/quic/quic_data_writer.cc
@@ -94,6 +94,25 @@ bool QuicDataWriter::WriteBytes(const void* data, uint32 data_len) {
return true;
}
+void QuicDataWriter::WriteUint8ToBuffer(uint8 value, char* buffer) {
+ memcpy(buffer, &value, sizeof(value));
+}
+
+void QuicDataWriter::WriteUint16ToBuffer(uint16 value, char* buffer) {
+ memcpy(buffer, &value, sizeof(value));
+}
+
+void QuicDataWriter::WriteUint32ToBuffer(uint32 value, char* buffer) {
+ memcpy(buffer, &value, sizeof(value));
+}
+
+void QuicDataWriter::WriteUint48ToBuffer(uint64 value, char* buffer) {
+ uint16 hi = value >> 32;
+ uint32 lo = value & 0x00000000FFFFFFFF;
+ WriteUint32ToBuffer(lo, buffer);
+ WriteUint16ToBuffer(hi, buffer + sizeof(lo));
+}
+
void QuicDataWriter::WriteUint64ToBuffer(uint64 value, char* buffer) {
memcpy(buffer, &value, sizeof(value));
}
« no previous file with comments | « net/quic/quic_data_writer.h ('k') | net/quic/quic_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698