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

Unified Diff: Source/web/WebFileSystemCallbacksImpl.cpp

Issue 18411005: Use the async version of WebFileSystem::createFileWriter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 5 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 | « Source/web/WebFileSystemCallbacksImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFileSystemCallbacksImpl.cpp
diff --git a/Source/web/WebFileSystemCallbacksImpl.cpp b/Source/web/WebFileSystemCallbacksImpl.cpp
index 41a00eb582a5230db97f263f436616d300ea5292..b993b3443371b2ebc4cea3503bf7eb7b03179b1f 100644
--- a/Source/web/WebFileSystemCallbacksImpl.cpp
+++ b/Source/web/WebFileSystemCallbacksImpl.cpp
@@ -31,6 +31,7 @@
#include "WebFileSystemCallbacksImpl.h"
#include "AsyncFileSystemChromium.h"
+#include "AsyncFileWriterChromium.h"
#include "WorkerAsyncFileSystemChromium.h"
#include "core/dom/ScriptExecutionContext.h"
#include "core/platform/AsyncFileSystemCallbacks.h"
@@ -39,6 +40,7 @@
#include "public/platform/WebFileSystem.h"
#include "public/platform/WebFileSystemEntry.h"
#include "public/platform/WebString.h"
+#include "public/web/WebFileWriter.h"
#include "wtf/Vector.h"
using namespace WebCore;
@@ -53,6 +55,14 @@ WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSyste
ASSERT(m_callbacks);
}
+WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, PassOwnPtr<AsyncFileWriterChromium> writer)
+ : m_callbacks(callbacks)
+ , m_context(0)
+ , m_writer(writer)
+{
+ ASSERT(m_callbacks);
+}
+
WebFileSystemCallbacksImpl::~WebFileSystemCallbacksImpl()
{
}
@@ -115,6 +125,15 @@ void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const
m_callbacks->didOpenFileSystem(name, rootURL, AsyncFileSystemChromium::create());
}
+void WebFileSystemCallbacksImpl::didCreateFileWriter(WebFileWriter* webFileWriter, long long length)
+{
+ // This object is intended to delete itself on exit.
+ OwnPtr<WebFileSystemCallbacksImpl> callbacks = adoptPtr(this);
+
+ m_writer->setWebFileWriter(adoptPtr(webFileWriter));
+ m_callbacks->didCreateFileWriter(m_writer.release(), length);
+}
+
void WebFileSystemCallbacksImpl::didFail(WebFileError error)
{
m_callbacks->didFail(error);
« no previous file with comments | « Source/web/WebFileSystemCallbacksImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698