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/core/quic_utils.h" | 5 #include "net/quic/core/quic_utils.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 uint32_t option = 0; | 374 uint32_t option = 0; |
375 for (char token_char : base::Reversed(token)) { | 375 for (char token_char : base::Reversed(token)) { |
376 option <<= 8; | 376 option <<= 8; |
377 option |= static_cast<unsigned char>(token_char); | 377 option |= static_cast<unsigned char>(token_char); |
378 } | 378 } |
379 options.push_back(option); | 379 options.push_back(option); |
380 } | 380 } |
381 return options; | 381 return options; |
382 } | 382 } |
383 | 383 |
| 384 string QuicUtils::ListTags(QuicTagValueMap tag_map) { |
| 385 string result; |
| 386 for (auto entry : tag_map) { |
| 387 result.append(TagToString(entry.first) + " "); |
| 388 } |
| 389 return result; |
| 390 } |
| 391 |
384 string QuicUtils::PeerAddressChangeTypeToString(PeerAddressChangeType type) { | 392 string QuicUtils::PeerAddressChangeTypeToString(PeerAddressChangeType type) { |
385 switch (type) { | 393 switch (type) { |
386 RETURN_STRING_LITERAL(NO_CHANGE); | 394 RETURN_STRING_LITERAL(NO_CHANGE); |
387 RETURN_STRING_LITERAL(PORT_CHANGE); | 395 RETURN_STRING_LITERAL(PORT_CHANGE); |
388 RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE); | 396 RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE); |
389 RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE); | 397 RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE); |
390 RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE); | 398 RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE); |
391 RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE); | 399 RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE); |
392 RETURN_STRING_LITERAL(UNSPECIFIED_CHANGE); | 400 RETURN_STRING_LITERAL(UNSPECIFIED_CHANGE); |
393 } | 401 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 573 |
566 bytes_remaining -= line_bytes; | 574 bytes_remaining -= line_bytes; |
567 offset += line_bytes; | 575 offset += line_bytes; |
568 p += line_bytes; | 576 p += line_bytes; |
569 s += '\n'; | 577 s += '\n'; |
570 } | 578 } |
571 return s; | 579 return s; |
572 } | 580 } |
573 | 581 |
574 } // namespace net | 582 } // namespace net |
OLD | NEW |