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

Unified Diff: webkit/browser/fileapi/file_system_url.cc

Issue 336193003: Make FileSystemURL::ToGURL consistent with DOMFileSystemBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: KURL Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/fileapi/file_system_url_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/fileapi/file_system_url.cc
diff --git a/webkit/browser/fileapi/file_system_url.cc b/webkit/browser/fileapi/file_system_url.cc
index 9d366b87dfae560dc5d4746f2e35aae93361b5f4..7e879b3dbba80d9206acd7d9288a58e39b6fa03e 100644
--- a/webkit/browser/fileapi/file_system_url.cc
+++ b/webkit/browser/fileapi/file_system_url.cc
@@ -7,6 +7,8 @@
#include <sstream>
#include "base/logging.h"
+#include "base/strings/string_util.h"
+#include "net/base/escape.h"
#include "webkit/common/fileapi/file_system_types.h"
#include "webkit/common/fileapi/file_system_util.h"
@@ -85,7 +87,14 @@ GURL FileSystemURL::ToGURL() const {
if (url.empty())
return GURL();
- url.append(virtual_path_.AsUTF8Unsafe());
+ // Exactly match with DOMFileSystemBase::createFileSystemURL()'s encoding
+ // behavior, where the path is escaped by KURL::encodeWithURLEscapeSequences
+ // which is essentially encodeURIComponent except '/'.
+ std::string escaped = net::EscapeQueryParamValue(
+ virtual_path_.NormalizePathSeparatorsTo('/').AsUTF8Unsafe(),
+ false /* use_plus */);
+ ReplaceSubstringsAfterOffset(&escaped, 0, "%2F", "/");
+ url.append(escaped);
// Build nested GURL.
return GURL(url);
« no previous file with comments | « content/browser/fileapi/file_system_url_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698