diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 09:05:52 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 09:05:52 +0000 |
commit | 24dceafb754bd1b9c80ad5c2c989746dd72705e4 (patch) | |
tree | 1bb0166649e403aa6dc2fd01362be5f3007aedb5 /webkit/fileapi/local_file_system_file_util.cc | |
parent | af6c3fc4b98a7248c8081275c42b5ffdc621452c (diff) | |
download | chromium_src-24dceafb754bd1b9c80ad5c2c989746dd72705e4.zip chromium_src-24dceafb754bd1b9c80ad5c2c989746dd72705e4.tar.gz chromium_src-24dceafb754bd1b9c80ad5c2c989746dd72705e4.tar.bz2 |
Fixed file/directory url resolution for external mount point provider.
Per Eric's request, refactored FileSystemDirURLRequestJob and FileSystemURLRequestJob classes to resolve local file system through a new operation.
BUG=chromium-os:14225
TEST=added new test cases to FileSystemPathManagerTest.*, added FileSystemOperationTest.TestGetLocalFilePathSuccess
Review URL: http://codereview.chromium.org/6864040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/local_file_system_file_util.cc')
-rw-r--r-- | webkit/fileapi/local_file_system_file_util.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/webkit/fileapi/local_file_system_file_util.cc b/webkit/fileapi/local_file_system_file_util.cc index 068a052..7dad5b1 100644 --- a/webkit/fileapi/local_file_system_file_util.cc +++ b/webkit/fileapi/local_file_system_file_util.cc @@ -44,6 +44,20 @@ PlatformFileError LocalFileSystemFileUtil::EnsureFileExists( context, local_path, created); } +PlatformFileError LocalFileSystemFileUtil::GetLocalFilePath( + FileSystemOperationContext* context, + const FilePath& virtual_path, + FilePath* local_path) { + FilePath path = + GetLocalPath(context, context->src_origin_url(), context->src_type(), + virtual_path); + if (path.empty()) + return base::PLATFORM_FILE_ERROR_NOT_FOUND; + + *local_path = path; + return base::PLATFORM_FILE_OK; +} + PlatformFileError LocalFileSystemFileUtil::GetFileInfo( FileSystemOperationContext* context, const FilePath& file_path, @@ -170,7 +184,8 @@ FilePath LocalFileSystemFileUtil::GetLocalPath( FileSystemType type, const FilePath& virtual_path) { FilePath root = context->file_system_context()->path_manager()-> - GetFileSystemRootPathOnFileThread(origin_url, type, virtual_path, false); + ValidateFileSystemRootAndGetPathOnFileThread(origin_url, type, + virtual_path, false); if (root.empty()) return FilePath(); return root.Append(virtual_path); |