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

Unified Diff: net/quic/core/quic_data_reader.cc

Issue 2808273006: Landing Recent QUIC changes until Sun Apr 9 16:12:55 (Closed)
Patch Set: increment enabled_options in e2e test Created 3 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/core/quic_data_reader.h ('k') | net/quic/core/quic_data_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_data_reader.cc
diff --git a/net/quic/core/quic_data_reader.cc b/net/quic/core/quic_data_reader.cc
index 5f2c483338b349e30c36bade5560c222b637a4ee..0f728c9624facbf6e2d7f7ffffafff973103c2dd 100644
--- a/net/quic/core/quic_data_reader.cc
+++ b/net/quic/core/quic_data_reader.cc
@@ -7,6 +7,8 @@
#include "net/base/int128.h"
#include "net/quic/core/quic_flags.h"
#include "net/quic/core/quic_packets.h"
+#include "net/quic/core/quic_utils.h"
+#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_endian.h"
#include "net/quic/platform/api/quic_logging.h"
@@ -99,7 +101,7 @@ bool QuicDataReader::ReadConnectionId(uint64_t* connection_id) {
return false;
}
- if (FLAGS_quic_restart_flag_quic_big_endian_connection_id) {
+ if (QuicUtils::IsConnectionIdWireFormatBigEndian(perspective_)) {
*connection_id = QuicEndian::NetToHost64(*connection_id);
}
@@ -154,4 +156,13 @@ void QuicDataReader::OnFailure() {
pos_ = len_;
}
+uint8_t QuicDataReader::PeekByte() const {
+ if (pos_ >= len_) {
+ QUIC_BUG << "Reading is done, cannot peek next byte. Tried to read pos = "
+ << pos_ << " buffer length = " << len_;
+ return 0;
+ }
+ return data_[pos_];
+}
+
} // namespace net
« no previous file with comments | « net/quic/core/quic_data_reader.h ('k') | net/quic/core/quic_data_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698