From eeed85c4662942e0c9e557d36fa0d26a938058e5 Mon Sep 17 00:00:00 2001 From: "kerz@chromium.org" Date: Wed, 20 Apr 2011 22:19:17 +0000 Subject: Merge 82266 - 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:14225TEST=added new test cases to FileSystemPathManagerTest.*, added FileSystemOperationTest.TestGetLocalFilePathSuccessReview URL: http://codereview.chromium.org/6864040 TBR=zelidrag@chromium.org Review URL: http://codereview.chromium.org/6882102 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@82372 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/fileapi/file_system_file_util_proxy.cc | 44 +++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'webkit/fileapi/file_system_file_util_proxy.cc') diff --git a/webkit/fileapi/file_system_file_util_proxy.cc b/webkit/fileapi/file_system_file_util_proxy.cc index 06a61c4..e5f8628 100644 --- a/webkit/fileapi/file_system_file_util_proxy.cc +++ b/webkit/fileapi/file_system_file_util_proxy.cc @@ -192,6 +192,37 @@ class RelayEnsureFileExists : public MessageLoopRelay { bool created_; }; + +class RelayGetLocalPath : public MessageLoopRelay { + public: + RelayGetLocalPath( + const fileapi::FileSystemOperationContext& context, + const FilePath& virtual_path, + fileapi::FileSystemFileUtilProxy::GetLocalPathCallback* callback) + : MessageLoopRelay(context), + callback_(callback), + virtual_path_(virtual_path) { + DCHECK(callback); + } + + protected: + virtual void RunWork() { + set_error_code( + file_system_file_util()->GetLocalFilePath( + context(), virtual_path_, &local_path_)); + } + + virtual void RunCallback() { + callback_->Run(error_code(), local_path_); + delete callback_; + } + + private: + fileapi::FileSystemFileUtilProxy::GetLocalPathCallback* callback_; + FilePath virtual_path_; + FilePath local_path_; +}; + class RelayGetFileInfo : public MessageLoopRelay { public: RelayGetFileInfo( @@ -437,8 +468,17 @@ bool FileSystemFileUtilProxy::EnsureFileExists( context, message_loop_proxy, file_path, callback)); } -// Retrieves the information about a file. It is invalid to pass NULL for the -// callback. +// static +bool FileSystemFileUtilProxy::GetLocalPath( + const FileSystemOperationContext& context, + scoped_refptr message_loop_proxy, + const FilePath& virtual_path, + GetLocalPathCallback* callback) { + return Start(FROM_HERE, message_loop_proxy, + new RelayGetLocalPath(context, virtual_path, callback)); +} + +// static bool FileSystemFileUtilProxy::GetFileInfo( const FileSystemOperationContext& context, scoped_refptr message_loop_proxy, -- cgit v1.1