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>( |