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

Unified Diff: net/quic/quic_utils.h

Issue 2121293003: Adds a QuicUtil::HexDump method that provides better debug output of binary data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126089643
Patch Set: Use uppercase hex characters Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_utils.h
diff --git a/net/quic/quic_utils.h b/net/quic/quic_utils.h
index 69e83726ea77a280b49697b76a6ed6e905ab3620..726cef42ad7741491f8becb3b3f7b7936667eebd 100644
--- a/net/quic/quic_utils.h
+++ b/net/quic/quic_utils.h
@@ -143,9 +143,12 @@ class NET_EXPORT_PRIVATE QuicUtils {
static std::string HexDecode(const char* data, size_t length);
static std::string HexDecode(base::StringPiece data);
- // Converts binary data into an ASCII string. Each character in the resulting
- // string is preceeded by a space, and replaced with a '.' if not printable.
- static std::string BinaryToAscii(base::StringPiece binary);
+ // Returns a std::string containing hex and ASCII representations of |binary|,
+ // side-by-side in the style of hexdump. Non-printable characters will be
+ // printed as '.' in the ASCII output.
+ // For example:
+ // "48 65 6c 6c 6f 2c 20 51 55 49 43 21 01 02 03 04 |Hello, QUIC!....|"
+ static std::string HexDump(base::StringPiece binary_data);
private:
DISALLOW_COPY_AND_ASSIGN(QuicUtils);
« no previous file with comments | « no previous file | net/quic/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698