Index: content/child/fileapi/webfilesystem_impl.cc |
diff --git a/content/child/fileapi/webfilesystem_impl.cc b/content/child/fileapi/webfilesystem_impl.cc |
index ac91214f680229c4ad9b12b00bca1bea7204377d..8a98e8008c8fe8bf74e975dc3b5a5819e0ac24b5 100644 |
--- a/content/child/fileapi/webfilesystem_impl.cc |
+++ b/content/child/fileapi/webfilesystem_impl.cc |
@@ -154,6 +154,19 @@ void OpenFileSystemCallbackAdapter( |
MakeTuple(UTF8ToUTF16(name), root)); |
} |
+void ResolveURLCallbackAdapter( |
+ int thread_id, int callbacks_id, |
+ WaitableCallbackResults* waitable_results, |
+ const fileapi::FileSystemInfo& info, |
+ const base::FilePath& file_path, bool is_directory) { |
+ CallbackFileSystemCallbacks( |
+ thread_id, callbacks_id, waitable_results, |
+ &WebFileSystemCallbacks::didResolveURL, |
+ MakeTuple(UTF8ToUTF16(info.name), info.root_url, |
+ static_cast<WebKit::WebFileSystemType>(info.mount_type), |
+ file_path.AsUTF16Unsafe(), is_directory)); |
+} |
+ |
void StatusCallbackAdapter(int thread_id, int callbacks_id, |
WaitableCallbackResults* waitable_results, |
base::PlatformFileError error) { |
@@ -332,6 +345,25 @@ void WebFileSystemImpl::openFileSystem( |
make_scoped_ptr(waitable_results)); |
} |
+void WebFileSystemImpl::resolveURL( |
+ const WebKit::WebURL& filesystem_url, |
+ WebFileSystemCallbacks callbacks) { |
+ int callbacks_id = RegisterCallbacks(callbacks); |
+ WaitableCallbackResults* waitable_results = |
+ WaitableCallbackResults::MaybeCreate(callbacks); |
+ CallDispatcherOnMainThread( |
+ main_thread_loop_.get(), |
+ &FileSystemDispatcher::ResolveURL, |
+ MakeTuple(GURL(filesystem_url), |
+ base::Bind(&ResolveURLCallbackAdapter, |
+ CurrentWorkerId(), callbacks_id, |
+ base::Unretained(waitable_results)), |
+ base::Bind(&StatusCallbackAdapter, |
+ CurrentWorkerId(), callbacks_id, |
+ base::Unretained(waitable_results))), |
+ make_scoped_ptr(waitable_results)); |
+} |
+ |
void WebFileSystemImpl::deleteFileSystem( |
const WebKit::WebURL& storage_partition, |
WebKit::WebFileSystemType type, |
@@ -481,7 +513,7 @@ void WebFileSystemImpl::fileExists( |
MakeTuple(GURL(path), false /* directory */, |
base::Bind(&StatusCallbackAdapter, |
CurrentWorkerId(), callbacks_id, |
-base::Unretained(waitable_results))), |
+ base::Unretained(waitable_results))), |
make_scoped_ptr(waitable_results)); |
} |