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

Side by Side Diff: net/quic/quic_framer.cc

Issue 76723002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation error Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_protocol.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/quic_framer.h" 5 #include "net/quic/quic_framer.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "net/quic/crypto/quic_decrypter.h" 8 #include "net/quic/crypto/quic_decrypter.h"
9 #include "net/quic/crypto/quic_encrypter.h" 9 #include "net/quic/crypto/quic_encrypter.h"
10 #include "net/quic/quic_data_reader.h" 10 #include "net/quic/quic_data_reader.h"
(...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 } 1950 }
1951 1951
1952 size_t largest_observed_offset = writer->length(); 1952 size_t largest_observed_offset = writer->length();
1953 if (!AppendPacketSequenceNumber(PACKET_6BYTE_SEQUENCE_NUMBER, 1953 if (!AppendPacketSequenceNumber(PACKET_6BYTE_SEQUENCE_NUMBER,
1954 frame.received_info.largest_observed, 1954 frame.received_info.largest_observed,
1955 writer)) { 1955 writer)) {
1956 return false; 1956 return false;
1957 } 1957 }
1958 uint32 delta_time_largest_observed_us = kInvalidDeltaTime; 1958 uint32 delta_time_largest_observed_us = kInvalidDeltaTime;
1959 if (!frame.received_info.delta_time_largest_observed.IsInfinite()) { 1959 if (!frame.received_info.delta_time_largest_observed.IsInfinite()) {
1960 DCHECK_LE(0u,
1961 frame.received_info.delta_time_largest_observed.ToMicroseconds());
1960 delta_time_largest_observed_us = 1962 delta_time_largest_observed_us =
1961 frame.received_info.delta_time_largest_observed.ToMicroseconds(); 1963 frame.received_info.delta_time_largest_observed.ToMicroseconds();
1962 } 1964 }
1963 1965
1964 size_t delta_time_largest_observed_offset = writer->length(); 1966 size_t delta_time_largest_observed_offset = writer->length();
1965 if (!writer->WriteUInt32(delta_time_largest_observed_us)) { 1967 if (!writer->WriteUInt32(delta_time_largest_observed_us)) {
1966 return false; 1968 return false;
1967 } 1969 }
1968 1970
1969 // We don't check for overflowing uint8 here, because we only can fit 192 acks 1971 // We don't check for overflowing uint8 here, because we only can fit 192 acks
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 return false; 2090 return false;
2089 } 2091 }
2090 2092
2091 if (!AppendPacketSequenceNumber(largest_observed_length, 2093 if (!AppendPacketSequenceNumber(largest_observed_length,
2092 ack_largest_observed, writer)) { 2094 ack_largest_observed, writer)) {
2093 return false; 2095 return false;
2094 } 2096 }
2095 2097
2096 uint64 delta_time_largest_observed_us = kUFloat16MaxValue; 2098 uint64 delta_time_largest_observed_us = kUFloat16MaxValue;
2097 if (!received_info.delta_time_largest_observed.IsInfinite()) { 2099 if (!received_info.delta_time_largest_observed.IsInfinite()) {
2100 DCHECK_LE(0u,
2101 frame.received_info.delta_time_largest_observed.ToMicroseconds());
2098 delta_time_largest_observed_us = 2102 delta_time_largest_observed_us =
2099 received_info.delta_time_largest_observed.ToMicroseconds(); 2103 received_info.delta_time_largest_observed.ToMicroseconds();
2100 } 2104 }
2101 2105
2102 if (!writer->WriteUFloat16(delta_time_largest_observed_us)) { 2106 if (!writer->WriteUFloat16(delta_time_largest_observed_us)) {
2103 return false; 2107 return false;
2104 } 2108 }
2105 2109
2106 if (ack_info.nack_ranges.empty()) { 2110 if (ack_info.nack_ranges.empty()) {
2107 return true; 2111 return true;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 2282
2279 bool QuicFramer::RaiseError(QuicErrorCode error) { 2283 bool QuicFramer::RaiseError(QuicErrorCode error) {
2280 DLOG(INFO) << detailed_error_; 2284 DLOG(INFO) << detailed_error_;
2281 set_error(error); 2285 set_error(error);
2282 visitor_->OnError(this); 2286 visitor_->OnError(this);
2283 reader_.reset(NULL); 2287 reader_.reset(NULL);
2284 return false; 2288 return false;
2285 } 2289 }
2286 2290
2287 } // namespace net 2291 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698