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

Side by Side Diff: net/quic/core/quic_utils.cc

Issue 2515873002: Delete unused HexDecode method. No behavior change. (Closed)
Patch Set: Created 4 years, 1 month 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/core/quic_utils.h ('k') | no next file » | 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/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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 448 }
449 449
450 string QuicUtils::HexEncode(const char* data, size_t length) { 450 string QuicUtils::HexEncode(const char* data, size_t length) {
451 return HexEncode(StringPiece(data, length)); 451 return HexEncode(StringPiece(data, length));
452 } 452 }
453 453
454 string QuicUtils::HexEncode(StringPiece data) { 454 string QuicUtils::HexEncode(StringPiece data) {
455 return ::base::HexEncode(data.data(), data.size()); 455 return ::base::HexEncode(data.data(), data.size());
456 } 456 }
457 457
458 string QuicUtils::HexDecode(const char* data, size_t length) {
459 return HexDecode(StringPiece(data, length));
460 }
461
462 string QuicUtils::HexDecode(StringPiece data) { 458 string QuicUtils::HexDecode(StringPiece data) {
463 if (data.empty()) 459 if (data.empty())
464 return ""; 460 return "";
465 std::vector<uint8_t> v; 461 std::vector<uint8_t> v;
466 if (!base::HexStringToBytes(data.as_string(), &v)) 462 if (!base::HexStringToBytes(data.as_string(), &v))
467 return ""; 463 return "";
468 string out; 464 string out;
469 if (!v.empty()) 465 if (!v.empty())
470 out.assign(reinterpret_cast<const char*>(&v[0]), v.size()); 466 out.assign(reinterpret_cast<const char*>(&v[0]), v.size());
471 return out; 467 return out;
(...skipping 25 matching lines...) Expand all
497 493
498 bytes_remaining -= line_bytes; 494 bytes_remaining -= line_bytes;
499 offset += line_bytes; 495 offset += line_bytes;
500 p += line_bytes; 496 p += line_bytes;
501 s += '\n'; 497 s += '\n';
502 } 498 }
503 return s; 499 return s;
504 } 500 }
505 501
506 } // namespace net 502 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698