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

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: 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 b811c27b22e3596fe52d117ba5b2d0c8bc05a321..847e7522e6c56c1e5f1a002475308ef4565afccc 100644
--- a/content/child/fileapi/webfilesystem_impl.cc
+++ b/content/child/fileapi/webfilesystem_impl.cc
@@ -155,6 +155,18 @@ void OpenFileSystemCallbackAdapter(
MakeTuple(UTF8ToUTF16(name), root));
}
+void ResolveURLCallbackAdapter(
+ int thread_id, int callbacks_id,
+ WaitableCallbackResults* waitable_results,
+ const std::string& name, const GURL& root,
+ const base::FilePath& file_path, bool is_directory) {
+ CallbackFileSystemCallbacks(
+ thread_id, callbacks_id, waitable_results,
+ &WebFileSystemCallbacks::didResolveURL,
+ MakeTuple(UTF8ToUTF16(name), root,
+ file_path.AsUTF16Unsafe(), is_directory));
+}
+
void StatusCallbackAdapter(int thread_id, int callbacks_id,
WaitableCallbackResults* waitable_results,
base::PlatformFileError error) {
@@ -338,6 +350,25 @@ void WebFileSystemImpl::openFileSystem(
make_scoped_ptr(waitable_results));
}
+void WebFileSystemImpl::resolveURL(
+ const WebKit::WebURL& storage_partition,
+ WebKit::WebFileSystemCallbacks* callbacks) {
+ int callbacks_id = RegisterCallbacks(callbacks);
+ WaitableCallbackResults* waitable_results =
+ WaitableCallbackResults::MaybeCreate(callbacks);
+ CallDispatcherOnMainThread(
+ main_thread_loop_.get(),
+ &FileSystemDispatcher::ResolveURL,
+ MakeTuple(GURL(storage_partition),
+ 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,
@@ -487,7 +518,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