| Index: net/tools/dump_cache/url_to_filename_encoder.cc
|
| diff --git a/net/tools/dump_cache/url_to_filename_encoder.cc b/net/tools/dump_cache/url_to_filename_encoder.cc
|
| index b807ec092671b01671277fd1986f97a75d4c7797..d0604641cabc067c4b33295c80c2a4813b8b2172 100644
|
| --- a/net/tools/dump_cache/url_to_filename_encoder.cc
|
| +++ b/net/tools/dump_cache/url_to_filename_encoder.cc
|
| @@ -31,12 +31,11 @@ int HexDigitsPrefix(const char* buf, int num_digits) {
|
| // A simple parser for long long values. Returns the parsed value if a
|
| // valid integer is found; else returns deflt
|
| // UInt64 and Int64 cannot handle decimal numbers with leading 0s.
|
| -uint64 ParseLeadingHex64Value(const char *str, uint64 deflt) {
|
| - char *error = NULL;
|
| +uint64 ParseLeadingHex64Value(const char* str, uint64 deflt) {
|
| + char* error = NULL;
|
| const uint64 value = strtoull(str, &error, 16);
|
| return (error == str) ? deflt : value;
|
| }
|
| -
|
| }
|
|
|
| namespace net {
|
| @@ -169,13 +168,7 @@ void UrlToFilenameEncoder::EncodeSegment(const string& filename_prefix,
|
| bool UrlToFilenameEncoder::Decode(const string& encoded_filename,
|
| char dir_separator,
|
| string* decoded_url) {
|
| - enum State {
|
| - kStart,
|
| - kEscape,
|
| - kFirstDigit,
|
| - kTruncate,
|
| - kEscapeDot
|
| - };
|
| + enum State { kStart, kEscape, kFirstDigit, kTruncate, kEscapeDot };
|
| State state = kStart;
|
| char hex_buffer[3];
|
| hex_buffer[2] = '\0';
|
| @@ -261,8 +254,9 @@ string UrlToFilenameEncoder::LegacyEscape(const string& path) {
|
| char ch = path[index];
|
| if (ch == 0x5C)
|
| last_slash = index;
|
| - if ((ch == 0x2D) || // hyphen
|
| - (ch == 0x5C) || (ch == 0x5F) || // backslash, underscore
|
| + if ((ch == 0x2D) || // hyphen
|
| + (ch == 0x5C) ||
|
| + (ch == 0x5F) || // backslash, underscore
|
| ((0x30 <= ch) && (ch <= 0x39)) || // Digits [0-9]
|
| ((0x41 <= ch) && (ch <= 0x5A)) || // Uppercase [A-Z]
|
| ((0x61 <= ch) && (ch <= 0x7A))) { // Lowercase [a-z]
|
|
|