Index: webkit/tools/test_shell/simple_file_writer.cc |
=================================================================== |
--- webkit/tools/test_shell/simple_file_writer.cc (revision 186525) |
+++ webkit/tools/test_shell/simple_file_writer.cc (working copy) |
@@ -9,6 +9,7 @@ |
#include "base/logging.h" |
#include "base/message_loop_proxy.h" |
#include "net/url_request/url_request_context.h" |
+#include "webkit/blob/blob_storage_context.h" |
#include "webkit/fileapi/file_system_context.h" |
#include "webkit/fileapi/file_system_operation.h" |
#include "webkit/fileapi/file_system_types.h" |
@@ -24,7 +25,8 @@ |
using WebKit::WebString; |
using WebKit::WebURL; |
-net::URLRequestContext* SimpleFileWriter::request_context_ = NULL; |
+net::URLRequestContext* SimpleFileWriter::request_context_; |
+webkit_blob::BlobStorageContext* SimpleFileWriter::blob_storage_context_; |
// Helper class to proxy to write and truncate calls to the IO thread, |
// and to proxy the results back to the main thead. There is a one-to-one |
@@ -58,11 +60,13 @@ |
base::Bind(&IOThreadProxy::DidFinish, this)); |
} |
- void Write(const FileSystemURL& url, const GURL& blob_url, int64 offset) { |
+ void Write(const FileSystemURL& url, |
+ const std::string& blob_uuid, |
+ int64 offset) { |
if (!io_thread_->BelongsToCurrentThread()) { |
io_thread_->PostTask( |
FROM_HERE, |
- base::Bind(&IOThreadProxy::Write, this, url, blob_url, offset)); |
+ base::Bind(&IOThreadProxy::Write, this, url, blob_uuid, offset)); |
return; |
} |
if (FailIfNotWritable(url)) |
@@ -70,7 +74,9 @@ |
DCHECK(request_context_); |
DCHECK(!operation_); |
operation_ = GetNewOperation(url); |
- operation_->Write(request_context_, url, blob_url, offset, |
+ scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle = |
+ blob_storage_context_->GetBlobDataFromUUID(blob_uuid); |
+ operation_->Write(request_context_, url, blob_data_handle.Pass(), offset, |
base::Bind(&IOThreadProxy::DidWrite, this)); |
} |
@@ -195,9 +201,9 @@ |
} |
void SimpleFileWriter::DoWrite( |
- const GURL& path, const GURL& blob_url, int64 offset) { |
+ const GURL& path, const std::string& blob_uuid, int64 offset) { |
FileSystemURL url = file_system_context_->CrackURL(path); |
- io_thread_proxy_->Write(url, blob_url, offset); |
+ io_thread_proxy_->Write(url, blob_uuid, offset); |
} |
void SimpleFileWriter::DoCancel() { |