diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-19 13:30:51 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-22 10:30:42 +0000 |
commit | 2daa4950118dd76d0d0bf15e347217740b0cb5c5 (patch) | |
tree | a3febba6aaef36f59295ac950757dfee21a5dd2d /src/core/api | |
parent | 86060ec61135cd30f9a8d8415784b767ce1f1252 (diff) |
Add initiator to QWebEngineUrlRequestJob
Add a property that can be used to tell what is making the URL request.
Change-Id: Ic7224382165e93d3c043c30e9a7cc5be9f29d9db
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/api')
-rw-r--r-- | src/core/api/qwebengineurlrequestjob.cpp | 11 | ||||
-rw-r--r-- | src/core/api/qwebengineurlrequestjob.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp index 47aab48a0..941c70b1d 100644 --- a/src/core/api/qwebengineurlrequestjob.cpp +++ b/src/core/api/qwebengineurlrequestjob.cpp @@ -114,6 +114,17 @@ QByteArray QWebEngineUrlRequestJob::requestMethod() const } /*! + \since 5.11 + Returns the origin URL of the content that initiated the request. If the + request was not initiated by web content the function will return an + empty QUrl. +*/ +QUrl QWebEngineUrlRequestJob::initiator() const +{ + return d_ptr->initiator(); +} + +/*! Replies to the request with \a device and the MIME type \a contentType. The user has to be aware that \a device will be used on another thread diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h index 4f23ab401..7a7dbd83d 100644 --- a/src/core/api/qwebengineurlrequestjob.h +++ b/src/core/api/qwebengineurlrequestjob.h @@ -72,6 +72,7 @@ public: QUrl requestUrl() const; QByteArray requestMethod() const; + QUrl initiator() const; void reply(const QByteArray &contentType, QIODevice *device); void fail(Error error); |