Chromium Code Reviews| Index: webkit/fileapi/file_system_url.cc |
| diff --git a/webkit/fileapi/file_system_url.cc b/webkit/fileapi/file_system_url.cc |
| index ab0c2d8f6838d4f6f578ff9c4d8108b8c2be3943..9af4032e703f16819a16bdaa758c6f51703d0905 100644 |
| --- a/webkit/fileapi/file_system_url.cc |
| +++ b/webkit/fileapi/file_system_url.cc |
| @@ -15,7 +15,7 @@ FileSystemURL::FileSystemURL() |
| FileSystemURL::FileSystemURL(const GURL& url) |
| : type_(kFileSystemTypeUnknown) { |
| - is_valid_ = CrackFileSystemURL(url, &origin_, &type_, &path_); |
| + is_valid_ = CrackFileSystemURL(url, &origin_, &type_, &virtual_path_); |
| MayCrackIsolatedPath(); |
| } |
| @@ -25,7 +25,7 @@ FileSystemURL::FileSystemURL( |
| const FilePath& path) |
| : origin_(origin), |
| type_(type), |
| - path_(path), |
| + virtual_path_(path), |
| is_valid_(true) { |
| MayCrackIsolatedPath(); |
| } |
| @@ -36,27 +36,31 @@ std::string FileSystemURL::spec() const { |
| if (!is_valid_) |
| return std::string(); |
| return GetFileSystemRootURI(origin_, type_).spec() + "/" + |
| - path_.AsUTF8Unsafe(); |
| + virtual_path_.AsUTF8Unsafe(); |
| } |
| FileSystemURL FileSystemURL::WithPath(const FilePath& path) const { |
| - return FileSystemURL(origin(), type(), path); |
| + FileSystemURL url(*this); |
| + url.path_ = path; |
|
tzik
2012/08/20 03:58:50
Could you invalidate virtual_path here?
kinuko
2012/08/20 08:54:35
Done.
|
| + return url; |
| } |
| bool FileSystemURL::operator==(const FileSystemURL& that) const { |
| return origin_ == that.origin_ && |
| type_ == that.type_ && |
| path_ == that.path_ && |
| + virtual_path_ == that.virtual_path_ && |
| filesystem_id_ == that.filesystem_id_ && |
| is_valid_ == that.is_valid_; |
| } |
| void FileSystemURL::MayCrackIsolatedPath() { |
| - if (is_valid_ && type_ == kFileSystemTypeIsolated) { |
| + path_ = virtual_path_; |
| + if (is_valid_ && IsolatedContext::IsIsolatedType(type_)) { |
| // If the type is isolated, crack the path further to get the 'real' |
| // filesystem type and path. |
| is_valid_ = IsolatedContext::GetInstance()->CrackIsolatedPath( |
| - path_, &filesystem_id_, &type_, &path_); |
| + virtual_path_, &filesystem_id_, &type_, &path_); |
| } |
| } |