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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc

Issue 11103027: Support filesystem files from BlobURLRequestJob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 2 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/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
index 4cf8b62449519170ce0c907c627e5425f2b0e86e..ec166a6911823af8af7d70bccb217d62dcb6927d 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -622,8 +622,10 @@ class ScopedItemVectorCanceller {
class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
public:
explicit TestProtocolHandler(
- webkit_blob::BlobStorageController* blob_storage_controller)
- : blob_storage_controller_(blob_storage_controller) {}
+ webkit_blob::BlobStorageController* blob_storage_controller,
+ fileapi::FileSystemContext* file_system_context)
+ : blob_storage_controller_(blob_storage_controller),
+ file_system_context_(file_system_context) {}
virtual ~TestProtocolHandler() {}
@@ -634,22 +636,26 @@ class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
request,
network_delegate,
blob_storage_controller_->GetBlobDataFromUrl(request->url()),
+ file_system_context_,
base::MessageLoopProxy::current());
}
private:
webkit_blob::BlobStorageController* const blob_storage_controller_;
+ fileapi::FileSystemContext* const file_system_context_;
DISALLOW_COPY_AND_ASSIGN(TestProtocolHandler);
};
class TestURLRequestContext : public net::URLRequestContext {
public:
- TestURLRequestContext()
+ explicit TestURLRequestContext(
+ fileapi::FileSystemContext* file_system_context)
: blob_storage_controller_(new webkit_blob::BlobStorageController) {
// Job factory owns the protocol handler.
job_factory_.SetProtocolHandler(
- "blob", new TestProtocolHandler(blob_storage_controller_.get()));
+ "blob", new TestProtocolHandler(blob_storage_controller_.get(),
+ file_system_context));
set_job_factory(&job_factory_);
}
@@ -739,7 +745,7 @@ class HTML5FileWriter {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
CHECK_EQ(base::PLATFORM_FILE_OK, result);
blob_data_->AppendData(payload_);
- url_request_context_.reset(new TestURLRequestContext());
+ url_request_context_.reset(new TestURLRequestContext(fs_));
url_request_context_->blob_storage_controller()->AddFinishedBlob(
blob_url(), blob_data_);
operation()->Write(
« no previous file with comments | « no previous file | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698