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

Unified Diff: webkit/fileapi/syncable/canned_syncable_file_system.cc

Issue 11416382: ********** Content tests with blob hacking. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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: webkit/fileapi/syncable/canned_syncable_file_system.cc
===================================================================
--- webkit/fileapi/syncable/canned_syncable_file_system.cc (revision 186525)
+++ webkit/fileapi/syncable/canned_syncable_file_system.cc (working copy)
@@ -12,6 +12,7 @@
#include "base/single_thread_task_runner.h"
#include "base/task_runner_util.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/blob/blob_storage_context.h"
#include "webkit/blob/mock_blob_url_request_context.h"
#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
@@ -124,11 +125,11 @@
public:
WriteHelper() : bytes_written_(0) {}
WriteHelper(MockBlobURLRequestContext* request_context,
- const GURL& blob_url,
+ const std::string& blob_id,
const std::string& blob_data)
: bytes_written_(0),
request_context_(request_context),
- blob_data_(new ScopedTextBlob(*request_context, blob_url, blob_data)) {}
+ blob_data_(new ScopedTextBlob(*request_context, blob_id, blob_data)) {}
~WriteHelper() {
if (request_context_)
@@ -146,6 +147,8 @@
? bytes_written_ : static_cast<int64>(error));
}
+ ScopedTextBlob* scoped_text_blob() const { return blob_data_.get(); }
+
private:
int64 bytes_written_;
scoped_ptr<MockBlobURLRequestContext> request_context_;
@@ -389,12 +392,12 @@
int64 CannedSyncableFileSystem::Write(
net::URLRequestContext* url_request_context,
- const FileSystemURL& url, const GURL& blob_url) {
+ const FileSystemURL& url, scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle) {
return RunOnThread<int64>(
io_task_runner_,
FROM_HERE,
base::Bind(&CannedSyncableFileSystem::DoWrite,
- base::Unretained(this), url_request_context, url, blob_url));
+ base::Unretained(this), url_request_context, url, base::Passed(&blob_data_handle)));
}
int64 CannedSyncableFileSystem::WriteString(
@@ -553,11 +556,12 @@
void CannedSyncableFileSystem::DoWrite(
net::URLRequestContext* url_request_context,
- const FileSystemURL& url, const GURL& blob_url,
+ const FileSystemURL& url,
+ scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle,
const WriteCallback& callback) {
EXPECT_TRUE(is_filesystem_opened_);
WriteHelper* helper = new WriteHelper;
- NewOperation()->Write(url_request_context, url, blob_url, 0,
+ NewOperation()->Write(url_request_context, url, blob_data_handle.Pass(), 0,
base::Bind(&WriteHelper::DidWrite,
base::Owned(helper), callback));
}
@@ -568,9 +572,10 @@
const WriteCallback& callback) {
MockBlobURLRequestContext* url_request_context(
new MockBlobURLRequestContext(file_system_context_));
- const GURL blob_url(std::string("blob:") + data);
- WriteHelper* helper = new WriteHelper(url_request_context, blob_url, data);
- NewOperation()->Write(url_request_context, url, blob_url, 0,
+ const std::string blob_id(std::string("blob:") + data);
+ WriteHelper* helper = new WriteHelper(url_request_context, blob_id, data);
+ NewOperation()->Write(url_request_context, url,
+ helper->scoped_text_blob()->GetBlobDataHandle(), 0,
base::Bind(&WriteHelper::DidWrite,
base::Owned(helper), callback));
}
« no previous file with comments | « webkit/fileapi/syncable/canned_syncable_file_system.h ('k') | webkit/fileapi/syncable/local_file_change_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698