diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-04-16 13:20:04 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2020-04-20 09:44:53 +0200 |
commit | a05bb73747620dd8f0294a57ff690a4f4202884e (patch) | |
tree | fcbdd58b8b03b8233035699aaf6b4d4498f89c8e /src/core/web_contents_adapter.h | |
parent | 41e8f7046949b7418c6780e342ddc0c2d4bbd026 (diff) |
Move request interceptor to ui thread
We use now network service avoid io-ui-io-ui hops,
pipe proxying url loader factory directly to ui thread.
This solves thread safty issues.
Add deprecated request interceptor test cases.
Task-number: QTBUG-83082
Task-number: QTBUG-82999
Change-Id: I38778cf1a70789c5e92e04c93d1c93e2cc4c765a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.h')
-rw-r--r-- | src/core/web_contents_adapter.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 1a76cd3c1..cc041ed55 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -61,6 +61,7 @@ #include <QSharedPointer> #include <QString> #include <QUrl> +#include <QPointer> namespace content { class WebContents; @@ -79,6 +80,7 @@ class QPageLayout; class QString; class QTemporaryDir; class QWebChannel; +class QWebEngineUrlRequestInterceptor; QT_END_NAMESPACE namespace QtWebEngineCore { @@ -235,6 +237,8 @@ public: void initialize(content::SiteInstance *site); content::WebContents *webContents() const; void updateRecommendedState(); + void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor); + QWebEngineUrlRequestInterceptor* requestInterceptor() const; private: Q_DISABLE_COPY(WebContentsAdapter) @@ -274,6 +278,7 @@ private: LifecycleState m_lifecycleState = LifecycleState::Active; LifecycleState m_recommendedState = LifecycleState::Active; bool m_inspector = false; + QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor; }; } // namespace QtWebEngineCore |