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

Side by Side Diff: net/base/escape.cc

Issue 637023002: Misc. cleanup, primarily removing unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove macros.h change Created 6 years, 2 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 unified diff | Download patch
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/base/escape.h" 5 #include "net/base/escape.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if ((index + 2) >= escaped_text.size()) 107 if ((index + 2) >= escaped_text.size())
108 return false; 108 return false;
109 if (escaped_text[index] != '%') 109 if (escaped_text[index] != '%')
110 return false; 110 return false;
111 const typename STR::value_type most_sig_digit( 111 const typename STR::value_type most_sig_digit(
112 static_cast<typename STR::value_type>(escaped_text[index + 1])); 112 static_cast<typename STR::value_type>(escaped_text[index + 1]));
113 const typename STR::value_type least_sig_digit( 113 const typename STR::value_type least_sig_digit(
114 static_cast<typename STR::value_type>(escaped_text[index + 2])); 114 static_cast<typename STR::value_type>(escaped_text[index + 2]));
115 if (IsHexDigit(most_sig_digit) && IsHexDigit(least_sig_digit)) { 115 if (IsHexDigit(most_sig_digit) && IsHexDigit(least_sig_digit)) {
116 *value = HexDigitToInt(most_sig_digit) * 16 + 116 *value = HexDigitToInt(most_sig_digit) * 16 +
117 HexDigitToInt(least_sig_digit); 117 HexDigitToInt(least_sig_digit);
118 return true; 118 return true;
119 } 119 }
120 return false; 120 return false;
121 } 121 }
122 122
123 // Unescapes |escaped_text| according to |rules|, returning the resulting 123 // Unescapes |escaped_text| according to |rules|, returning the resulting
124 // string. Fills in an |adjustments| parameter, if non-NULL, so it reflects 124 // string. Fills in an |adjustments| parameter, if non-NULL, so it reflects
125 // the alterations done to the string that are not one-character-to-one- 125 // the alterations done to the string that are not one-character-to-one-
126 // character. The resulting |adjustments| will always be sorted by increasing 126 // character. The resulting |adjustments| will always be sorted by increasing
127 // offset. 127 // offset.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 1, kEscapeToChars[i].replacement); 402 1, kEscapeToChars[i].replacement);
403 break; 403 break;
404 } 404 }
405 } 405 }
406 } 406 }
407 } 407 }
408 return text; 408 return text;
409 } 409 }
410 410
411 } // namespace net 411 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698