summaryrefslogtreecommitdiffstats
path: root/src/core/net/network_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-30 15:45:50 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-30 16:17:37 +0100
commit4cf520d67f0619330bbf53a743818924d476d95f (patch)
tree58e13e6747affa06bf495c25c8dc7e272a428ba3 /src/core/net/network_delegate_qt.cpp
parent21f10e777ee2faf41196d0263d4e5134d0ec216a (diff)
parent91fc86bef3b9eb9467f6ac251d1953483da93185 (diff)
Merge branch '5.13' into 5.14
Diffstat (limited to 'src/core/net/network_delegate_qt.cpp')
-rw-r--r--src/core/net/network_delegate_qt.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp
index 68bf34d31..772ef06aa 100644
--- a/src/core/net/network_delegate_qt.cpp
+++ b/src/core/net/network_delegate_qt.cpp
@@ -139,11 +139,11 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
// Deprecated =begin
// quick peek if deprecated
- QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->requestInterceptor();
- if (profileInterceptor && profileInterceptor->property("deprecated").toBool()) {
- profileInterceptor = nullptr;
- if (QWebEngineUrlRequestInterceptor* interceptor = m_profileIOData->acquireInterceptor()) {
- interceptor->interceptRequest(requestInfo);
+
+ if (m_profileIOData->isInterceptorDeprecated()) {
+ QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->acquireInterceptor();
+ if (profileInterceptor && m_profileIOData->isInterceptorDeprecated()) {
+ profileInterceptor->interceptRequest(requestInfo);
m_profileIOData->releaseInterceptor();
if (requestInfo.changed()) {
int result = infoPrivate->shouldBlockRequest ? net::ERR_BLOCKED_BY_CLIENT : net::OK;
@@ -177,7 +177,9 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
if (!resourceInfo)
return net::OK;
- if (!m_profileIOData->hasPageInterceptors() && !profileInterceptor && !content::IsResourceTypeFrame(resourceType))
+ // try to bail out
+ if (!m_profileIOData->hasPageInterceptors() && (!m_profileIOData->requestInterceptor() || m_profileIOData->isInterceptorDeprecated()) &&
+ !content::IsResourceTypeFrame(resourceType))
return net::OK;
auto webContentsGetter = resourceInfo->GetWebContentsGetterForRequest();
@@ -188,7 +190,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet
std::move(requestInfo),
webContentsGetter,
std::move(callback),
- profileInterceptor ? m_profileIOData->profileAdapter() : nullptr
+ m_profileIOData->profileAdapter()
);
// We'll run the callback after we notified the UI thread.