OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_handshake_message.h" | 5 #include "net/quic/crypto/crypto_handshake_message.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
10 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 if (i == index) { | 159 if (i == index) { |
160 *out = StringPiece(value.data(), size); | 160 *out = StringPiece(value.data(), size); |
161 return QUIC_NO_ERROR; | 161 return QUIC_NO_ERROR; |
162 } | 162 } |
163 | 163 |
164 value.remove_prefix(size); | 164 value.remove_prefix(size); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 QuicErrorCode CryptoHandshakeMessage::GetUint16(QuicTag tag, | |
169 uint16* out) const { | |
170 return GetPOD(tag, out, sizeof(uint16)); | |
171 } | |
172 | |
173 QuicErrorCode CryptoHandshakeMessage::GetUint32(QuicTag tag, | 168 QuicErrorCode CryptoHandshakeMessage::GetUint32(QuicTag tag, |
174 uint32* out) const { | 169 uint32* out) const { |
175 return GetPOD(tag, out, sizeof(uint32)); | 170 return GetPOD(tag, out, sizeof(uint32)); |
176 } | 171 } |
177 | 172 |
178 QuicErrorCode CryptoHandshakeMessage::GetUint64(QuicTag tag, | 173 QuicErrorCode CryptoHandshakeMessage::GetUint64(QuicTag tag, |
179 uint64* out) const { | 174 uint64* out) const { |
180 return GetPOD(tag, out, sizeof(uint64)); | 175 return GetPOD(tag, out, sizeof(uint64)); |
181 } | 176 } |
182 | 177 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); | 308 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); |
314 } | 309 } |
315 ret += "\n"; | 310 ret += "\n"; |
316 } | 311 } |
317 --indent; | 312 --indent; |
318 ret += string(2 * indent, ' ') + ">"; | 313 ret += string(2 * indent, ' ') + ">"; |
319 return ret; | 314 return ret; |
320 } | 315 } |
321 | 316 |
322 } // namespace net | 317 } // namespace net |
OLD | NEW |