summaryrefslogtreecommitdiffstats
path: root/src/core/net/network_delegate_qt.cpp
diff options
context:
space:
mode:
authorTamas Zakor <ztamas@inf.u-szeged.hu>2019-06-05 09:05:09 +0200
committerTamas Zakor <ztamas@inf.u-szeged.hu>2019-06-05 15:07:34 +0200
commita1d3562d5115f5b06f9cb515df570e36c89ba187 (patch)
treeddc7d496f0a1dd9b870177c698e8feb641bc524b /src/core/net/network_delegate_qt.cpp
parent366aef14779c28b12807be960eb494b534a859c9 (diff)
Add QWebEngineUrlRequestInfo::initiator()
Returns the origin url of the document which initiated the navigation when a frame navigates another frame. Task-number: QTBUG-75759 Change-Id: Ia2884b5a3027cceea45f0e659652b02036faaacb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/net/network_delegate_qt.cpp')
-rw-r--r--src/core/net/network_delegate_qt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp
index f283df1d1..c0e936cd7 100644
--- a/src/core/net/network_delegate_qt.cpp
+++ b/src/core/net/network_delegate_qt.cpp
@@ -127,10 +127,13 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
else
firstPartyUrl = toQt(request->site_for_cookies());
+ const QUrl initiator = request->initiator().has_value() ? toQt(request->initiator()->GetURL()) : QUrl();
+
QWebEngineUrlRequestInfoPrivate *infoPrivate = new QWebEngineUrlRequestInfoPrivate(toQt(resourceType),
toQt(navigationType),
qUrl,
firstPartyUrl,
+ initiator,
QByteArray::fromStdString(request->method()));
QWebEngineUrlRequestInfo requestInfo(infoPrivate);