From 270ecb76d378b1cf8a5db63b100f6ddafdd796ef Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 16 Apr 2020 13:06:58 +0200 Subject: Replace deprecated call to TouchPoint::rect() with ellipseDiameters() GetTouchMajor/Minor sound like they are intended to return ellipse diameters, so it was clearly the right thing to do already, any time after 5.6 when rect() was deprecated. Change-Id: I3cbb1e9f38206626fdd9fe2eb3d799662751c475 Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 813ce4be9..5887b356e 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1,3 +1,4 @@ + /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. @@ -216,13 +217,13 @@ public: float GetRawY(size_t pointer_index) const override { return touchPoints.at(pointer_index).screenPos().y(); } float GetTouchMajor(size_t pointer_index) const override { - QRectF touchRect = touchPoints.at(pointer_index).rect(); - return std::max(touchRect.height(), touchRect.width()); + QSizeF diams = touchPoints.at(pointer_index).ellipseDiameters(); + return std::max(diams.height(), diams.width()); } float GetTouchMinor(size_t pointer_index) const override { - QRectF touchRect = touchPoints.at(pointer_index).rect(); - return std::min(touchRect.height(), touchRect.width()); + QSizeF diams = touchPoints.at(pointer_index).ellipseDiameters(); + return std::min(diams.height(), diams.width()); } float GetOrientation(size_t pointer_index) const override { -- cgit v1.2.3 From 707b66cbf7da4e31bfd897e5c4bc6889bc09ef9a Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 8 Apr 2020 09:20:18 +0000 Subject: PdfLinkModel: support the remaining link action types In practice, some PDFs contain links for which FPDFAction_GetType() reports PDFACTION_UNSUPPORTED and yet we can successfully get the same information as if it were PDFACTION_GOTO. For example https://www.openexr.com/documentation/TechnicalIntroduction.pdf contains some of these. PDFACTION_URI is another web link representation: for example in https://www.w3.org/WAI/WCAG21/working-examples/pdf-links/links.pdf PDFACTION_LAUNCH and PDFACTION_REMOTEGOTO will be trickier to support in actual viewer applications, but at least we should provide the file path to open, as a URL. Log similar warnings each time an invalid aspect of a link is encountered, into the qt.pdf.links logging category. Change-Id: I7ca24baa10524611e0705e89a07906ab7b74dadb Reviewed-by: Shawn Rutledge --- src/pdf/qpdflinkmodel.cpp | 83 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp index 96e6ddd5c..4020f036e 100644 --- a/src/pdf/qpdflinkmodel.cpp +++ b/src/pdf/qpdflinkmodel.cpp @@ -144,7 +144,7 @@ void QPdfLinkModelPrivate::update() const QPdfMutexLocker lock; FPDF_PAGE pdfPage = FPDF_LoadPage(doc, page); if (!pdfPage) { - qWarning() << "failed to load page" << page; + qCWarning(qLcLink) << "failed to load page" << page; return; } double pageHeight = FPDF_GetPageHeight(pdfPage); @@ -153,35 +153,76 @@ void QPdfLinkModelPrivate::update() // Iterate the ordinary links int linkStart = 0; - bool ok = true; - while (ok) { + bool hasNext = true; + while (hasNext) { FPDF_LINK linkAnnot; - ok = FPDFLink_Enumerate(pdfPage, &linkStart, &linkAnnot); - if (!ok) + hasNext = FPDFLink_Enumerate(pdfPage, &linkStart, &linkAnnot); + if (!hasNext) break; FS_RECTF rect; - ok = FPDFLink_GetAnnotRect(linkAnnot, &rect); - if (!ok) - break; + bool ok = FPDFLink_GetAnnotRect(linkAnnot, &rect); + if (!ok) { + qCWarning(qLcLink) << "skipping link with invalid bounding box"; + continue; // while enumerating links + } Link linkData; linkData.rect = QRectF(rect.left, pageHeight - rect.top, rect.right - rect.left, rect.top - rect.bottom); FPDF_DEST dest = FPDFLink_GetDest(doc, linkAnnot); FPDF_ACTION action = FPDFLink_GetAction(linkAnnot); - if (FPDFAction_GetType(action) != PDFACTION_GOTO) { - qWarning() << "link action type" << FPDFAction_GetType(action) << "is not yet supported"; - continue; + switch (FPDFAction_GetType(action)) { + case PDFACTION_UNSUPPORTED: // this happens with valid links in some PDFs + case PDFACTION_GOTO: { + linkData.page = FPDFDest_GetDestPageIndex(doc, dest); + if (linkData.page < 0) { + qCWarning(qLcLink) << "skipping link with invalid page number"; + continue; // while enumerating links + } + FPDF_BOOL hasX, hasY, hasZoom; + FS_FLOAT x, y, zoom; + ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom); + if (!ok) { + qCWarning(qLcLink) << "link with invalid location and/or zoom @" << linkData.rect; + break; // at least we got a page number, so the link will jump there + } + if (hasX && hasY) + linkData.location = QPointF(x, pageHeight - y); + if (hasZoom) + linkData.zoom = zoom; + break; + } + case PDFACTION_URI: { + unsigned long len = FPDFAction_GetURIPath(doc, action, nullptr, 0); + if (len < 1) { + qCWarning(qLcLink) << "skipping link with empty URI @" << linkData.rect; + continue; // while enumerating links + } else { + QByteArray buf(len, 0); + unsigned long got = FPDFAction_GetURIPath(doc, action, buf.data(), len); + Q_ASSERT(got == len); + linkData.url = QString::fromLatin1(buf.data(), got - 1); + } + break; } - linkData.page = FPDFDest_GetDestPageIndex(doc, dest); - FPDF_BOOL hasX, hasY, hasZoom; - FS_FLOAT x, y, zoom; - ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom); - if (!ok) + case PDFACTION_LAUNCH: + case PDFACTION_REMOTEGOTO: { + unsigned long len = FPDFAction_GetFilePath(action, nullptr, 0); + if (len < 1) { + qCWarning(qLcLink) << "skipping link with empty file path @" << linkData.rect; + continue; // while enumerating links + } else { + QByteArray buf(len, 0); + unsigned long got = FPDFAction_GetFilePath(action, buf.data(), len); + Q_ASSERT(got == len); + linkData.url = QUrl::fromLocalFile(QString::fromLatin1(buf.data(), got - 1)).toString(); + + // Unfortunately, according to comments in fpdf_doc.h, if it's PDFACTION_REMOTEGOTO, + // we can't get the page and location without first opening the linked document + // and then calling FPDFAction_GetDest() again. + } break; - if (hasX && hasY) - linkData.location = QPointF(x, pageHeight - y); - if (hasZoom) - linkData.zoom = zoom; + } + } links << linkData; } @@ -195,7 +236,7 @@ void QPdfLinkModelPrivate::update() Link linkData; int len = FPDFLink_GetURL(webLinks, i, nullptr, 0); if (len < 1) { - qWarning() << "URL" << i << "has length" << len; + qCWarning(qLcLink) << "skipping link" << i << "with empty URL"; } else { QVector buf(len); int got = FPDFLink_GetURL(webLinks, i, buf.data(), len); -- cgit v1.2.3 From a05bb73747620dd8f0294a57ff690a4f4202884e Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 16 Apr 2020 13:20:04 +0200 Subject: 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 --- src/core/api/qwebengineurlrequestinfo.cpp | 5 +- src/core/api/qwebengineurlrequestinfo_p.h | 2 +- src/core/content_browser_client_qt.cpp | 35 ++-- src/core/net/proxying_url_loader_factory_qt.cpp | 226 +++++++++--------------- src/core/net/proxying_url_loader_factory_qt.h | 21 ++- src/core/web_contents_adapter.cpp | 10 ++ src/core/web_contents_adapter.h | 5 + src/core/web_contents_adapter_client.h | 3 +- src/webenginewidgets/api/qwebenginepage.cpp | 18 +- src/webenginewidgets/api/qwebenginepage_p.h | 2 - src/webenginewidgets/api/qwebengineprofile.cpp | 1 + 11 files changed, 145 insertions(+), 183 deletions(-) (limited to 'src') diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp index 3816f08ca..5ed729f5e 100644 --- a/src/core/api/qwebengineurlrequestinfo.cpp +++ b/src/core/api/qwebengineurlrequestinfo.cpp @@ -131,10 +131,12 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::RedirectNavigation QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource, QWebEngineUrlRequestInfo::NavigationType navigation, - const QUrl &u, const QUrl &fpu, const QUrl &i, const QByteArray &m) + const QUrl &u, const QUrl &fpu, const QUrl &i, + const QByteArray &m) : resourceType(resource) , navigationType(navigation) , shouldBlockRequest(false) + , shouldRedirectRequest(false) , url(u) , firstPartyUrl(fpu) , initiator(i) @@ -310,6 +312,7 @@ void QWebEngineUrlRequestInfo::redirect(const QUrl &url) { d_ptr->changed = true; d_ptr->url = url; + d_ptr->shouldRedirectRequest = true; } /*! diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h index 35b5610be..206104ec9 100644 --- a/src/core/api/qwebengineurlrequestinfo_p.h +++ b/src/core/api/qwebengineurlrequestinfo_p.h @@ -75,7 +75,7 @@ public: QWebEngineUrlRequestInfo::ResourceType resourceType; QWebEngineUrlRequestInfo::NavigationType navigationType; bool shouldBlockRequest; - + bool shouldRedirectRequest; QUrl url; QUrl firstPartyUrl; QUrl initiator; diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 22dbc173b..cac392182 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -57,6 +57,7 @@ #include "components/network_hints/browser/simple_network_hints_handler_impl.h" #include "components/spellcheck/spellcheck_buildflags.h" #include "content/browser/renderer_host/render_view_host_delegate.h" +#include "content/browser/web_contents/web_contents_impl.h" #include "content/common/url_schemes.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -136,8 +137,10 @@ #include "renderer_host/user_resource_controller_host.h" #include "type_conversion.h" #include "web_contents_adapter_client.h" +#include "web_contents_adapter.h" #include "web_contents_delegate_qt.h" #include "web_engine_context.h" +#include "web_contents_view_qt.h" #include "web_engine_library_info.h" #include "api/qwebenginecookiestore.h" #include "api/qwebenginecookiestore_p.h" @@ -1205,17 +1208,29 @@ bool ContentBrowserClientQt::WillCreateURLLoaderFactory( bool *bypass_redirect_checks, network::mojom::URLLoaderFactoryOverridePtr *factory_override) { - auto proxied_receiver = std::move(*factory_receiver); - network::mojom::URLLoaderFactoryPtrInfo target_factory_info; - *factory_receiver = mojo::MakeRequest(&target_factory_info); - int process_id = (type == URLLoaderFactoryType::kNavigation) ? 0 : render_process_id; + auto *web_contents = content::WebContents::FromRenderFrameHost(frame); + ProfileQt *profile = static_cast(browser_context); - base::PostTask(FROM_HERE, { content::BrowserThread::IO }, - base::BindOnce(&ProxyingURLLoaderFactoryQt::CreateProxy, process_id, - browser_context->GetResourceContext(), - std::move(proxied_receiver), - std::move(target_factory_info))); - return true; + QWebEngineUrlRequestInterceptor *profile_interceptor = profile->profileAdapter()->requestInterceptor(); + QWebEngineUrlRequestInterceptor *page_interceptor = nullptr; + + if (web_contents) { + WebContentsAdapterClient *client = + WebContentsViewQt::from(static_cast(web_contents)->GetView())->client(); + page_interceptor = client->webContentsAdapter()->requestInterceptor(); + } + + if (profile_interceptor || page_interceptor) { + int process_id = type == URLLoaderFactoryType::kNavigation ? 0 : render_process_id; + auto proxied_receiver = std::move(*factory_receiver); + mojo::PendingRemote pending_url_loader_factory; + *factory_receiver = pending_url_loader_factory.InitWithNewPipeAndPassReceiver(); + // Will manage its own lifetime + new ProxyingURLLoaderFactoryQt(process_id, profile_interceptor, page_interceptor, std::move(proxied_receiver), + std::move(pending_url_loader_factory)); + return true; + } + return false; } } // namespace QtWebEngineCore diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp index a7dc8a48c..b42aa64bb 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -59,7 +59,7 @@ #include "net/http/http_util.h" #include "api/qwebengineurlrequestinfo_p.h" -#include "profile_io_data_qt.h" +#include "profile_qt.h" #include "type_conversion.h" #include "web_contents_adapter_client.h" #include "web_contents_view_qt.h" @@ -96,15 +96,14 @@ public: InterceptedRequest(int process_id, uint64_t request_id, int32_t routing_id, uint32_t options, const network::ResourceRequest &request, const net::MutableNetworkTrafficAnnotationTag &traffic_annotation, - ProfileIODataQt *profileData, + QWebEngineUrlRequestInterceptor *profile_request_interceptor, + QWebEngineUrlRequestInterceptor *page_request_interceptor, mojo::PendingReceiver loader, mojo::PendingRemote client, mojo::PendingRemote target_factory); ~InterceptedRequest() override; - void Start(); void Restart(); - void InterceptOnUIThread(); // network::mojom::URLLoaderClient void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override; @@ -122,9 +121,11 @@ public: void PauseReadingBodyFromNet() override; void ResumeReadingBodyFromNet() override; +private: + void InterceptOnUIThread(); + void InterceptOnIOThread(base::WaitableEvent *event); void ContinueAfterIntercept(); -private: // This is called when the original URLLoaderClient has a connection error. void OnURLLoaderClientError(); @@ -149,32 +150,29 @@ private: // That way the destructor can send it to OnReceivedError if safe browsing // error didn't occur. int error_status_ = net::OK; - QUrl m_originalUrl; - GURL m_topDocumentUrl; - network::ResourceRequest request_; network::ResourceResponseHead current_response_; const net::MutableNetworkTrafficAnnotationTag traffic_annotation_; - QWebEngineUrlRequestInfo m_requestInfo; - ProfileIODataQt *m_profileData; + QWebEngineUrlRequestInfo request_info_; + QPointer profile_request_interceptor_; + QPointer page_request_interceptor_; mojo::Receiver proxied_loader_receiver_; mojo::Remote target_client_; - mojo::Receiver proxied_client_receiver_{this}; mojo::Remote target_loader_; mojo::Remote target_factory_; - base::WeakPtrFactory m_weakFactory; - base::WeakPtr m_weakPtr; + base::WeakPtrFactory weak_factory_; DISALLOW_COPY_AND_ASSIGN(InterceptedRequest); }; InterceptedRequest::InterceptedRequest(int process_id, uint64_t request_id, int32_t routing_id, uint32_t options, const network::ResourceRequest &request, const net::MutableNetworkTrafficAnnotationTag &traffic_annotation, - ProfileIODataQt *profileData, + QWebEngineUrlRequestInterceptor *profile_request_interceptor, + QWebEngineUrlRequestInterceptor *page_request_interceptor, mojo::PendingReceiver loader_receiver, mojo::PendingRemote client, mojo::PendingRemote target_factory) @@ -184,128 +182,105 @@ InterceptedRequest::InterceptedRequest(int process_id, uint64_t request_id, int3 , options_(options) , request_(request) , traffic_annotation_(traffic_annotation) - , m_profileData(profileData) + , profile_request_interceptor_(profile_request_interceptor) + , page_request_interceptor_(page_request_interceptor) , proxied_loader_receiver_(this, std::move(loader_receiver)) , target_client_(std::move(client)) , target_factory_(std::move(target_factory)) - , m_weakFactory(this) - , m_weakPtr(m_weakFactory.GetWeakPtr()) + , weak_factory_(this) { // If there is a client error, clean up the request. target_client_.set_disconnect_handler( - base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, m_weakFactory.GetWeakPtr())); + base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, weak_factory_.GetWeakPtr())); proxied_loader_receiver_.set_disconnect_with_reason_handler( - base::BindOnce(&InterceptedRequest::OnURLLoaderError, m_weakFactory.GetWeakPtr())); + base::BindOnce(&InterceptedRequest::OnURLLoaderError, weak_factory_.GetWeakPtr())); } InterceptedRequest::~InterceptedRequest() { - m_weakFactory.InvalidateWeakPtrs(); + weak_factory_.InvalidateWeakPtrs(); } -void InterceptedRequest::Start() +void InterceptedRequest::Restart() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + content::ResourceType resourceType = content::ResourceType(request_.resource_type); + WebContentsAdapterClient::NavigationType navigationType = + pageTransitionToNavigationType(ui::PageTransition(request_.transition_type)); + + const QUrl originalUrl = toQt(request_.url); + const QUrl initiator = request_.request_initiator.has_value() ? toQt(request_.request_initiator->GetURL()) : QUrl(); content::WebContents *webContents = nullptr; if (process_id_) { content::RenderFrameHost *frameHost = content::RenderFrameHost::FromID(process_id_, request_.render_frame_id); webContents = content::WebContents::FromRenderFrameHost(frameHost); - } else + } else { webContents = content::WebContents::FromFrameTreeNodeId(request_.render_frame_id); + } - if (webContents) - m_topDocumentUrl = static_cast(webContents)->GetLastCommittedURL(); - - base::PostTask(FROM_HERE, {content::BrowserThread::IO}, - base::BindOnce(&InterceptedRequest::Restart, m_weakPtr)); -} - -void InterceptedRequest::Restart() -{ - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - content::ResourceType resourceType = content::ResourceType(request_.resource_type); - WebContentsAdapterClient::NavigationType navigationType = - pageTransitionToNavigationType(ui::PageTransition(request_.transition_type)); - - m_originalUrl = toQt(request_.url); - - const QUrl initiator = request_.request_initiator.has_value() ? toQt(request_.request_initiator->GetURL()) : QUrl(); - + GURL top_document_url = webContents ? webContents->GetLastCommittedURL() : GURL(); QUrl firstPartyUrl; - if (!m_topDocumentUrl.is_empty()) - firstPartyUrl = toQt(m_topDocumentUrl); + if (!top_document_url.is_empty()) + firstPartyUrl = toQt(top_document_url); else firstPartyUrl = toQt(request_.site_for_cookies); // m_topDocumentUrl can be empty for the main-frame. QWebEngineUrlRequestInfoPrivate *infoPrivate = - new QWebEngineUrlRequestInfoPrivate(toQt(resourceType), toQt(navigationType), - m_originalUrl, firstPartyUrl, initiator, - QByteArray::fromStdString(request_.method)); - m_requestInfo = QWebEngineUrlRequestInfo(infoPrivate); - - if (m_profileData && m_profileData->isInterceptorDeprecated()) { - QWebEngineUrlRequestInterceptor *interceptor = m_profileData->acquireInterceptor(); - if (interceptor && m_profileData->isInterceptorDeprecated()) - interceptor->interceptRequest(m_requestInfo); - m_profileData->releaseInterceptor(); + new QWebEngineUrlRequestInfoPrivate(toQt(resourceType), toQt(navigationType), originalUrl, firstPartyUrl, + 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(); +} - if (m_requestInfo.changed()) { - ContinueAfterIntercept(); - } else { - // FIXME: unretained post? - base::PostTask(FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce(&InterceptedRequest::InterceptOnUIThread, base::Unretained(this))); - } +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_->interceptRequest(request_info_); - content::WebContents *webContents = nullptr; - if (process_id_) { - content::RenderFrameHost *frameHost = content::RenderFrameHost::FromID(process_id_, request_.render_frame_id); - webContents = content::WebContents::FromRenderFrameHost(frameHost); - } else - webContents = content::WebContents::FromFrameTreeNodeId(request_.render_frame_id); - - if (webContents) { - if (m_profileData) { - QWebEngineUrlRequestInterceptor *interceptor = m_profileData->requestInterceptor(); - if (interceptor && !interceptor->property("deprecated").toBool()) - interceptor->interceptRequest(m_requestInfo); - } - - WebContentsAdapterClient *client = - WebContentsViewQt::from(static_cast(webContents)->GetView())->client(); - - if (!m_requestInfo.changed()) - client->interceptRequest(m_requestInfo); - } - base::PostTask(FROM_HERE, {content::BrowserThread::IO}, - base::BindOnce(&InterceptedRequest::ContinueAfterIntercept, m_weakPtr)); + if (!request_info_.changed() && page_request_interceptor_) + page_request_interceptor_->interceptRequest(request_info_); } void InterceptedRequest::ContinueAfterIntercept() { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (m_requestInfo.changed()) { - if (m_requestInfo.d_ptr->shouldBlockRequest) + if (request_info_.changed()) { + if (request_info_.d_ptr->shouldBlockRequest) return SendErrorAndCompleteImmediately(net::ERR_BLOCKED_BY_CLIENT); - if (m_requestInfo.requestUrl() != m_originalUrl) { + if (request_info_.d_ptr->shouldRedirectRequest) { net::URLRequest::FirstPartyURLPolicy first_party_url_policy = request_.update_first_party_url_on_redirect ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL; - net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(request_.method, request_.url, - request_.site_for_cookies, - first_party_url_policy, request_.referrer_policy, - request_.referrer.spec(), net::HTTP_TEMPORARY_REDIRECT, - toGurl(m_requestInfo.requestUrl()), base::nullopt, - false /*insecure_scheme_was_upgraded*/); + net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo( + request_.method, request_.url, request_.site_for_cookies, + first_party_url_policy, request_.referrer_policy, request_.referrer.spec(), + net::HTTP_TEMPORARY_REDIRECT, toGurl(request_info_.requestUrl()), base::nullopt, + false /*insecure_scheme_was_upgraded*/); // FIXME: Should probably create a new header. current_response_.encoded_data_length = 0; @@ -320,9 +295,9 @@ void InterceptedRequest::ContinueAfterIntercept() return; } - if (!m_requestInfo.d_ptr->extraHeaders.isEmpty()) { - auto end = m_requestInfo.d_ptr->extraHeaders.constEnd(); - for (auto header = m_requestInfo.d_ptr->extraHeaders.constBegin(); header != end; ++header) { + if (!request_info_.d_ptr->extraHeaders.isEmpty()) { + auto end = request_info_.d_ptr->extraHeaders.constEnd(); + for (auto header = request_info_.d_ptr->extraHeaders.constBegin(); header != end; ++header) { std::string h = header.key().toStdString(); if (base::LowerCaseEqualsASCII(h, "referer")) { request_.referrer = GURL(header.value().toStdString()); @@ -443,7 +418,7 @@ void InterceptedRequest::OnURLLoaderError(uint32_t custom_reason, const std::str void InterceptedRequest::CallOnComplete(const network::URLLoaderCompletionStatus &status, bool wait_for_loader_error) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // Save an error status so that we call onReceiveError at destruction if there // was no safe browsing error. if (status.error_code != net::OK) @@ -467,7 +442,7 @@ void InterceptedRequest::CallOnComplete(const network::URLLoaderCompletionStatus // In case there are pending checks as to whether this request should be // intercepted, we don't want that causing |target_client_| to be used // later. - m_weakFactory.InvalidateWeakPtrs(); + weak_factory_.InvalidateWeakPtrs(); } else { delete this; } @@ -475,22 +450,21 @@ void InterceptedRequest::CallOnComplete(const network::URLLoaderCompletionStatus void InterceptedRequest::SendErrorAndCompleteImmediately(int error_code) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); auto status = network::URLLoaderCompletionStatus(error_code); target_client_->OnComplete(status); delete this; } -ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(int process_id, - content::ResourceContext *resourceContext, +ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(int process_id, QWebEngineUrlRequestInterceptor *profile, QWebEngineUrlRequestInterceptor *page, mojo::PendingReceiver loader_receiver, - network::mojom::URLLoaderFactoryPtrInfo target_factory_info) - : m_processId(process_id), m_resourceContext(resourceContext), m_weakFactory(this) + mojo::PendingRemote target_factory_info) + : m_processId(process_id), m_profileRequestInterceptor(profile), m_pageRequestInterceptor(page), m_weakFactory(this) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (target_factory_info) { m_targetFactory.Bind(std::move(target_factory_info)); - m_targetFactory.set_connection_error_handler( + m_targetFactory.set_disconnect_handler( base::BindOnce(&ProxyingURLLoaderFactoryQt::OnTargetFactoryError, m_weakFactory.GetWeakPtr())); } m_proxyReceivers.Add(this, std::move(loader_receiver)); @@ -503,47 +477,21 @@ ProxyingURLLoaderFactoryQt::~ProxyingURLLoaderFactoryQt() m_weakFactory.InvalidateWeakPtrs(); } -// static -void ProxyingURLLoaderFactoryQt::CreateProxy(int process_id, - content::ResourceContext *resourceContext, - mojo::PendingReceiver loader_receiver, - network::mojom::URLLoaderFactoryPtrInfo target_factory_info) -{ - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - // Will manage its own lifetime - new ProxyingURLLoaderFactoryQt(process_id, resourceContext, std::move(loader_receiver), std::move(target_factory_info)); -} - -void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver loader, - int32_t routing_id, int32_t request_id, uint32_t options, - const network::ResourceRequest &request, - mojo::PendingRemote client, +void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver loader, int32_t routing_id, + int32_t request_id, uint32_t options, const network::ResourceRequest &request, + mojo::PendingRemote url_loader_client, const net::MutableNetworkTrafficAnnotationTag &traffic_annotation) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - ProfileIODataQt *profileIOData = ProfileIODataQt::FromResourceContext(m_resourceContext); - - QWebEngineUrlRequestInterceptor *profileInterceptor = profileIOData ? profileIOData->requestInterceptor() : nullptr; - if (!profileIOData || !(profileInterceptor || profileIOData->hasPageInterceptors())) { - m_targetFactory->CreateLoaderAndStart( - std::move(loader), routing_id, request_id, options, request, - std::move(client), traffic_annotation); - return; - } - + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); mojo::PendingRemote target_factory_clone; if (m_targetFactory) m_targetFactory->Clone(target_factory_clone.InitWithNewPipeAndPassReceiver()); // Will manage its own lifetime - InterceptedRequest *req = new InterceptedRequest(m_processId, request_id, routing_id, options, request, - traffic_annotation, profileIOData, - std::move(loader), std::move(client), - std::move(target_factory_clone)); - base::PostTask(FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce(&InterceptedRequest::Start, base::Unretained(req))); + InterceptedRequest *req = new InterceptedRequest(m_processId, request_id, routing_id, options, request, traffic_annotation, + m_profileRequestInterceptor, m_pageRequestInterceptor, std::move(loader), + std::move(url_loader_client), std::move(target_factory_clone)); + req->Restart(); } void ProxyingURLLoaderFactoryQt::OnTargetFactoryError() @@ -559,7 +507,7 @@ void ProxyingURLLoaderFactoryQt::OnProxyBindingError() void ProxyingURLLoaderFactoryQt::Clone(mojo::PendingReceiver receiver) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); m_proxyReceivers.Add(this, std::move(receiver)); } diff --git a/src/core/net/proxying_url_loader_factory_qt.h b/src/core/net/proxying_url_loader_factory_qt.h index ba19bab97..3d77856cc 100644 --- a/src/core/net/proxying_url_loader_factory_qt.h +++ b/src/core/net/proxying_url_loader_factory_qt.h @@ -54,11 +54,14 @@ #include "services/network/public/mojom/url_loader_factory.mojom.h" #include "url/gurl.h" +#include // based on aw_proxying_url_loader_factory.h: // Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInterceptor) + namespace content { class ResourceContext; } @@ -68,16 +71,13 @@ namespace QtWebEngineCore { class ProxyingURLLoaderFactoryQt : public network::mojom::URLLoaderFactory { public: - ProxyingURLLoaderFactoryQt(int process_id, content::ResourceContext *resourceContext, + ProxyingURLLoaderFactoryQt(int processId, QWebEngineUrlRequestInterceptor *profile, + QWebEngineUrlRequestInterceptor *page, mojo::PendingReceiver loader_receiver, - network::mojom::URLLoaderFactoryPtrInfo target_factory_info); + mojo::PendingRemote pending_target_factory_remote); ~ProxyingURLLoaderFactoryQt() override; - static void CreateProxy(int process_id, content::ResourceContext *resourceContext, - mojo::PendingReceiver loader_receiver, - network::mojom::URLLoaderFactoryPtrInfo target_factory_info); - void CreateLoaderAndStart(mojo::PendingReceiver loader, int32_t routing_id, int32_t request_id, uint32_t options, const network::ResourceRequest &request, @@ -90,12 +90,11 @@ private: void OnTargetFactoryError(); void OnProxyBindingError(); - const int m_processId; + int m_processId; mojo::ReceiverSet m_proxyReceivers; - network::mojom::URLLoaderFactoryPtr m_targetFactory; - - content::ResourceContext *m_resourceContext; - + mojo::Remote m_targetFactory; + QPointer m_profileRequestInterceptor; + QPointer m_pageRequestInterceptor; base::WeakPtrFactory m_weakFactory; DISALLOW_COPY_AND_ASSIGN(ProxyingURLLoaderFactoryQt); diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index a97db169b..2d559bb38 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1014,6 +1014,16 @@ ProfileAdapter* WebContentsAdapter::profileAdapter() static_cast(m_webContents->GetBrowserContext())->profileAdapter() : nullptr; } +void WebContentsAdapter::setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor) +{ + m_requestInterceptor = interceptor; +} + +QWebEngineUrlRequestInterceptor* WebContentsAdapter::requestInterceptor() const +{ + return m_requestInterceptor; +} + #ifndef QT_NO_ACCESSIBILITY QAccessibleInterface *WebContentsAdapter::browserAccessible() { 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 #include #include +#include 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 m_requestInterceptor; }; } // namespace QtWebEngineCore diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 04df0450c..250801f51 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -70,6 +70,7 @@ QT_FORWARD_DECLARE_CLASS(QWebEngineFindTextResult) QT_FORWARD_DECLARE_CLASS(QWebEngineQuotaRequest) QT_FORWARD_DECLARE_CLASS(QWebEngineRegisterProtocolHandlerRequest) QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInfo) +QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInterceptor) namespace content { struct DropData; @@ -514,7 +515,6 @@ public: virtual ClientType clientType() = 0; virtual void printRequested() = 0; virtual void widgetChanged(RenderWidgetHostViewQtDelegate *newWidget) = 0; - virtual void interceptRequest(QWebEngineUrlRequestInfo &) { } virtual TouchHandleDrawableClient *createTouchHandle(const QMap &images) = 0; virtual void showTouchSelectionMenu(TouchSelectionMenuController *menuController, const QRect &bounds, const QSize &handleSize) = 0; virtual void hideTouchSelectionMenu() = 0; @@ -523,7 +523,6 @@ public: virtual ProfileAdapter *profileAdapter() = 0; virtual WebContentsAdapter* webContentsAdapter() = 0; virtual void releaseProfile() = 0; - }; } // namespace QtWebEngineCore diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 0d2988421..b267c5dd1 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -163,7 +163,6 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) , webChannelWorldId(QWebEngineScript::MainWorld) , defaultAudioMuted(false) , defaultZoomFactor(1.0) - , requestInterceptor(nullptr) #if QT_CONFIG(webengine_printing_and_pdf) , currentPrinter(nullptr) #endif @@ -185,8 +184,6 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) QWebEnginePagePrivate::~QWebEnginePagePrivate() { - if (requestInterceptor) - profile->d_ptr->profileAdapter()->removePageRequestInterceptor(); delete history; delete settings; profile->d_ptr->removeWebContentsAdapterClient(this); @@ -1916,20 +1913,7 @@ void QWebEnginePagePrivate::visibleChanged(bool visible) void QWebEnginePage::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor) { Q_D(QWebEnginePage); - bool hadInterceptorChanged = bool(d->requestInterceptor) != bool(interceptor); - d->requestInterceptor = interceptor; - if (hadInterceptorChanged) { - if (interceptor) - d->profile->d_ptr->profileAdapter()->addPageRequestInterceptor(); - else - d->profile->d_ptr->profileAdapter()->removePageRequestInterceptor(); - } -} - -void QWebEnginePagePrivate::interceptRequest(QWebEngineUrlRequestInfo &info) -{ - if (requestInterceptor) - requestInterceptor->interceptRequest(info); + d->adapter->setRequestInterceptor(interceptor); } #if QT_CONFIG(menu) diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 4f33e26f3..f37413b8e 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -161,7 +161,6 @@ public: void hideTouchSelectionMenu() override { } const QObject *holdingQObject() const override; ClientType clientType() override { return QtWebEngineCore::WebContentsAdapterClient::WidgetsClient; } - void interceptRequest(QWebEngineUrlRequestInfo &) override; void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegate *newWidget) override; void findTextFinished(const QWebEngineFindTextResult &result) override; @@ -202,7 +201,6 @@ public: bool defaultAudioMuted; qreal defaultZoomFactor; QTimer wasShownTimer; - QWebEngineUrlRequestInterceptor *requestInterceptor; QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *widget = nullptr; mutable QtWebEngineCore::CallbackDirectory m_callbacks; diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 470babf8f..4c49be709 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -596,6 +596,7 @@ QWebEngineCookieStore* QWebEngineProfile::cookieStore() 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 -- cgit v1.2.3 From 9e56f570e31a0ef18e544bb21dfddebfe43ec2d0 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 16 Apr 2020 15:41:42 +0200 Subject: Cleanup interceptors in profile Change-Id: Ibc6d63845601b8189ac38bacc77885327284c81f Reviewed-by: Allan Sandfeld Jensen --- src/core/profile_adapter.cpp | 28 --------------------------- src/core/profile_adapter.h | 5 ----- src/core/profile_io_data_qt.cpp | 43 ----------------------------------------- src/core/profile_io_data_qt.h | 10 ---------- 4 files changed, 86 deletions(-) (limited to 'src') diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index c27883b65..d2c4ab1d8 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -95,7 +95,6 @@ ProfileAdapter::ProfileAdapter(const QString &storageName): , m_persistentCookiesPolicy(AllowPersistentCookies) , m_visitedLinksPolicy(TrackVisitedLinksOnDisk) , m_httpCacheMaxSize(0) - , m_pageRequestInterceptors(0) { WebEngineContext::current()->addProfileAdapter(this); // creation of profile requires webengine context @@ -134,7 +133,6 @@ ProfileAdapter::~ProfileAdapter() #if QT_CONFIG(ssl) delete m_clientCertificateStore; #endif - Q_ASSERT(m_pageRequestInterceptors == 0); } void ProfileAdapter::setStorageName(const QString &storageName) @@ -194,19 +192,7 @@ QWebEngineUrlRequestInterceptor *ProfileAdapter::requestInterceptor() void ProfileAdapter::setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor) { - if (m_requestInterceptor == interceptor) - return; - - if (m_requestInterceptor) - disconnect(m_requestInterceptor, &QObject::destroyed, this, nullptr); m_requestInterceptor = interceptor; - if (m_requestInterceptor) - connect(m_requestInterceptor, &QObject::destroyed, this, [this] () { - m_profile->m_profileIOData->updateRequestInterceptor(); - Q_ASSERT(!m_profile->m_profileIOData->requestInterceptor()); - }); - - m_profile->m_profileIOData->updateRequestInterceptor(); } void ProfileAdapter::addClient(ProfileAdapterClient *adapterClient) @@ -219,20 +205,6 @@ void ProfileAdapter::removeClient(ProfileAdapterClient *adapterClient) m_clients.removeOne(adapterClient); } -void ProfileAdapter::addPageRequestInterceptor() -{ - ++m_pageRequestInterceptors; - m_profile->m_profileIOData->updateRequestInterceptor(); -} - -void ProfileAdapter::removePageRequestInterceptor() -{ - Q_ASSERT(m_pageRequestInterceptors > 0); - --m_pageRequestInterceptors; - m_profile->m_profileIOData->updateRequestInterceptor(); -} - - void ProfileAdapter::cancelDownload(quint32 downloadId) { downloadManagerDelegate()->cancelDownload(downloadId); diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h index 60d04273b..1e5a3e21f 100644 --- a/src/core/profile_adapter.h +++ b/src/core/profile_adapter.h @@ -199,10 +199,6 @@ public: void setUseForGlobalCertificateVerification(bool enable = true); bool isUsedForGlobalCertificateVerification() const; - void addPageRequestInterceptor(); - void removePageRequestInterceptor(); - bool hasPageRequestInterceptor() const { return m_pageRequestInterceptors > 0; } - #if QT_CONFIG(ssl) QWebEngineClientCertificateStore *clientCertificateStore(); #endif @@ -247,7 +243,6 @@ private: QList m_clients; QVector m_webContentsAdapterClients; int m_httpCacheMaxSize; - int m_pageRequestInterceptors; QrcUrlSchemeHandler m_qrcHandler; Q_DISABLE_COPY(ProfileAdapter) diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index fd073f208..64ad096a6 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -155,49 +155,6 @@ void ProfileIODataQt::resetNetworkContext() })); } -void ProfileIODataQt::updateRequestInterceptor() -{ - Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - const std::lock_guard lock(m_mutex); - m_requestInterceptor = m_profileAdapter->requestInterceptor(); - m_hasPageInterceptors = m_profileAdapter->hasPageRequestInterceptor(); - if (m_requestInterceptor) - m_isInterceptorDeprecated = m_requestInterceptor->property("deprecated").toBool(); - else - m_isInterceptorDeprecated = false; - // We in this case do not need to regenerate any Chromium classes. -} - -bool ProfileIODataQt::isInterceptorDeprecated() const -{ - return m_isInterceptorDeprecated; -} - -QWebEngineUrlRequestInterceptor *ProfileIODataQt::acquireInterceptor() -{ - Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); - m_mutex.lock(); - return m_requestInterceptor; -} - -QWebEngineUrlRequestInterceptor *ProfileIODataQt::requestInterceptor() -{ - return m_requestInterceptor; -} - -bool ProfileIODataQt::hasPageInterceptors() -{ - // used in NetworkDelegateQt::OnBeforeURLRequest - Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); - return m_hasPageInterceptors; -} - -void ProfileIODataQt::releaseInterceptor() -{ - Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); - m_mutex.unlock(); -} - bool ProfileIODataQt::canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const { return m_cookieDelegate->canGetCookies(firstPartyUrl, url); diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index 6d9dd1a45..26ae1bcb2 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -87,15 +87,8 @@ public: bool canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const; // Used in NetworkDelegateQt::OnBeforeURLRequest. - bool isInterceptorDeprecated() const; // Remove for Qt6 - QWebEngineUrlRequestInterceptor *acquireInterceptor(); // Remove for Qt6 - void releaseInterceptor(); - QWebEngineUrlRequestInterceptor *requestInterceptor(); - void setFullConfiguration(); // runs on ui thread void resetNetworkContext(); // runs on ui thread - void updateRequestInterceptor(); // runs on ui thread - bool hasPageInterceptors(); network::mojom::NetworkContextParamsPtr CreateNetworkContextParams(); @@ -125,7 +118,6 @@ private: QString m_httpUserAgent; ProfileAdapter::HttpCacheType m_httpCacheType; QString m_httpCachePath; - QWebEngineUrlRequestInterceptor* m_requestInterceptor = nullptr; #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) QMutex m_mutex{QMutex::Recursive}; using QRecursiveMutex = QMutex; @@ -134,10 +126,8 @@ private: #endif int m_httpCacheMaxSize = 0; bool m_useForGlobalCertificateVerification = false; - bool m_hasPageInterceptors = false; base::WeakPtrFactory m_weakPtrFactory; // this should be always the last member QString m_dataPath; - volatile bool m_isInterceptorDeprecated = false; // Remove for Qt6 DISALLOW_COPY_AND_ASSIGN(ProfileIODataQt); }; } // namespace QtWebEngineCore -- cgit v1.2.3