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

Unified Diff: content/public/browser/download_url_parameters.h

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/public/browser/download_url_parameters.h
diff --git a/content/public/browser/download_url_parameters.h b/content/public/browser/download_url_parameters.h
index 5734e91cd2d1059694eeb8d85265cb4dcf962dbc..6bcbf65deeb3f61f725b3e913e9deccbc38fe12d 100644
--- a/content/public/browser/download_url_parameters.h
+++ b/content/public/browser/download_url_parameters.h
@@ -16,6 +16,7 @@
#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/browser/download_save_info.h"
#include "content/public/common/referrer.h"
+#include "storage/browser/blob/blob_data_handle.h"
#include "url/gurl.h"
namespace content {
@@ -167,6 +168,19 @@ class CONTENT_EXPORT DownloadUrlParameters {
do_not_prompt_for_login_ = do_not_prompt;
}
+ // For downloads of blob URLs, the caller can store a BlobDataHandle in the
+ // DownloadUrlParameters object so that the blob will remain valid until
+ // the download starts. The BlobDataHandle will be attached to the associated
+ // URLRequest.
+ //
+ // This is optional. If left unspecified, and the blob URL cannot be mapped to
+ // a blob by the time the download request starts, then the download will
+ // fail.
+ void set_blob_data_handle(
+ scoped_ptr<storage::BlobDataHandle> blob_data_handle) {
+ blob_data_handle_ = std::move(blob_data_handle);
+ }
+
const OnStartedCallback& callback() const { return callback_; }
bool content_initiated() const { return content_initiated_; }
const std::string& last_modified() const { return last_modified_; }
@@ -196,6 +210,11 @@ class CONTENT_EXPORT DownloadUrlParameters {
const GURL& url() const { return url_; }
bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; }
+ // STATE_CHANGING: Return the BlobDataHandle.
+ scoped_ptr<storage::BlobDataHandle> GetBlobDataHandle() {
+ return std::move(blob_data_handle_);
+ }
+
// Note that this is state changing--the DownloadUrlParameters object
// will not have a file attached to it after this call.
base::File GetFile() { return std::move(save_info_.file); }
@@ -219,6 +238,7 @@ class CONTENT_EXPORT DownloadUrlParameters {
DownloadSaveInfo save_info_;
GURL url_;
bool do_not_prompt_for_login_;
+ scoped_ptr<storage::BlobDataHandle> blob_data_handle_;
DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters);
};
« no previous file with comments | « content/browser/renderer_host/render_message_filter.cc ('k') | content/test/data/download/download-attribute-blob.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698