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

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

Issue 7046077: Revert 88510 - Escaping file names correctly. Also fixed a crush in chromeos debug build while sa... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/base/escape.h ('k') | net/base/escape_unittest.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 std::string EscapePath(const std::string& path) { 205 std::string EscapePath(const std::string& path) {
206 return Escape(path, kPathCharmap, false); 206 return Escape(path, kPathCharmap, false);
207 } 207 }
208 208
209 // non-printable, non-7bit, and (including space) ?>=<;+'&%$#"![\]^`{|} 209 // non-printable, non-7bit, and (including space) ?>=<;+'&%$#"![\]^`{|}
210 static const Charmap kUrlEscape( 210 static const Charmap kUrlEscape(
211 0xffffffffL, 0xf80008fdL, 0x78000001L, 0xb8000001L, 211 0xffffffffL, 0xf80008fdL, 0x78000001L, 0xb8000001L,
212 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL 212 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL
213 ); 213 );
214 214
215 std::string EscapeUrlEncodedData(const std::string& path, 215 std::string EscapeUrlEncodedData(const std::string& path) {
216 bool use_plus) { 216 return Escape(path, kUrlEscape, true);
217 return Escape(path, kUrlEscape, use_plus);
218 } 217 }
219 218
220 // non-7bit 219 // non-7bit
221 static const Charmap kNonASCIICharmap( 220 static const Charmap kNonASCIICharmap(
222 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L, 221 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
223 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL); 222 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL);
224 223
225 std::string EscapeNonASCII(const std::string& input) { 224 std::string EscapeNonASCII(const std::string& input) {
226 return Escape(input, kNonASCIICharmap, false); 225 return Escape(input, kNonASCIICharmap, false);
227 } 226 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 return; 379 return;
381 } 380 }
382 if (offset <= (location + 2)) { 381 if (offset <= (location + 2)) {
383 offset = string16::npos; 382 offset = string16::npos;
384 return; 383 return;
385 } 384 }
386 adjusted_offset -= 2; 385 adjusted_offset -= 2;
387 } 386 }
388 offset = adjusted_offset; 387 offset = adjusted_offset;
389 } 388 }
OLDNEW
« no previous file with comments | « net/base/escape.h ('k') | net/base/escape_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698