diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-10-28 16:28:29 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-10-28 16:28:29 +0100 |
commit | 91fc86bef3b9eb9467f6ac251d1953483da93185 (patch) | |
tree | 616f5dd534f4ddc86675047bac4eb3f4287085d1 /src/core/net/network_delegate_qt.cpp | |
parent | 51228eb249a178ada6ebd2ccd5e662bcd7bd2c60 (diff) | |
parent | 556576b55f6b4404c71c74a5ef8e21f87ed09854 (diff) |
Merge remote-tracking branch 'origin/5.13.2' into 5.13
Change-Id: I5c95819f139bb0995475324bd33dab478802db59
Diffstat (limited to 'src/core/net/network_delegate_qt.cpp')
-rw-r--r-- | src/core/net/network_delegate_qt.cpp | 16 |
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 7f278fd92..2cca152e6 100644 --- a/src/core/net/network_delegate_qt.cpp +++ b/src/core/net/network_delegate_qt.cpp @@ -136,11 +136,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; @@ -174,7 +174,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(); @@ -185,7 +187,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. |