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

Unified Diff: net/quic/quic_data_writer.cc

Issue 14287009: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with Tot Created 7 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 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_data_writer_test.cc » ('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 f90670f181930655997de5399cc2baec2162bc00..4182d9a4d294023508f75f5168915c9a3155e10d 100644
--- a/net/quic/quic_data_writer.cc
+++ b/net/quic/quic_data_writer.cc
@@ -109,18 +109,30 @@ void QuicDataWriter::WritePadding() {
bool QuicDataWriter::WriteUInt8ToOffset(uint8 value, size_t offset) {
DCHECK_LT(offset, capacity_);
- int latched_length = length_;
+ size_t latched_length = length_;
length_ = offset;
bool success = WriteUInt8(value);
+ DCHECK_LE(length_, latched_length);
+ length_ = latched_length;
+ return success;
+}
+
+bool QuicDataWriter::WriteUInt32ToOffset(uint32 value, size_t offset) {
+ DCHECK_LT(offset, capacity_);
+ size_t latched_length = length_;
+ length_ = offset;
+ bool success = WriteUInt32(value);
+ DCHECK_LE(length_, latched_length);
length_ = latched_length;
return success;
}
bool QuicDataWriter::WriteUInt48ToOffset(uint64 value, size_t offset) {
DCHECK_LT(offset, capacity_);
- int latched_length = length_;
+ size_t latched_length = length_;
length_ = offset;
bool success = WriteUInt48(value);
+ DCHECK_LE(length_, latched_length);
length_ = latched_length;
return success;
}
« no previous file with comments | « net/quic/quic_data_writer.h ('k') | net/quic/quic_data_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698