diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-08-27 15:25:07 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2020-11-20 10:47:34 +0100 |
commit | 8f77aa42d2b5b67116a095c41040003265c820c7 (patch) | |
tree | e625adf9ae3840fcc340774e63761c001bce45ca /src | |
parent | 50218deafeb52419bb45a451bbecf4819dd3ed39 (diff) | |
download | qtwebengine-8f77aa42d2b5b67116a095c41040003265c820c7.tar.gz |
Remove deprecated url interoceptor setter from profile
Change-Id: I15c621da6da97b2ccdd57afdfad0d413302d3c24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/api/qwebengineprofile.cpp | 28 | ||||
-rw-r--r-- | src/core/net/proxying_url_loader_factory_qt.cpp | 23 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 25 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.h | 3 |
4 files changed, 1 insertions, 78 deletions
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp index bc8f295d9..5704a139a 100644 --- a/src/core/api/qwebengineprofile.cpp +++ b/src/core/api/qwebengineprofile.cpp @@ -582,34 +582,6 @@ QWebEngineCookieStore* QWebEngineProfile::cookieStore() return d->profileAdapter()->cookieStore(); } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - Registers a request interceptor singleton \a interceptor to intercept URL requests. - - The profile does not take ownership of the pointer. - - \obsolete - - Interceptors installed with this method will call - QWebEngineUrlRequestInterceptor::interceptRequest on the I/O thread. Therefore - the user has to provide thread-safe interaction with the other user classes. - For a duration of this call ui thread is blocked. - Use setUrlRequestInterceptor instead. - - \since 5.6 - \sa QWebEngineUrlRequestInfo - -*/ -void QWebEngineProfile::setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor) -{ - Q_D(QWebEngineProfile); - if (interceptor) - interceptor->setProperty("deprecated", true); - d->profileAdapter()->setRequestInterceptor(interceptor); - if (interceptor) - qDebug("Use of deprecated not thread-safe setter, use setUrlRequestInterceptor instead."); -} -#endif /*! Registers a request interceptor singleton \a interceptor to intercept URL requests. diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp index d63659d2d..235079c26 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -144,7 +144,6 @@ public: private: void InterceptOnUIThread(); - void InterceptOnIOThread(base::WaitableEvent *event); void ContinueAfterIntercept(); // This is called when the original URLLoaderClient has a connection error. @@ -253,34 +252,14 @@ void InterceptedRequest::Restart() initiator, QByteArray::fromStdString(request_.method)); request_info_ = QWebEngineUrlRequestInfo(infoPrivate); - // TODO: remove for Qt6 - if (profile_request_interceptor_ && profile_request_interceptor_->property("deprecated").toBool()) { - // sync call supports depracated call of an interceptor on io thread - base::WaitableEvent event; - base::PostTask(FROM_HERE, { content::BrowserThread::IO }, - base::BindOnce(&InterceptedRequest::InterceptOnIOThread, base::Unretained(this), &event)); - event.Wait(); - if (request_info_.changed()) { - ContinueAfterIntercept(); - return; - } - } InterceptOnUIThread(); ContinueAfterIntercept(); } -void InterceptedRequest::InterceptOnIOThread(base::WaitableEvent *event) -{ - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - if (profile_request_interceptor_) - profile_request_interceptor_->interceptRequest(request_info_); - event->Signal(); -} - void InterceptedRequest::InterceptOnUIThread() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (profile_request_interceptor_ && !profile_request_interceptor_->property("deprecated").toBool()) + if (profile_request_interceptor_) profile_request_interceptor_->interceptRequest(request_info_); if (!request_info_.changed() && page_request_interceptor_) diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 9e848691b..a8d036d1b 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -926,31 +926,6 @@ void QQuickWebEngineProfile::clearHttpCache() d->profileAdapter()->clearHttpCache(); } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - Registers a request interceptor singleton \a interceptor to intercept URL requests. - - The profile does not take ownership of the pointer. - - \obsolete - - Interceptors installed with this method will call - QWebEngineUrlRequestInterceptor::interceptRequest on the I/O thread. Therefore - the user has to provide thread-safe interaction with the other user classes. - Use setUrlRequestInterceptor instead. - - \sa QWebEngineUrlRequestInterceptor - -*/ -void QQuickWebEngineProfile::setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor) -{ - Q_D(QQuickWebEngineProfile); - interceptor->setProperty("deprecated", true); - d->profileAdapter()->setRequestInterceptor(interceptor); - qWarning("Use of deprecated not tread-safe setter, use setUrlRequestInterceptor instead."); -} -#endif - /*! Registers a request interceptor singleton \a interceptor to intercept URL requests. diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h index a0480b424..088e6b225 100644 --- a/src/webengine/api/qquickwebengineprofile.h +++ b/src/webengine/api/qquickwebengineprofile.h @@ -126,9 +126,6 @@ public: QWebEngineCookieStore *cookieStore() const; -#if QT_DEPRECATED_SINCE(5, 13) - void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor); -#endif void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor); const QWebEngineUrlSchemeHandler *urlSchemeHandler(const QByteArray &) const; |