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

Side by Side Diff: net/quic/crypto/crypto_framer.cc

Issue 761903003: Update from https://crrev.com/306655 (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/crypto/cert_compressor.cc ('k') | net/quic/crypto/crypto_utils.cc » ('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/crypto/crypto_framer.h" 5 #include "net/quic/crypto/crypto_framer.h"
6 6
7 #include "net/quic/crypto/crypto_protocol.h" 7 #include "net/quic/crypto/crypto_protocol.h"
8 #include "net/quic/quic_data_reader.h" 8 #include "net/quic/quic_data_reader.h"
9 #include "net/quic/quic_data_writer.h" 9 #include "net/quic/quic_data_writer.h"
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (num_entries > kMaxEntries) { 105 if (num_entries > kMaxEntries) {
106 return nullptr; 106 return nullptr;
107 } 107 }
108 108
109 109
110 QuicDataWriter writer(len); 110 QuicDataWriter writer(len);
111 if (!writer.WriteUInt32(message.tag())) { 111 if (!writer.WriteUInt32(message.tag())) {
112 DCHECK(false) << "Failed to write message tag."; 112 DCHECK(false) << "Failed to write message tag.";
113 return nullptr; 113 return nullptr;
114 } 114 }
115 if (!writer.WriteUInt16(num_entries)) { 115 if (!writer.WriteUInt16(static_cast<uint16>(num_entries))) {
116 DCHECK(false) << "Failed to write size."; 116 DCHECK(false) << "Failed to write size.";
117 return nullptr; 117 return nullptr;
118 } 118 }
119 if (!writer.WriteUInt16(0)) { 119 if (!writer.WriteUInt16(0)) {
120 DCHECK(false) << "Failed to write padding."; 120 DCHECK(false) << "Failed to write padding.";
121 return nullptr; 121 return nullptr;
122 } 122 }
123 123
124 uint32 end_offset = 0; 124 uint32 end_offset = 0;
125 // Tags and offsets 125 // Tags and offsets
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 *end_offset += pad_length; 281 *end_offset += pad_length;
282 if (!writer->WriteUInt32(*end_offset)) { 282 if (!writer->WriteUInt32(*end_offset)) {
283 DCHECK(false) << "Failed to write end offset."; 283 DCHECK(false) << "Failed to write end offset.";
284 return false; 284 return false;
285 } 285 }
286 return true; 286 return true;
287 } 287 }
288 288
289 } // namespace net 289 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/cert_compressor.cc ('k') | net/quic/crypto/crypto_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698