summaryrefslogtreecommitdiffstats
path: root/src/core/profile_io_data_qt.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-10-07 10:59:45 +0200
committerMichal Klocek <michal.klocek@qt.io>2019-10-10 14:22:52 +0200
commit7d08de5b527cb2112556a126b889dd7d0d888d22 (patch)
tree92c03667f705d86bf8643ce704b6d366e9d76da5 /src/core/profile_io_data_qt.cpp
parentb44ed0fb99cd3d7047fcd322010c27cfa7989a18 (diff)
Fix life cycle issue of QWebEngineUrlRequestInterceptor
Since 5e92adf intercept() is called on ui thread, however this patch does not consider deletion of interceptor while io thread still process the request and for examples checks interceptor's deprecated property. Fix it. Note this only fixes issue for interceptors which are not deprecated therefore run on ui thread. Change-Id: I5d5909065563e57a0cacb81fd04271b3f88596de Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_io_data_qt.cpp')
-rw-r--r--src/core/profile_io_data_qt.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 27c97a986..6ed172335 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -741,9 +741,18 @@ void ProfileIODataQt::updateRequestInterceptor()
QMutexLocker lock(&m_mutex);
m_requestInterceptor = m_profileAdapter->requestInterceptor();
m_hasPageInterceptors = m_profileAdapter->hasPageRequestInterceptor();
+ if (m_requestInterceptor)
+ m_isInterceptorDeprecated = m_requestInterceptor->property("deprecated").toBool();
+ else
+ m_isInterceptorDeprecated = false;
// We in this case do not need to regenerate any Chromium classes.
}
+bool ProfileIODataQt::isInterceptorDeprecated() const
+{
+ return m_isInterceptorDeprecated;
+}
+
QWebEngineUrlRequestInterceptor *ProfileIODataQt::acquireInterceptor()
{
m_mutex.lock();