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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 23223003: Chromium Blob hacking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index fdf01f0b511100a61d67a553f7fd1e786e538a1e..f91fdb6f50904006e3e918d794d2f622c78494f6 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -86,7 +86,10 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_job_factory.h"
#include "webkit/browser/appcache/appcache_interceptor.h"
-#include "webkit/browser/blob/blob_storage_controller.h"
+#include "webkit/common/blob/blob_data.h"
+#include "webkit/browser/blob/blob_data_handle.h"
+#include "webkit/browser/blob/blob_storage_context.h"
+#include "webkit/browser/blob/blob_url_request_job_factory.h"
#include "webkit/browser/fileapi/file_permission_policy.h"
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/common/appcache/appcache_interfaces.h"
@@ -213,11 +216,12 @@ bool ShouldServiceRequest(int process_type,
return false;
}
if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) {
- fileapi::FileSystemURL url = file_system_context->CrackURL(iter->url());
+ fileapi::FileSystemURL url =
+ file_system_context->CrackURL(iter->filesystem_url());
if (!policy->HasPermissionsForFileSystemFile(
child_id, url, fileapi::kReadFilePermissions)) {
NOTREACHED() << "Denied unauthorized upload of "
- << iter->url().spec();
+ << iter->filesystem_url().spec();
return false;
}
}
@@ -510,6 +514,14 @@ net::Error ResourceDispatcherHostImpl::BeginDownload(
CreateRequestInfo(child_id, route_id, true, context);
extra_info->AssociateWithRequest(request.get()); // Request takes ownership.
+ if (request->url().SchemeIs(chrome::kBlobScheme)) {
+ ChromeBlobStorageContext* blob_context =
+ GetChromeBlobStorageContextForResourceContext(context);
+ webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle(
+ request.get(),
+ blob_context->context()->GetBlobDataFromPublicURL(request->url()));
+ }
+
// From this point forward, the |DownloadResourceHandler| is responsible for
// |started_callback|.
scoped_ptr<ResourceHandler> handler(
@@ -988,7 +1000,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
if (request_data.request_body.get()) {
request->set_upload(UploadDataStreamBuilder::Build(
request_data.request_body.get(),
- filter_->blob_storage_context()->controller(),
+ filter_->blob_storage_context()->context(),
filter_->file_system_context(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
.get()));
@@ -1023,9 +1035,10 @@ void ResourceDispatcherHostImpl::BeginRequest(
if (request->url().SchemeIs(chrome::kBlobScheme)) {
// Hang on to a reference to ensure the blob is not released prior
// to the job being started.
- extra_info->set_requested_blob_data(
- filter_->blob_storage_context()->controller()->
- GetBlobDataFromUrl(request->url()));
+ webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle(
+ request,
+ filter_->blob_storage_context()->context()->
+ GetBlobDataFromPublicURL(request->url()));
}
// Have the appcache associate its extra info with the request.
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter_unittest.cc ('k') | content/browser/loader/resource_request_info_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698