From 904330c3a39a29ef078c9c1ddc2a1d1580fa2c32 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 21 Jul 2020 09:11:30 +0200 Subject: Do not turn web auth off Submodule src/3rdparty 0a4240a9..4a996760: > Fix building FIDO with gcc5 > [Backport] CVE-2020-6512: Type Confusion in V8 (3/3) Fixes: QTBUG-85117 Task-number: QTBUG-54720 Change-Id: I074831454b469c17a71f2ca75a075ee48157970d Reviewed-by: Tamas Zakor Reviewed-by: Michal Klocek --- src/3rdparty | 2 +- src/buildtools/config/common.pri | 2 +- src/core/web_engine_context.cpp | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 0a4240a9c..4a9967606 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 0a4240a9c428d71656637ad4486d92bfeb52af93 +Subproject commit 4a996760680eb99732d172463b2a8288e67c8cc0 diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri index 8aeeb3894..ddcd225cc 100644 --- a/src/buildtools/config/common.pri +++ b/src/buildtools/config/common.pri @@ -17,7 +17,7 @@ gn_args += \ enable_resource_whitelist_generation=false \ enable_swiftshader=false \ angle_enable_swiftshader=false \ - enable_web_auth=false \ + enable_web_auth=true \ enable_web_speech=false \ enable_widevine=true \ has_native_accessibility=false \ diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 01d55a5a1..11365de62 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -649,8 +649,6 @@ WebEngineContext::WebEngineContext() // Explicitly tell Chromium about default-on features we do not support appendToFeatureList(disableFeatures, features::kBackgroundFetch.name); appendToFeatureList(disableFeatures, features::kSmsReceiver.name); - appendToFeatureList(disableFeatures, features::kWebAuth.name); - appendToFeatureList(disableFeatures, features::kWebAuthCable.name); appendToFeatureList(disableFeatures, features::kWebPayments.name); appendToFeatureList(disableFeatures, features::kWebUsb.name); appendToFeatureList(disableFeatures, media::kPictureInPicture.name); -- cgit v1.2.1 From 91608f4486d7afa442a1477414437912d0aa5b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 3 Aug 2020 10:20:17 +0200 Subject: Update Chromium Pulls in the changes: cc32214f8dc [Backport] Security bugs 1087629 and 1029569 1cf3807d934 [Backport] Security bug 1052492 a5e8bd5e8c9 [Backport] CVE-2020-6533: Type Confusion in V8. da24a7f8bcb [Backport] CVE-2020-6532: Use after free in SCTP e402452015f [Backport] CVE-2020-6541: Use after free in WebUSB 8a0c6063c5b [Backport] Security bug 1102408 Task-number: QTBUG-85606 Change-Id: I7a17702c7290e135bcdc3074c27e8fc89a6ac4c9 Reviewed-by: Allan Sandfeld Jensen --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 4a9967606..8a0c6063c 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 4a996760680eb99732d172463b2a8288e67c8cc0 +Subproject commit 8a0c6063c5be01ce6cb1eda5dd671453ef7f60c4 -- cgit v1.2.1 From 001ef20a82749e58295a706d6b075cdcb74f1621 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 31 Jul 2020 16:31:27 +0200 Subject: Re-enable client certificate handling when Qt is build without SSL We only need the QSslCertificate which is always available. Task-number: QTBUG-85117 Change-Id: I32e2034060e610ac049d8e3b2a03660e9bf7e7a4 Reviewed-by: Michal Klocek --- src/core/profile_io_data_qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index 02912e35e..91adbc57d 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -212,7 +212,7 @@ std::unique_ptr ProfileIODataQt::CreateClientCertStore() #if QT_CONFIG(ssl) return std::unique_ptr(new ClientCertOverrideStore(m_clientCertificateStoreData)); #else - return nullptr; + return std::unique_ptr(new ClientCertOverrideStore(nullptr)); #endif } -- cgit v1.2.1 From 9b86c62e2abec8ad9f96ab608b68b2b76a3503b9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 4 Aug 2020 18:09:58 +0200 Subject: Update Chromium Submodule src/3rdparty 8a0c6063..84f63010: > [Backport] CVE-2020-6540: Heap buffer overflow in Skia > Fix webrtc build with GCC 10 > FIXUP: [Backport] CVE-2020-6493: Use after free in WebAuthentication > [Backport] Handle invalid type mixing in CSS clamp() > [Backport] CVE-2020-6493: Use after free in WebAuthentication > [Backport] Security bug 1087158 Change-Id: I1289579cbe81cd4bee9cf49103dc384f81913888 Reviewed-by: Michal Klocek --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 8a0c6063c..84f630108 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 8a0c6063c5be01ce6cb1eda5dd671453ef7f60c4 +Subproject commit 84f63010826b3094d34dd46254069176a573a197 -- cgit v1.2.1 From cc232eb6586b3db5b7ed61287e39319990417476 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 5 Aug 2020 09:03:17 +0200 Subject: Detect the combination of audio and video from getDisplayMedia API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were missing the combined test after Chromium introduced the new enums. Fixes: QTBUG-85890 Change-Id: Id7bb7f05635c64c271e12a12f2409eedc22a9605 Reviewed-by: Jüri Valdmann --- src/core/media_capture_devices_dispatcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index 2293c424a..693cfa2e3 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -173,6 +173,10 @@ WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const co request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture}; + if (request.audio_type == MediaStreamType::DISPLAY_AUDIO_CAPTURE && + request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE) + return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture}; + if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE || request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE) return {WebContentsAdapterClient::MediaDesktopVideoCapture}; -- cgit v1.2.1 From 004fe2d1665bf23f64c981a4f209e3480e7ee4a7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Jul 2020 13:01:23 +0200 Subject: Disable WebComponentsV0 It appears we are no longer presented with pages using these, so match Chrome and Chromium 80 defaults. Change-Id: Ie270c2bee9b81f898c7dab9e6d4dad02636c17cc Reviewed-by: Michal Klocek --- src/core/renderer/content_renderer_client_qt.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index b2138a82a..428697936 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -622,9 +622,7 @@ void ContentRendererClientQt::WillSendRequest(blink::WebLocalFrame *frame, bool ContentRendererClientQt::RequiresWebComponentsV0(const GURL &url) { Q_UNUSED(url); - // Google services still presents pages using these features - // to Chromium 80 based browsers (YouTube in particular). - return true; + return false; } } // namespace QtWebEngineCore -- cgit v1.2.1 From 06b49842131e7da7374e2ba74b6173196a61400f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Tue, 11 Aug 2020 17:02:46 +0200 Subject: Update Chromium Pulls in the changes: 6b7ceb6afd9 Fix debug-info in MSVC developer-builds 563e0a1cd4f [Backport] CVE-2020-6542: Use after free in ANGLE c16701ae892 [Backport] CVE-2020-6543: Use after free in task scheduling 10efe0032f2 [Backport] CVE-2020-6544: Use after free in media 69a85eaabf2 [Backport] CVE-2020-6548: Heap buffer overflow in Skia d2f5e4d3a25 [Backport] CVE-2020-6549: Use after free in media 0eed9609606 [Backport] CVE-2020-6550: Use after free in IndexedDB f7859651865 [Backport] CVE-2020-6551: Use after free in WebXR 3cebf422618 [Backport] CVE-2020-6555: Out of bounds read in WebGL 30a0c954b97 [Backport] CVE-2020-6545: Use after free in audio Task-number: QTBUG-85606 Change-Id: I1f591d722380fbcfb91565b90a6f4cbb7227b266 Reviewed-by: Michal Klocek --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 84f630108..30a0c954b 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 84f63010826b3094d34dd46254069176a573a197 +Subproject commit 30a0c954b97ae86385ff022d6c101fe900295695 -- cgit v1.2.1 From 99a668c324218a1fab4824a9707194ff38df6dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Wed, 12 Aug 2020 14:30:32 +0200 Subject: Fix swap condition in DisplayGLOutputSurface::updatePaintNode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buffer pointers m_middleBuffer and m_frontBuffer are swapped in updatePaintNode on the condition that m_middleBuffer is non-null and it's serviceId non-zero. But neither m_middleBuffer nor it's serviceId is immediately cleared, leaving the possibility that a subsequent call to updatePaintNode could swap the buffer pointers again if this call occurs before m_middleBuffer is cleared in swapBuffersOnVizThread. The m_taskRunner pointer is however cleared immediately and therefore the subsequent call to updatePaintNode will trigger a segmentation fault. Since m_taskRunner precisely tracks the condition when we should or should not swap, change the swap condition to simply require that m_taskRunner is non-null. Fixes: QTBUG-85817 Change-Id: Iad89bb0f4de7c0c151d5c5bd63ac74ab6cdd9087 Reviewed-by: Michael Brüning --- src/core/compositor/display_gl_output_surface_qsg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/compositor/display_gl_output_surface_qsg.cpp b/src/core/compositor/display_gl_output_surface_qsg.cpp index 2f7b3de84..d4b9154d1 100644 --- a/src/core/compositor/display_gl_output_surface_qsg.cpp +++ b/src/core/compositor/display_gl_output_surface_qsg.cpp @@ -88,7 +88,7 @@ QSGNode *DisplayGLOutputSurface::updatePaintNode(QSGNode *oldNode, RenderWidgetH { { QMutexLocker locker(&m_mutex); - if (m_middleBuffer && m_middleBuffer->serviceId) { + if (m_taskRunner) { std::swap(m_middleBuffer, m_frontBuffer); m_taskRunner->PostTask( FROM_HERE, -- cgit v1.2.1 From d471a2da0ae85062e07929e13ebc5d720144de33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Fri, 14 Aug 2020 14:28:31 +0200 Subject: Update Chromium This pulls in the following changes: c153fafb306 Fix invalid dbus bus name error in MPRIS Fixes: QTBUG-85626 Change-Id: I7913a1caede7041632b1c070152f54a848c063ab Reviewed-by: Michal Klocek --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 30a0c954b..c153fafb3 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 30a0c954b97ae86385ff022d6c101fe900295695 +Subproject commit c153fafb306d118a610d1a0acc55b54c564ae87d -- cgit v1.2.1 From 7b6f30c13717654ec3b95e67edde88a03da45e22 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 14 Aug 2020 15:07:29 +0200 Subject: Fix suggest-override warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also violates modern Qt code style Change-Id: Ibb12b6db18bbd2669377abe1d25034ed69a86389 Reviewed-by: Jüri Valdmann --- src/webengine/api/qquickwebenginefaviconprovider_p_p.h | 2 +- src/webengine/api/qquickwebenginehistory_p.h | 6 +++--- src/webengine/api/qquickwebenginetestsupport_p.h | 6 +++--- src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h | 2 +- src/webengine/testsupport/plugin.cpp | 2 +- src/webenginewidgets/api/qwebenginepage.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h b/src/webengine/api/qquickwebenginefaviconprovider_p_p.h index 18b6d61c8..4ccc4ba10 100644 --- a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h +++ b/src/webengine/api/qquickwebenginefaviconprovider_p_p.h @@ -72,7 +72,7 @@ public: void detach(QQuickWebEngineView *); - virtual QPixmap requestPixmap(const QString &, QSize *, const QSize &); + QPixmap requestPixmap(const QString &, QSize *, const QSize &) override; private: QQuickWebEngineView *viewForIconUrl(const QUrl &) const; diff --git a/src/webengine/api/qquickwebenginehistory_p.h b/src/webengine/api/qquickwebenginehistory_p.h index 5d4783e96..db0be3bad 100644 --- a/src/webengine/api/qquickwebenginehistory_p.h +++ b/src/webengine/api/qquickwebenginehistory_p.h @@ -73,9 +73,9 @@ public: QQuickWebEngineHistoryListModel(QQuickWebEngineHistoryListModelPrivate*); virtual ~QQuickWebEngineHistoryListModel(); - int rowCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role) const; - QHash roleNames() const; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role) const override; + QHash roleNames() const override; void reset(); private: diff --git a/src/webengine/api/qquickwebenginetestsupport_p.h b/src/webengine/api/qquickwebenginetestsupport_p.h index 30e6ee5c4..89a997b29 100644 --- a/src/webengine/api/qquickwebenginetestsupport_p.h +++ b/src/webengine/api/qquickwebenginetestsupport_p.h @@ -86,9 +86,9 @@ public: Q_INVOKABLE void create(); Q_INVOKABLE void release(); - virtual void showInputPanel(); - virtual void hideInputPanel(); - virtual bool isInputPanelVisible() const; + void showInputPanel() override; + void hideInputPanel() override; + bool isInputPanelVisible() const override; private: bool m_visible; diff --git a/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h b/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h index 277436289..5379a5729 100644 --- a/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h +++ b/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h @@ -65,7 +65,7 @@ public: ~QQuickWebEngineTouchHandleProvider(); void init(const QMap &images); - virtual QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize); + QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override; private: QMap m_touchHandleMap; diff --git a/src/webengine/testsupport/plugin.cpp b/src/webengine/testsupport/plugin.cpp index 7a1e73d8b..828110207 100644 --- a/src/webengine/testsupport/plugin.cpp +++ b/src/webengine/testsupport/plugin.cpp @@ -48,7 +48,7 @@ class QtWebEngineTestSupportPlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - virtual void registerTypes(const char *uri) + void registerTypes(const char *uri) override { qWarning("\nWARNING: This project is using the testsupport QML API extensions for QtWebEngine and is therefore tied to a specific QtWebEngine release.\n" "WARNING: The testsupport API will change from version to version, or even be removed. You have been warned!\n"); diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h index 3cf6a9f8b..3bf79526d 100644 --- a/src/webenginewidgets/api/qwebenginepage.h +++ b/src/webenginewidgets/api/qwebenginepage.h @@ -255,7 +255,7 @@ public: void replaceMisspelledWord(const QString &replacement); - virtual bool event(QEvent*); + bool event(QEvent*) override; void findText(const QString &subString, FindFlags options = FindFlags(), const QWebEngineCallback &resultCallback = QWebEngineCallback()); -- cgit v1.2.1 From 3a03bd178fe8cdcfef23fe59a5751b269d0a699a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 18 Aug 2020 14:08:31 +0200 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submodule src/3rdparty c153fafb..4e0b66a6: > Remove blocking of proper fixes > Fix bison 3.7 Fixes: QTBUG-85835 Change-Id: If3b77c7db6203ccd0137ea381c927bd09cede505 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index c153fafb3..4e0b66a6f 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit c153fafb306d118a610d1a0acc55b54c564ae87d +Subproject commit 4e0b66a6f2d6901b4c738c8bcfb9d89d74def602 -- cgit v1.2.1 From 59f69133a067ee51a2eeb5aabc5e2f569dd66d28 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 18 Aug 2020 12:12:20 +0200 Subject: Enable H264 for WebRTC when using proprietary codecs Was enabled for all platforms except windows using MSVC, but compiles just fine for us. Fixes: QTBUG-86092 Change-Id: Ib15d94c36b8a411dd5eab01843db1a3666ac370f Reviewed-by: Michal Klocek --- src/core/config/common.pri | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/core/config/common.pri b/src/core/config/common.pri index c1658ce82..9432fac7d 100644 --- a/src/core/config/common.pri +++ b/src/core/config/common.pri @@ -27,6 +27,9 @@ qtConfig(webengine-webrtc) { qtConfig(webengine-proprietary-codecs) { gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\" + qtConfig(webengine-webrtc) { + gn_args += rtc_use_h264=true + } } else { gn_args += proprietary_codecs=false } -- cgit v1.2.1 From 00d5008c27fdff1b9f3a5de15aca27fbfcbee430 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 18 Aug 2020 16:37:49 +0200 Subject: Do not let Blink advertise web speech api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least turns our support off on html5test.com Change-Id: Ic82800b0efb70bb5589f7544b851ebcd64000105 Reviewed-by: Michael Brüning --- src/core/web_engine_context.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 11365de62..7cc84eae7 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -620,6 +620,9 @@ WebEngineContext::WebEngineContext() bool enableViz = !parsedCommandLine->HasSwitch("disable-viz-display-compositor"); parsedCommandLine->RemoveSwitch("disable-viz-display-compositor"); + // Do not advertise a feature we have removed at compile time + parsedCommandLine->AppendSwitch(switches::kDisableSpeechAPI); + std::string disableFeatures; std::string enableFeatures; // Needed to allow navigations within pages that were set using setHtml(). One example is -- cgit v1.2.1 From 6deddc5ecd6155c567aecd0338c53c63fa465bfd Mon Sep 17 00:00:00 2001 From: Tamas Zakor Date: Wed, 8 Jul 2020 14:50:14 +0200 Subject: Ignore QQuickWebEngineNewViewRequest if it is unhandled This is the case when the WebEngineNewViewRequest.openIn() is not called on newViewRequested(). For example, when opening the view source from context menu in quick minimal example. Fixes: QTBUG-85494 Change-Id: I7c1ae53684361de459b2f268e471904e632821b0 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebenginenewviewrequest.cpp | 1 + src/webengine/api/qquickwebenginenewviewrequest_p.h | 1 + src/webengine/api/qquickwebengineview.cpp | 4 ++++ 3 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/webengine/api/qquickwebenginenewviewrequest.cpp b/src/webengine/api/qquickwebenginenewviewrequest.cpp index 0af943de8..78ae1622a 100644 --- a/src/webengine/api/qquickwebenginenewviewrequest.cpp +++ b/src/webengine/api/qquickwebenginenewviewrequest.cpp @@ -117,5 +117,6 @@ void QQuickWebEngineNewViewRequest::openIn(QQuickWebEngineView *view) view->d_func()->adoptWebContents(m_adapter.data()); else view->setUrl(m_requestedUrl); + m_isRequestHandled = true; m_adapter.reset(); } diff --git a/src/webengine/api/qquickwebenginenewviewrequest_p.h b/src/webengine/api/qquickwebenginenewviewrequest_p.h index e21f76111..d4686b291 100644 --- a/src/webengine/api/qquickwebenginenewviewrequest_p.h +++ b/src/webengine/api/qquickwebenginenewviewrequest_p.h @@ -77,6 +77,7 @@ private: QQuickWebEngineNewViewRequest(); QQuickWebEngineView::NewViewDestination m_destination; bool m_isUserInitiated; + bool m_isRequestHandled = false; QSharedPointer m_adapter; QUrl m_requestedUrl; friend class QQuickWebEngineView; diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index aeb202c6a..7b875bf55 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -554,6 +554,7 @@ QQuickWebEngineViewPrivate::adoptNewWindow(QSharedPointer ne const QRect &, const QUrl &targetUrl) { Q_Q(QQuickWebEngineView); + Q_ASSERT(newWebContents); QQuickWebEngineNewViewRequest request; request.m_adapter = newWebContents; request.m_isUserInitiated = userGesture; @@ -578,6 +579,9 @@ QQuickWebEngineViewPrivate::adoptNewWindow(QSharedPointer ne Q_EMIT q->newViewRequested(&request); + if (!request.m_isRequestHandled) + return nullptr; + return newWebContents; } -- cgit v1.2.1 From 7aa99d8d5b0dbf024019e70bf39b7d15796e1080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Fri, 26 Jun 2020 13:24:01 +0200 Subject: Fix ScopedGLContextChecker with QTWEBENGINE_DISABLE_GPU_THREAD=1 The ScopedGLContextChecker, which deactivates the current QOpenGLContext when executing Chromium tasks, is currently enabled only if QOpenGLContext::supportsThreadedOpenGL() is false. But the gpu thread can nowadays be disabled also with an environment variable and ScopedGLContextChecker needs to take this into account. Change-Id: I012524538b49b033ed053dbc41ed4350db916542 Reviewed-by: Michal Klocek (cherry picked from commit 5988cec1a1b59aa163042a419c4c2e978bb814bb) --- src/core/browser_main_parts_qt.cpp | 2 +- src/core/web_engine_context.cpp | 23 ++++++++++++----------- src/core/web_engine_context.h | 4 +++- src/core/web_engine_context_threads.cpp | 4 ++-- 4 files changed, 18 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp index 925c18664..45056fec2 100644 --- a/src/core/browser_main_parts_qt.cpp +++ b/src/core/browser_main_parts_qt.cpp @@ -190,7 +190,7 @@ private: } private: - bool m_enabled = !QOpenGLContext::supportsThreadedOpenGL(); + bool m_enabled = WebEngineContext::isGpuServiceOnUIThread(); #endif // QT_CONFIG(opengl) }; diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 7cc84eae7..11692c2d1 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -496,6 +496,17 @@ const static char kChromiumFlagsEnv[] = "QTWEBENGINE_CHROMIUM_FLAGS"; const static char kDisableSandboxEnv[] = "QTWEBENGINE_DISABLE_SANDBOX"; const static char kDisableInProcGpuThread[] = "QTWEBENGINE_DISABLE_GPU_THREAD"; +// static +bool WebEngineContext::isGpuServiceOnUIThread() +{ + static bool threadedGpu = +#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS) + QOpenGLContext::supportsThreadedOpenGL() && +#endif + !qEnvironmentVariableIsSet(kDisableInProcGpuThread); + return !threadedGpu; +} + static void appendToFeatureList(std::string &featureList, const char *feature) { if (featureList.empty()) @@ -606,16 +617,6 @@ WebEngineContext::WebEngineContext() if (isDesktopGLOrSoftware || isGLES2Context) parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext); #endif - bool threadedGpu = false; -#if QT_CONFIG(opengl) - threadedGpu = QOpenGLContext::supportsThreadedOpenGL(); -#if defined(Q_OS_MACOS) - // QtBase disabled it when building on 10.14+, unfortunately we still need it - // until we have fixed single-threaded viz-display-compositor. - threadedGpu = true; -#endif -#endif - threadedGpu = threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread); bool enableViz = !parsedCommandLine->HasSwitch("disable-viz-display-compositor"); parsedCommandLine->RemoveSwitch("disable-viz-display-compositor"); @@ -774,7 +775,7 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kDisableGpu); } - registerMainThreadFactories(threadedGpu); + registerMainThreadFactories(); SetContentClient(new ContentClientQt); diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h index 6cbd5c8e5..e2190f8a2 100644 --- a/src/core/web_engine_context.h +++ b/src/core/web_engine_context.h @@ -123,13 +123,15 @@ public: static gpu::SyncPointManager *syncPointManager(); + static bool isGpuServiceOnUIThread(); + private: friend class base::RefCounted; friend class ProfileAdapter; WebEngineContext(); ~WebEngineContext(); - static void registerMainThreadFactories(bool threaded); + static void registerMainThreadFactories(); static void destroyGpuProcess(); std::unique_ptr m_runLoop; diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp index ba3e18499..5f9e345f7 100644 --- a/src/core/web_engine_context_threads.cpp +++ b/src/core/web_engine_context_threads.cpp @@ -125,11 +125,11 @@ void WebEngineContext::destroyGpuProcess() } // static -void WebEngineContext::registerMainThreadFactories(bool threaded) +void WebEngineContext::registerMainThreadFactories() { content::UtilityProcessHost::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread); content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread); - if (threaded) + if (!isGpuServiceOnUIThread()) content::RegisterGpuMainThreadFactory(content::CreateInProcessGpuThread); else content::RegisterGpuMainThreadFactory(createGpuThreadController); -- cgit v1.2.1