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/core/crypto/crypto_handshake_message.h" | 5 #include "net/quic/core/crypto/crypto_handshake_message.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/string_number_conversions.h" | |
11 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
12 #include "net/quic/core/crypto/crypto_framer.h" | 11 #include "net/quic/core/crypto/crypto_framer.h" |
13 #include "net/quic/core/crypto/crypto_protocol.h" | 12 #include "net/quic/core/crypto/crypto_protocol.h" |
14 #include "net/quic/core/crypto/crypto_utils.h" | 13 #include "net/quic/core/crypto/crypto_utils.h" |
15 #include "net/quic/core/quic_socket_address_coder.h" | 14 #include "net/quic/core/quic_socket_address_coder.h" |
16 #include "net/quic/core/quic_utils.h" | 15 #include "net/quic/core/quic_utils.h" |
| 16 #include "net/quic/platform/api/quic_text_utils.h" |
17 | 17 |
18 using base::ContainsKey; | 18 using base::ContainsKey; |
19 using base::StringPiece; | 19 using base::StringPiece; |
20 using base::StringPrintf; | 20 using base::StringPrintf; |
21 using std::string; | 21 using std::string; |
22 | 22 |
23 namespace net { | 23 namespace net { |
24 | 24 |
25 CryptoHandshakeMessage::CryptoHandshakeMessage() : tag_(0), minimum_size_(0) {} | 25 CryptoHandshakeMessage::CryptoHandshakeMessage() : tag_(0), minimum_size_(0) {} |
26 | 26 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 case kMSPC: | 227 case kMSPC: |
228 case kSRBF: | 228 case kSRBF: |
229 case kSWND: | 229 case kSWND: |
230 case kMIDS: | 230 case kMIDS: |
231 case kSCLS: | 231 case kSCLS: |
232 case kTCID: | 232 case kTCID: |
233 // uint32_t value | 233 // uint32_t value |
234 if (it->second.size() == 4) { | 234 if (it->second.size() == 4) { |
235 uint32_t value; | 235 uint32_t value; |
236 memcpy(&value, it->second.data(), sizeof(value)); | 236 memcpy(&value, it->second.data(), sizeof(value)); |
237 ret += base::UintToString(value); | 237 ret += QuicTextUtils::Uint64ToString(value); |
238 done = true; | 238 done = true; |
239 } | 239 } |
240 break; | 240 break; |
241 case kRCID: | 241 case kRCID: |
242 // uint64_t value | 242 // uint64_t value |
243 if (it->second.size() == 8) { | 243 if (it->second.size() == 8) { |
244 uint64_t value; | 244 uint64_t value; |
245 memcpy(&value, it->second.data(), sizeof(value)); | 245 memcpy(&value, it->second.data(), sizeof(value)); |
246 ret += base::Uint64ToString(value); | 246 ret += QuicTextUtils::Uint64ToString(value); |
247 done = true; | 247 done = true; |
248 } | 248 } |
249 break; | 249 break; |
250 case kTBKP: | 250 case kTBKP: |
251 case kKEXS: | 251 case kKEXS: |
252 case kAEAD: | 252 case kAEAD: |
253 case kCOPT: | 253 case kCOPT: |
254 case kPDMD: | 254 case kPDMD: |
255 case kVER: | 255 case kVER: |
256 // tag lists | 256 // tag lists |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 case kSNI: | 312 case kSNI: |
313 case kUAID: | 313 case kUAID: |
314 ret += "\"" + it->second + "\""; | 314 ret += "\"" + it->second + "\""; |
315 done = true; | 315 done = true; |
316 break; | 316 break; |
317 } | 317 } |
318 | 318 |
319 if (!done) { | 319 if (!done) { |
320 // If there's no specific format for this tag, or the value is invalid, | 320 // If there's no specific format for this tag, or the value is invalid, |
321 // then just use hex. | 321 // then just use hex. |
322 ret += "0x" + QuicUtils::HexEncode(it->second); | 322 ret += "0x" + QuicTextUtils::HexEncode(it->second); |
323 } | 323 } |
324 ret += "\n"; | 324 ret += "\n"; |
325 } | 325 } |
326 --indent; | 326 --indent; |
327 ret += string(2 * indent, ' ') + ">"; | 327 ret += string(2 * indent, ' ') + ">"; |
328 return ret; | 328 return ret; |
329 } | 329 } |
330 | 330 |
331 } // namespace net | 331 } // namespace net |
OLD | NEW |