summaryrefslogtreecommitdiff
path: root/chromium/components/download/public/common/mock_download_item_impl.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/mock_download_item_impl.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/mock_download_item_impl.h')
-rw-r--r--chromium/components/download/public/common/mock_download_item_impl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/chromium/components/download/public/common/mock_download_item_impl.h b/chromium/components/download/public/common/mock_download_item_impl.h
index 7bbb9589d24..612485d1f7b 100644
--- a/chromium/components/download/public/common/mock_download_item_impl.h
+++ b/chromium/components/download/public/common/mock_download_item_impl.h
@@ -10,11 +10,13 @@
#include <vector>
#include "base/macros.h"
+#include "base/optional.h"
#include "components/download/public/common/download_create_info.h"
#include "components/download/public/common/download_file.h"
#include "components/download/public/common/download_item_impl.h"
#include "components/download/public/common/download_request_handle_interface.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "url/origin.h"
namespace download {
@@ -81,6 +83,7 @@ class MockDownloadItemImpl : public DownloadItemImpl {
MOCK_CONST_METHOD0(GetReferrerUrl, const GURL&());
MOCK_CONST_METHOD0(GetTabUrl, const GURL&());
MOCK_CONST_METHOD0(GetTabReferrerUrl, const GURL&());
+ MOCK_CONST_METHOD0(GetRequestInitiator, const base::Optional<url::Origin>&());
MOCK_CONST_METHOD0(GetSuggestedFilename, std::string());
MOCK_CONST_METHOD0(GetContentDisposition, std::string());
MOCK_CONST_METHOD0(GetMimeType, std::string());