Chromium Code Reviews| 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..547e14ae3160eba2f8017ca64ff2f80c74608885 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()); |
| + // To exactly match with DOMFileSystemBase::createFileSystemURL()'s encoding |
| + // behavior. There the path is escaped by KRUL::encodeWithURLEscapeSequences, |
|
tzik
2014/06/17 02:19:27
KURL?
kinaba
2014/06/17 02:26:10
Done.
|
| + // 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); |