Index: webkit/fileapi/file_system_context.cc |
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc |
index 017cf29f417ed78b3a73a84a6a864fdbf0f909b5..762f24cae9b000040f13ecb399721c795fc875a8 100644 |
--- a/webkit/fileapi/file_system_context.cc |
+++ b/webkit/fileapi/file_system_context.cc |
@@ -359,14 +359,58 @@ FileSystemURL FileSystemContext::CrackFileSystemURL( |
url.type(), |
url.path()); |
if (result.is_valid()) |
- return result; |
+ break; |
} |
+ FileSystemType underlying_mount_type = GetUnderlyingMountType(result); |
+ if (underlying_mount_type != fileapi::kFileSystemTypeUnknown) { |
+ base::FilePath underlying_virtual_path; |
+ if (GetVirtualPath(underlying_mount_type, result.path(), |
+ &underlying_virtual_path)) { |
+ // Note the recursion. |
+ FileSystemURL underlying_url = |
+ CreateCrackedFileSystemURL(result.origin(), |
+ underlying_mount_type, |
+ underlying_virtual_path); |
+ if (underlying_url.is_valid()) { |
+ result.SetUnderlyingURL(underlying_url); |
+ } |
+ } |
+ } |
return result; |
} |
+FileSystemType FileSystemContext::GetUnderlyingMountType( |
+ const FileSystemURL& url) const { |
+ if (external_provider() && |
+ url.is_valid() && |
+ url.type() == fileapi::kFileSystemTypeNativeLocal && |
+ url.mount_type() == fileapi::kFileSystemTypeIsolated) { |
+ return kFileSystemTypeExternal; |
+ } |
+ return kFileSystemTypeUnknown; |
+ |
+} |
+ |
+bool FileSystemContext::GetVirtualPath( |
+ FileSystemType mount_type, |
+ const base::FilePath& full_path, |
+ base::FilePath* virtual_path) const { |
+ DCHECK(virtual_path); |
+ |
+ for (size_t i = 0; i < url_crackers_.size(); ++i) { |
+ if (!url_crackers_[i]->HandlesFileSystemMountType(mount_type)) |
+ continue; |
+ |
+ if (url_crackers_[i]->GetVirtualPath(full_path, virtual_path)) |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
FileSystemFileUtil* FileSystemContext::GetFileUtil( |
- FileSystemType type) const { |
+ fileapi::FileSystemType type) const { |
FileSystemMountPointProvider* mount_point_provider = |
GetMountPointProvider(type); |
if (!mount_point_provider) |