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

Unified Diff: content/child/fileapi/webfilesystem_impl.cc

Issue 23856002: SyncFS: Support resolveLocalFileSystemURL on SyncFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add struct FileSystemInfo, and change file path manipulation Created 7 years, 3 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: content/child/fileapi/webfilesystem_impl.cc
diff --git a/content/child/fileapi/webfilesystem_impl.cc b/content/child/fileapi/webfilesystem_impl.cc
index 2c3de4dc0b279dce31b505a4992f80d5787671cc..6b569b683ef61f8f5715afdca2ecfedb83699ccc 100644
--- a/content/child/fileapi/webfilesystem_impl.cc
+++ b/content/child/fileapi/webfilesystem_impl.cc
@@ -163,6 +163,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.filesystem_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) {
@@ -347,6 +360,25 @@ void WebFileSystemImpl::openFileSystem(
make_scoped_ptr(waitable_results));
}
+void WebFileSystemImpl::resolveURL(
+ const WebKit::WebURL& filesystem_url,
+ WebFileSystemCallbacksType 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,
@@ -496,7 +528,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));
}

Powered by Google App Engine
This is Rietveld 408576698