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

Side by Side Diff: net/quic/core/quic_data_reader.cc

Issue 2547583002: Landing Recent QUIC changes until Fri Nov 18 23:21:04 2016 +0000 (Closed)
Patch Set: Remove explicit HTTP/2 enum usage Created 4 years 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
« no previous file with comments | « net/quic/core/quic_crypto_stream.h ('k') | net/quic/core/quic_data_writer.h » ('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 #include "net/quic/core/quic_data_reader.h" 5 #include "net/quic/core/quic_data_reader.h"
6 6
7 #include "net/base/int128.h" 7 #include "net/base/int128.h"
8 #include "net/quic/core/quic_protocol.h" 8 #include "net/quic/core/quic_packets.h"
9 9
10 using base::StringPiece; 10 using base::StringPiece;
11 11
12 namespace net { 12 namespace net {
13 13
14 QuicDataReader::QuicDataReader(const char* data, const size_t len) 14 QuicDataReader::QuicDataReader(const char* data, const size_t len)
15 : data_(data), len_(len), pos_(0) {} 15 : data_(data), len_(len), pos_(0) {}
16 16
17 bool QuicDataReader::ReadUInt16(uint16_t* result) { 17 bool QuicDataReader::ReadUInt16(uint16_t* result) {
18 return ReadBytes(result, sizeof(*result)); 18 return ReadBytes(result, sizeof(*result));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return bytes <= (len_ - pos_); 124 return bytes <= (len_ - pos_);
125 } 125 }
126 126
127 void QuicDataReader::OnFailure() { 127 void QuicDataReader::OnFailure() {
128 // Set our iterator to the end of the buffer so that further reads fail 128 // Set our iterator to the end of the buffer so that further reads fail
129 // immediately. 129 // immediately.
130 pos_ = len_; 130 pos_ = len_;
131 } 131 }
132 132
133 } // namespace net 133 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_stream.h ('k') | net/quic/core/quic_data_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698