OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |