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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 1835913002: [Merge M50] [Downloads] Retain a BlobDataHandle in DownloadUrlParameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index d3e33aee5e29571df3b43fce1947650ee32c8ca2..29ab868065ecbaced52ebf9a23d852a5e51b405d 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -24,6 +24,7 @@
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/download/download_stats.h"
+#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/media/media_internals.h"
@@ -31,6 +32,7 @@
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_widget_helper.h"
+#include "content/browser/resource_context_impl.h"
#include "content/common/child_process_host_impl.h"
#include "content/common/child_process_messages.h"
#include "content/common/content_constants_internal.h"
@@ -63,6 +65,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "ppapi/shared_impl/file_type_conversion.h"
+#include "storage/browser/blob/blob_storage_context.h"
#include "ui/gfx/color_profile.h"
#include "url/gurl.h"
@@ -395,6 +398,16 @@ void RenderMessageFilter::DownloadUrl(int render_view_id,
parameters->set_suggested_name(suggested_name);
parameters->set_prompt(use_prompt);
parameters->set_referrer(referrer);
+
+ if (url.SchemeIsBlob()) {
+ ChromeBlobStorageContext* blob_context =
+ GetChromeBlobStorageContextForResourceContext(resource_context_);
+ parameters->set_blob_data_handle(
+ blob_context->context()->GetBlobDataFromPublicURL(url));
+ // Don't care if the above fails. We are going to let the download go
+ // through and allow it to be interrupted so that the embedder can deal.
+ }
+
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&DownloadUrlOnUIThread, base::Passed(&parameters)));
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/public/browser/download_url_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698