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

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

Issue 22363002: 2nd try: Support synchronous mode in WebFileWriterImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | content/child/fileapi/webfilewriter_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/fileapi/webfilesystem_impl.cc
diff --git a/content/child/fileapi/webfilesystem_impl.cc b/content/child/fileapi/webfilesystem_impl.cc
index 78952b57c702da9d081ef85e2f57f190a42052f2..052bce489c929cdec5ea9746d026648ff83fff42 100644
--- a/content/child/fileapi/webfilesystem_impl.cc
+++ b/content/child/fileapi/webfilesystem_impl.cc
@@ -252,8 +252,11 @@ void DidCreateFileWriter(
callbacks->didFail(WebKit::WebFileErrorInvalidState);
return;
}
+ WebFileWriterImpl::Type type = callbacks->shouldBlockUntilCompletion() ?
+ WebFileWriterImpl::TYPE_SYNC : WebFileWriterImpl::TYPE_ASYNC;
callbacks->didCreateFileWriter(
- new WebFileWriterImpl(path, client, main_thread_loop), file_info.size);
+ new WebFileWriterImpl(path, client, type, main_thread_loop),
+ file_info.size);
}
void CreateFileWriterCallbackAdapter(
@@ -488,7 +491,9 @@ base::Unretained(waitable_results))),
WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter(
const WebURL& path, WebKit::WebFileWriterClient* client) {
- return new WebFileWriterImpl(GURL(path), client, main_thread_loop_.get());
+ return new WebFileWriterImpl(GURL(path), client,
+ WebFileWriterImpl::TYPE_ASYNC,
+ main_thread_loop_.get());
}
void WebFileSystemImpl::createFileWriter(
« no previous file with comments | « no previous file | content/child/fileapi/webfilewriter_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698