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

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

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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/quic_flags.cc ('k') | net/quic/quic_sent_packet_manager.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 "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "net/quic/crypto/crypto_framer.h" 9 #include "net/quic/crypto/crypto_framer.h"
10 #include "net/quic/crypto/crypto_handshake_message.h" 10 #include "net/quic/crypto/crypto_handshake_message.h"
(...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 QuicDataWriter* writer) { 1952 QuicDataWriter* writer) {
1953 if (!writer->WriteBytes(&frame.stream_id, GetStreamIdSize(frame.stream_id))) { 1953 if (!writer->WriteBytes(&frame.stream_id, GetStreamIdSize(frame.stream_id))) {
1954 LOG(DFATAL) << "Writing stream id size failed."; 1954 LOG(DFATAL) << "Writing stream id size failed.";
1955 return false; 1955 return false;
1956 } 1956 }
1957 if (!writer->WriteBytes(&frame.offset, GetStreamOffsetSize(frame.offset))) { 1957 if (!writer->WriteBytes(&frame.offset, GetStreamOffsetSize(frame.offset))) {
1958 LOG(DFATAL) << "Writing offset size failed."; 1958 LOG(DFATAL) << "Writing offset size failed.";
1959 return false; 1959 return false;
1960 } 1960 }
1961 if (!no_stream_frame_length) { 1961 if (!no_stream_frame_length) {
1962 if ((frame.data.TotalBufferSize() > std::numeric_limits<uint16>::max()) || 1962 if ((frame.data.TotalBufferSize() > numeric_limits<uint16>::max()) ||
1963 !writer->WriteUInt16( 1963 !writer->WriteUInt16(
1964 static_cast<uint16>(frame.data.TotalBufferSize()))) { 1964 static_cast<uint16>(frame.data.TotalBufferSize()))) {
1965 LOG(DFATAL) << "Writing stream frame length failed"; 1965 LOG(DFATAL) << "Writing stream frame length failed";
1966 return false; 1966 return false;
1967 } 1967 }
1968 } 1968 }
1969 1969
1970 if (!writer->WriteIOVector(frame.data)) { 1970 if (!writer->WriteIOVector(frame.data)) {
1971 LOG(DFATAL) << "Writing frame data failed."; 1971 LOG(DFATAL) << "Writing frame data failed.";
1972 return false; 1972 return false;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 2319
2320 bool QuicFramer::RaiseError(QuicErrorCode error) { 2320 bool QuicFramer::RaiseError(QuicErrorCode error) {
2321 DVLOG(1) << "Error detail: " << detailed_error_; 2321 DVLOG(1) << "Error detail: " << detailed_error_;
2322 set_error(error); 2322 set_error(error);
2323 visitor_->OnError(this); 2323 visitor_->OnError(this);
2324 reader_.reset(nullptr); 2324 reader_.reset(nullptr);
2325 return false; 2325 return false;
2326 } 2326 }
2327 2327
2328 } // namespace net 2328 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698