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

Unified Diff: content/browser/storage_partition_impl_map.cc

Issue 17653005: Merge StreamContext into ChromeBlobStorageContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « content/browser/resource_context_impl.cc ('k') | content/browser/streams/stream_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/storage_partition_impl_map.cc
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc
index a8b41cc3a052777a5a75c460e30c330c966e1709..ca02b88d9fcfc1f4c44184e55f357c1dbf942901 100644
--- a/content/browser/storage_partition_impl_map.cc
+++ b/content/browser/storage_partition_impl_map.cc
@@ -21,7 +21,6 @@
#include "content/browser/resource_context_impl.h"
#include "content/browser/storage_partition_impl.h"
#include "content/browser/streams/stream.h"
-#include "content/browser/streams/stream_context.h"
#include "content/browser/streams/stream_registry.h"
#include "content/browser/streams/stream_url_request_job.h"
#include "content/browser/webui/url_data_manager_backend.h"
@@ -49,10 +48,8 @@ namespace {
class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
public:
BlobProtocolHandler(ChromeBlobStorageContext* blob_storage_context,
- StreamContext* stream_context,
fileapi::FileSystemContext* file_system_context)
: blob_storage_context_(blob_storage_context),
- stream_context_(stream_context),
file_system_context_(file_system_context) {}
virtual ~BlobProtocolHandler() {}
@@ -63,9 +60,10 @@ class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!webkit_blob_protocol_handler_impl_) {
webkit_blob_protocol_handler_impl_.reset(
- new WebKitBlobProtocolHandlerImpl(blob_storage_context_->controller(),
- stream_context_.get(),
- file_system_context_.get()));
+ new WebKitBlobProtocolHandlerImpl(
+ blob_storage_context_->controller(),
+ blob_storage_context_->stream_registry(),
+ file_system_context_.get()));
}
return webkit_blob_protocol_handler_impl_->MaybeCreateJob(request,
network_delegate);
@@ -79,14 +77,16 @@ class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
public:
WebKitBlobProtocolHandlerImpl(
webkit_blob::BlobStorageController* blob_storage_controller,
- StreamContext* stream_context,
+ StreamRegistry* stream_registry,
fileapi::FileSystemContext* file_system_context)
: webkit_blob::BlobProtocolHandler(
blob_storage_controller,
file_system_context,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
.get()),
- stream_context_(stream_context) {}
+ stream_registry_(stream_registry) {
+ DCHECK(stream_registry);
+ }
virtual ~WebKitBlobProtocolHandlerImpl() {}
@@ -94,7 +94,7 @@ class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const OVERRIDE {
scoped_refptr<Stream> stream =
- stream_context_->registry()->GetStream(request->url());
+ stream_registry_->GetStream(request->url());
if (stream.get())
return new StreamURLRequestJob(request, network_delegate, stream);
@@ -113,12 +113,12 @@ class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
return info->requested_blob_data();
}
- const scoped_refptr<StreamContext> stream_context_;
+ StreamRegistry* const stream_registry_;
+
DISALLOW_COPY_AND_ASSIGN(WebKitBlobProtocolHandlerImpl);
};
const scoped_refptr<ChromeBlobStorageContext> blob_storage_context_;
- const scoped_refptr<StreamContext> stream_context_;
const scoped_refptr<fileapi::FileSystemContext> file_system_context_;
mutable scoped_ptr<WebKitBlobProtocolHandlerImpl>
@@ -411,12 +411,10 @@ StoragePartitionImpl* StoragePartitionImplMap::Get(
ChromeBlobStorageContext* blob_storage_context =
ChromeBlobStorageContext::GetFor(browser_context_);
- StreamContext* stream_context = StreamContext::GetFor(browser_context_);
ProtocolHandlerMap protocol_handlers;
protocol_handlers[chrome::kBlobScheme] =
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
new BlobProtocolHandler(blob_storage_context,
- stream_context,
partition->GetFileSystemContext()));
protocol_handlers[chrome::kFileSystemScheme] =
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
« no previous file with comments | « content/browser/resource_context_impl.cc ('k') | content/browser/streams/stream_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698