Index: webkit/fileapi/file_system_url.cc |
diff --git a/webkit/fileapi/file_system_url.cc b/webkit/fileapi/file_system_url.cc |
index d0f8a037c20283c534c3f766cf5bcdceac33a7aa..59f2d371e02c7278763c5148f4cb88e8f93b358e 100644 |
--- a/webkit/fileapi/file_system_url.cc |
+++ b/webkit/fileapi/file_system_url.cc |
@@ -100,7 +100,8 @@ bool FileSystemURL::ParseFileSystemSchemeURL( |
FileSystemURL::FileSystemURL(const GURL& url) |
: type_(kFileSystemTypeUnknown), |
- mount_type_(kFileSystemTypeUnknown) { |
+ mount_type_(kFileSystemTypeUnknown), |
+ has_underlying_url_(false) { |
is_valid_ = ParseFileSystemSchemeURL(url, &origin_, &type_, &path_); |
virtual_path_ = path_; |
mount_type_ = type_; |
@@ -114,7 +115,8 @@ FileSystemURL::FileSystemURL(const GURL& origin, |
type_(type), |
mount_type_(type), |
path_(path.NormalizePathSeparators()), |
- virtual_path_(path.NormalizePathSeparators()) { |
+ virtual_path_(path.NormalizePathSeparators()), |
+ has_underlying_url_(false) { |
} |
FileSystemURL::FileSystemURL(const GURL& origin, |
@@ -129,11 +131,19 @@ FileSystemURL::FileSystemURL(const GURL& origin, |
mount_type_(mount_type), |
path_(cracked_path.NormalizePathSeparators()), |
filesystem_id_(filesystem_id), |
- virtual_path_(virtual_path.NormalizePathSeparators()) { |
+ virtual_path_(virtual_path.NormalizePathSeparators()), |
+ has_underlying_url_(false) { |
} |
FileSystemURL::~FileSystemURL() {} |
+void FileSystemURL::SetUnderlyingURL(const FileSystemURL& underlying_url) { |
+ has_underlying_url_ = true; |
+ underlying_filesystem_id_ = underlying_url.filesystem_id(); |
+ underlying_type_ = underlying_url.type(); |
+ underlying_virtual_path_ = underlying_url.virtual_path(); |
+} |
+ |
std::string FileSystemURL::DebugString() const { |
if (!is_valid_) |
return "invalid filesystem: URL"; |
@@ -160,6 +170,17 @@ bool FileSystemURL::IsParent(const FileSystemURL& child) const { |
path().IsParent(child.path()); |
} |
+FileSystemURL FileSystemURL::GetForOperations() const { |
+ if (!has_underlying_url_) |
+ return *this; |
+ return FileSystemURL(origin_, |
+ mount_type_, |
+ underlying_virtual_path_, |
+ underlying_filesystem_id_, |
+ underlying_type_, |
+ path_); |
+} |
+ |
bool FileSystemURL::operator==(const FileSystemURL& that) const { |
return origin_ == that.origin_ && |
type_ == that.type_ && |