diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-07-24 09:41:25 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-17 12:34:30 +0000 |
commit | 17bd9d9de2d424ef7f7a193e17d1619d6effec7b (patch) | |
tree | 049a423c6a2f091e1d0f9e2c8a2531ebbd9412fc /src/core/profile_io_data_qt.cpp | |
parent | 0b1025b8aea4aa0336671f7e908287d65490d120 (diff) |
Add setRequestInterceptor to QWebEnginePage
Makes it possible to make page specific intercepts, and is at the same
time safer by running in the UI-thread.
[ChangeLog][QtWebEngineWidgets][QWebEnginePage] Added
setRequestInterceptor, similar to the same call on profile except
it operates on a per-page basis and on the UI-thread.
Change-Id: Id5a7173156c25d0f030f00b6ef314d283c7c8cdd
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/profile_io_data_qt.cpp')
-rw-r--r-- | src/core/profile_io_data_qt.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index ad8c2a110..ad79304d3 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -727,6 +727,7 @@ void ProfileIODataQt::updateRequestInterceptor() Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); QMutexLocker lock(&m_mutex); m_requestInterceptor = m_profileAdapter->requestInterceptor(); + m_hasPageInterceptors = m_profileAdapter->hasPageRequestInterceptor(); // We in this case do not need to regenerate any Chromium classes. } @@ -738,6 +739,13 @@ QWebEngineUrlRequestInterceptor *ProfileIODataQt::requestInterceptor() return m_requestInterceptor; } +bool ProfileIODataQt::hasPageInterceptors() +{ + // used in NetworkDelegateQt::OnBeforeURLRequest + Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + return m_hasPageInterceptors; +} + bool ProfileIODataQt::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url) const { return m_cookieDelegate->canSetCookie(firstPartyUrl,cookieLine, url); |