summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebengineurlrequestjob.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-08 10:12:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-08 10:47:57 +0100
commit233258f132134caaa3c4acf924b47d7e548865e7 (patch)
tree2afbcb2923f13b03fbb1dc15c1c5b3622842ef1e /src/core/api/qwebengineurlrequestjob.cpp
parent6666e23ed6252c3ef53c5f17d4f28bfe63736e33 (diff)
parent9ef3a8263098c6a32db8b824aabf85587d1f1140 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: .qmake.conf src/core/api/qwebengineurlrequestjob.cpp src/core/browser_context_adapter.cpp src/core/renderer/user_resource_controller.cpp src/core/web_engine_context.cpp src/webenginewidgets/api/qwebenginepage.cpp Change-Id: I5278e5e22e1776d42975fc94d70ff8ca4f81fb9a
Diffstat (limited to 'src/core/api/qwebengineurlrequestjob.cpp')
-rw-r--r--src/core/api/qwebengineurlrequestjob.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp
index a071adbd5..47aab48a0 100644
--- a/src/core/api/qwebengineurlrequestjob.cpp
+++ b/src/core/api/qwebengineurlrequestjob.cpp
@@ -115,12 +115,20 @@ QByteArray QWebEngineUrlRequestJob::requestMethod() const
/*!
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
until the job is deleted. In case simultaneous access from the main thread
is desired, the user is reponsible for making access to \a device thread-safe
for example by using QMutex. Note that the \a device object is not owned by
the web engine. Therefore, the signal QObject::destroyed() of
QWebEngineUrlRequestJob must be monitored.
+
+ The device should remain available at least as long as the job exists.
+ When calling this method with a newly constructed device, one solution is to
+ make the device delete itself when closed, like this:
+ \code
+ connect(device, &QIODevice::aboutToClose, device, &QObject::deleteLater);
+ \endcode
*/
void QWebEngineUrlRequestJob::reply(const QByteArray &contentType, QIODevice *device)
{