summaryrefslogtreecommitdiff
path: root/chromium/components/download/public/common/download_item.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-17 11:23:26 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-21 08:13:41 +0000
commit2708f4fe1f1a4aca14d888303bbdc21bcf629a19 (patch)
treefe0622b16daa66b82132bc6b1930934fee879dfa /chromium/components/download/public/common/download_item.h
parent2a45953d844a6d1be6df8aeb7359a98daaa52ee2 (diff)
downloadqtwebengine-chromium-2708f4fe1f1a4aca14d888303bbdc21bcf629a19.tar.gz
[Backport] Plumb initiating origin info to download stack.
This CL passes along the initiating origin of a request down into DownloadInfo and related objects. The current download objects store substantial context related to where a download comes from, but not enough to reliably determine requesting origin. This functionality will be used in a subsequent CL to block some forms downloads as mixed content. Bug: 960819 Change-Id: Ifa2537141bb71c37665608e992ee91cd665c41ea Reviewed-by: Min Qin <qinmin@chromium.org> Reviewed-by: Joshua Bell <jsbell@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Xi Han <hanxi@chromium.org> Reviewed-by: Christopher Thompson <cthomp@chromium.org> Commit-Queue: Joe DeBlasio <jdeblasio@chromium.org> Cr-Commit-Position: refs/heads/master@{#658571} Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/components/download/public/common/download_item.h')
-rw-r--r--chromium/components/download/public/common/download_item.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/chromium/components/download/public/common/download_item.h b/chromium/components/download/public/common/download_item.h
index 3b5d743ca57..07365431d5d 100644
--- a/chromium/components/download/public/common/download_item.h
+++ b/chromium/components/download/public/common/download_item.h
@@ -26,12 +26,14 @@
#include "base/callback_forward.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/supports_user_data.h"
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_export.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "ui/base/page_transition_types.h"
+#include "url/origin.h"
class GURL;
@@ -265,6 +267,9 @@ class COMPONENTS_DOWNLOAD_EXPORT DownloadItem : public base::SupportsUserData {
// Referrer URL for top level frame.
virtual const GURL& GetTabReferrerUrl() const = 0;
+ // Origin of the original originator of this download, before redirects, etc.
+ virtual const base::Optional<url::Origin>& GetRequestInitiator() const = 0;
+
// For downloads initiated via <a download>, this is the suggested download
// filename from the download attribute.
virtual std::string GetSuggestedFilename() const = 0;