Index: content/browser/storage_partition_impl_map.cc |
=================================================================== |
--- content/browser/storage_partition_impl_map.cc (revision 183651) |
+++ content/browser/storage_partition_impl_map.cc (working copy) |
@@ -35,78 +35,18 @@ |
#include "net/url_request/url_request_context.h" |
#include "webkit/appcache/view_appcache_internals_job.h" |
#include "webkit/blob/blob_data.h" |
+#include "webkit/blob/blob_storage_context.h" |
#include "webkit/blob/blob_url_request_job_factory.h" |
#include "webkit/fileapi/file_system_url_request_job_factory.h" |
using appcache::AppCacheService; |
using fileapi::FileSystemContext; |
-using webkit_blob::BlobStorageController; |
+using webkit_blob::BlobStorageContext; |
namespace content { |
namespace { |
-class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { |
- public: |
- BlobProtocolHandler(ChromeBlobStorageContext* blob_storage_context, |
- fileapi::FileSystemContext* file_system_context) |
- : blob_storage_context_(blob_storage_context), |
- file_system_context_(file_system_context) {} |
- |
- virtual ~BlobProtocolHandler() {} |
- |
- virtual net::URLRequestJob* MaybeCreateJob( |
- net::URLRequest* request, |
- net::NetworkDelegate* network_delegate) const OVERRIDE { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- if (!webkit_blob_protocol_handler_impl_) { |
- webkit_blob_protocol_handler_impl_.reset( |
- new WebKitBlobProtocolHandlerImpl(blob_storage_context_->controller(), |
- file_system_context_)); |
- } |
- return webkit_blob_protocol_handler_impl_->MaybeCreateJob(request, |
- network_delegate); |
- } |
- |
- private: |
- // An implementation of webkit_blob::BlobProtocolHandler that gets |
- // the BlobData from ResourceRequestInfoImpl. |
- class WebKitBlobProtocolHandlerImpl |
- : public webkit_blob::BlobProtocolHandler { |
- public: |
- WebKitBlobProtocolHandlerImpl( |
- webkit_blob::BlobStorageController* blob_storage_controller, |
- fileapi::FileSystemContext* file_system_context) |
- : webkit_blob::BlobProtocolHandler( |
- blob_storage_controller, file_system_context, |
- BrowserThread::GetMessageLoopProxyForThread( |
- BrowserThread::FILE)) {} |
- |
- virtual ~WebKitBlobProtocolHandlerImpl() {} |
- |
- private: |
- // webkit_blob::BlobProtocolHandler implementation. |
- virtual scoped_refptr<webkit_blob::BlobData> |
- LookupBlobData(net::URLRequest* request) const OVERRIDE { |
- const ResourceRequestInfoImpl* info = |
- ResourceRequestInfoImpl::ForRequest(request); |
- if (!info) |
- return NULL; |
- return info->requested_blob_data(); |
- } |
- |
- DISALLOW_COPY_AND_ASSIGN(WebKitBlobProtocolHandlerImpl); |
- }; |
- |
- const scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
- const scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
- |
- mutable scoped_ptr<WebKitBlobProtocolHandlerImpl> |
- webkit_blob_protocol_handler_impl_; |
- |
- DISALLOW_COPY_AND_ASSIGN(BlobProtocolHandler); |
-}; |
- |
// Adds a bunch of debugging urls. We use an interceptor instead of a protocol |
// handler because we want to reuse the chrome://scheme (everyone is familiar |
// with it, and no need to expose the content/chrome separation through our UI). |
@@ -115,7 +55,7 @@ |
public: |
DeveloperProtocolHandler( |
AppCacheService* appcache_service, |
- ChromeBlobStorageContext* blob_storage_context) |
+ BlobStorageContext* blob_storage_context) |
: appcache_service_(appcache_service), |
blob_storage_context_(blob_storage_context) {} |
virtual ~DeveloperProtocolHandler() {} |
@@ -135,11 +75,11 @@ |
request, network_delegate, appcache_service_); |
} |
- // Next check for chrome://blob-internals/, which uses its own job type. |
- if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { |
- return ViewBlobInternalsJobFactory::CreateJobForRequest( |
- request, network_delegate, blob_storage_context_->controller()); |
- } |
+ //// Next check for chrome://blob-internals/, which uses its own job type. |
+ //if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { |
+ // return ViewBlobInternalsJobFactory::CreateJobForRequest( |
+ // request, network_delegate, blob_storage_controller_); |
+ //} |
#if defined(USE_TCMALLOC) |
// Next check for chrome://tcmalloc/, which uses its own job type. |
@@ -160,7 +100,7 @@ |
private: |
AppCacheService* appcache_service_; |
- ChromeBlobStorageContext* blob_storage_context_; |
+ BlobStorageContext* blob_storage_context_; |
}; |
// These constants are used to create the directory structure under the profile |
@@ -448,15 +388,17 @@ |
ChromeBlobStorageContext* blob_storage_context = |
ChromeBlobStorageContext::GetFor(browser_context_); |
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> blob_protocol_handler( |
- new BlobProtocolHandler(blob_storage_context, |
- partition->GetFileSystemContext())); |
+ new webkit_blob::BlobProtocolHandler( |
+ blob_storage_context->context(), |
+ partition->GetFileSystemContext(), |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
file_system_protocol_handler( |
CreateFileSystemProtocolHandler(partition->GetFileSystemContext())); |
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
developer_protocol_handler( |
new DeveloperProtocolHandler(partition->GetAppCacheService(), |
- blob_storage_context)); |
+ blob_storage_context->context())); |
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
chrome_protocol_handler( |
URLDataManagerBackend::CreateProtocolHandler( |