Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Unified Diff: webkit/fileapi/file_system_file_util_proxy.cc

Issue 6864040: Fixed file/directory url resolution for external mount point provider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/file_system_file_util_proxy.cc
===================================================================
--- webkit/fileapi/file_system_file_util_proxy.cc (revision 82259)
+++ webkit/fileapi/file_system_file_util_proxy.cc (working copy)
@@ -192,6 +192,37 @@
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 @@
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<MessageLoopProxy> 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<MessageLoopProxy> message_loop_proxy,

Powered by Google App Engine
This is Rietveld 408576698