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

Unified Diff: webkit/fileapi/file_system_util.cc

Issue 6904063: String->URL cleanup, chromium-side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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
Index: webkit/fileapi/file_system_util.cc
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index f3e6278e84b970d27a1ac1a625687c8fe9fb9ec9..a88dcd7b9cc25833a651ea143b1e0b3e3c529cc1 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -32,35 +32,9 @@ bool CrackFileSystemURL(const GURL& url, GURL* origin_url, FileSystemType* type,
return false;
std::string temp = url.path();
- // TODO(ericu) remove this code when that ceases to be true, which should be
- // soon.
- // On Windows, this will have backslashes for now.
- // url will look something like:
- // filesystem:http://example.com/temporary/\dir\file.txt
- // temp will look something like:
- // http://example.com/temporary/\dir\file.txt
- // On posix, url will look something like:
- // filesystem:http://example.com/temporary/dir/file.txt
- // temp will look something like:
- // http://example.com/temporary/dir/file.txt
- size_t pos = temp.find('\\');
- for (; pos != std::string::npos; pos = temp.find('\\', pos + 1)) {
- temp[pos] = '/';
- }
- // TODO(ericu): This should probably be done elsewhere after the stackable
- // layers are properly in. We're supposed to reject any paths that contain
- // '..' segments, but the GURL constructor is helpfully resolving them for us.
- // Make sure there aren't any before we call it.
- pos = temp.find("..");
- for (; pos != std::string::npos; pos = temp.find("..", pos + 1)) {
- if ((pos == 0 || temp[pos - 1] == '/') &&
- (pos == temp.length() - 2 || temp[pos + 2] == '/'))
- return false;
- }
// bare_url will look something like:
- // http://example.com/temporary//dir/file.txt [on Windows; the double slash
- // before dir will be single on posix].
+ // http://example.com/temporary/dir/file.txt.
GURL bare_url(temp);
// The input URL was malformed, bail out early.

Powered by Google App Engine
This is Rietveld 408576698