From 3db2cf8b8e3cf98ed03ab7220e4006946b741973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 24 Sep 2019 13:26:39 +0200 Subject: Update Chromium This pulls in the following changes: ae7a5db571b [Backport] Fix security issue 957160 3e1ca50e045 [Backport] Fix CVE-2019-5869 3ab252e808d Restore webrtc H.264 support with MSVC b84e8682b31 Fix building with pulseaudio 13 56c9ec96237 Add workaround for MSVC bug in libvpx AVX2 code Change-Id: I57a3d62e5ba0ae1ab261daf0b7990a5a332cf59c 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 0240cfc1a..56c9ec962 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 0240cfc1a59deb5b612923d47ccef72f10504fe1 +Subproject commit 56c9ec96237de4c7787c643c7ac7ac4e00c9a1d1 -- cgit v1.2.3 From e31acc86e991d6f83bd56eebb7371914fc9ca5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 24 Sep 2019 17:46:19 +0200 Subject: Fix XMLHttpRequest status with custom schemes Emulate a HTTP 200 OK response when QWebEngineUrlRequestJob::reply is called so that an XMLHttpRequest to a custom scheme gets a proper 'status' property. Note that calling QWebEngineUrlRequestJob::fail on the other hand emulates a network error, meaning it triggers the 'error' event in XMLHttpRequest. Fixes: QTBUG-78316 Change-Id: Ia7249a5b72533aa7e2ed4ef8f62d8b6b89820cc1 Reviewed-by: Allan Sandfeld Jensen --- src/core/net/url_request_custom_job.cpp | 18 ++++++++++++++++++ src/core/net/url_request_custom_job.h | 1 + 2 files changed, 19 insertions(+) (limited to 'src') diff --git a/src/core/net/url_request_custom_job.cpp b/src/core/net/url_request_custom_job.cpp index cba9b4dc5..d8442707e 100644 --- a/src/core/net/url_request_custom_job.cpp +++ b/src/core/net/url_request_custom_job.cpp @@ -40,10 +40,12 @@ #include "url_request_custom_job.h" #include "url_request_custom_job_proxy.h" +#include "base/strings/stringprintf.h" #include "base/task/post_task.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "net/base/io_buffer.h" +#include "net/http/http_util.h" #include @@ -136,6 +138,22 @@ bool URLRequestCustomJob::GetCharset(std::string* charset) return false; } +void URLRequestCustomJob::GetResponseInfo(HttpResponseInfo* info) +{ + if (m_error) + return; + + std::string headers; + if (m_redirect.is_valid()) { + headers += "HTTP/1.1 303 See Other\n"; + headers += base::StringPrintf("Location: %s\n", m_redirect.spec().c_str()); + } else { + headers += "HTTP/1.1 200 OK\n"; + } + + info->headers = new HttpResponseHeaders(HttpUtil::AssembleRawHeaders(headers.c_str(), headers.size())); +} + bool URLRequestCustomJob::IsRedirectResponse(GURL* location, int* http_status_code, bool* /*insecure_scheme_was_upgraded*/) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); diff --git a/src/core/net/url_request_custom_job.h b/src/core/net/url_request_custom_job.h index 16be76f29..c800d1595 100644 --- a/src/core/net/url_request_custom_job.h +++ b/src/core/net/url_request_custom_job.h @@ -64,6 +64,7 @@ public: int ReadRawData(net::IOBuffer *buf, int buf_size) override; bool GetMimeType(std::string *mimeType) const override; bool GetCharset(std::string *charset) override; + void GetResponseInfo(net::HttpResponseInfo* info) override; bool IsRedirectResponse(GURL* location, int* http_status_code, bool* insecure_scheme_was_upgraded) override; protected: -- cgit v1.2.3 From e77ec61b7ba1fb71b397ef358036b5057a0cb39b Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 18 Sep 2019 10:53:38 +0200 Subject: Unify shared context initialization Setting shared context on core application object should be done before core application is initialised. This is handled correctly in widgets part but not in qml part. Unify our shared context creation and call WebEngine::initialize() before QCoreaApplication is created. Context has to be set shared before first window's QPlatformOpenGLContext is created and not before window itself is created as documentation claimed. Keep the older code running, but print the warning. Update one test to test new initialization order, but keep the others to check if they still works. [ChangeLog] WebEngine::initialize() has to be called before QCoreApplication is created. Task-number: QTBUG-76391 Change-Id: Iff938493a4d21f360110136192daedb6199584c1 Reviewed-by: Allan Sandfeld Jensen --- src/core/api/qtwebenginecoreglobal.cpp | 2 +- src/core/content_browser_client_qt.cpp | 2 +- src/webengine/api/qtwebengineglobal.cpp | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp index 25d0bd3be..3c7fc54a1 100644 --- a/src/core/api/qtwebenginecoreglobal.cpp +++ b/src/core/api/qtwebenginecoreglobal.cpp @@ -108,7 +108,7 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize() QCoreApplication *app = QCoreApplication::instance(); if (!app) { - qFatal("QtWebEngine::initialize() must be called after the construction of the application object."); + qFatal("QtWebEngine::initialize() but no core application instance."); return; } diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 16945020b..04a8fc363 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -235,7 +235,7 @@ void ShareGroupQtQuick::AboutToAddFirstContext() // This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering. QOpenGLContext *shareContext = qt_gl_global_share_context(); if (!shareContext) { - qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function."); + qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function before QCoreApplication is created."); } m_shareContextQtQuick = new QtShareGLContext(shareContext); #endif diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp index a11618dba..4346832c9 100644 --- a/src/webengine/api/qtwebengineglobal.cpp +++ b/src/webengine/api/qtwebengineglobal.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qtwebengineglobal.h" +#include namespace QtWebEngineCore { @@ -62,8 +63,8 @@ namespace QtWebEngine { /*! \fn QtWebEngine::initialize() - Sets up an OpenGL Context that can be shared between threads. This has to be done after - QGuiApplication is created, but before a Qt Quick window is created. + Sets up an OpenGL Context that can be shared between threads. This has to be done before + QGuiApplication is created and before window's QPlatformOpenGLContext is created. This has the same effect as setting the Qt::AA_ShareOpenGLContexts attribute with QCoreApplication::setAttribute before constructing @@ -71,7 +72,15 @@ namespace QtWebEngine { */ void initialize() { - QtWebEngineCore::initialize(); + QCoreApplication *app = QCoreApplication::instance(); + if (app) { + qWarning("QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. "\ + "This is depreciated and may fail in the future."); + QtWebEngineCore::initialize(); + return; + } + // call initialize the same way as widgets do + qAddPreRoutine(QtWebEngineCore::initialize); } } // namespace QtWebEngine -- cgit v1.2.3 From b44ed0fb99cd3d7047fcd322010c27cfa7989a18 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 18 Sep 2019 17:40:29 +0200 Subject: Reuse action for back, forward, reload web actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now back, forward, reload web action where created for context menu and bind to current webview. This change makes the binding to page instead. Change-Id: Id27db4a110e624f6ea916f31f529c21caa35668b Reviewed-by: Jüri Valdmann --- src/webenginewidgets/api/qwebenginepage.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 7b66ac876..2b18d63b1 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -2539,16 +2539,13 @@ void QContextMenuBuilder::addMenuItem(ContextMenuItem menuItem) switch (menuItem) { case ContextMenuItem::Back: - action = new QAction(QIcon::fromTheme(QStringLiteral("go-previous")), QWebEnginePage::tr("&Back"), m_menu); - QObject::connect(action, &QAction::triggered, thisRef->d_ptr->view, &QWebEngineView::back); + action = thisRef->action(QWebEnginePage::Back); break; case ContextMenuItem::Forward: - action = new QAction(QIcon::fromTheme(QStringLiteral("go-next")), QWebEnginePage::tr("&Forward"), m_menu); - QObject::connect(action, &QAction::triggered, thisRef->d_ptr->view, &QWebEngineView::forward); + action = thisRef->action(QWebEnginePage::Forward); break; case ContextMenuItem::Reload: - action = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), QWebEnginePage::tr("&Reload"), m_menu); - QObject::connect(action, &QAction::triggered, thisRef->d_ptr->view, &QWebEngineView::reload); + action = thisRef->action(QWebEnginePage::Reload); break; case ContextMenuItem::Cut: action = thisRef->action(QWebEnginePage::Cut); -- cgit v1.2.3 From 13a336137a77bcc17fcdeaade3900a25a4e61e74 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 9 Oct 2019 15:52:57 +0200 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pulls in the following changes: ccfc032fb57 FIXUP: Disable crash-reports when reporting is disabled 7efe91029a6 Improve jpeg headers handling be2b74f4ab8 [Backport][ios] Get things compiling on Xcode 11. 3449634e50a Fix use of deprecated method for scanning wifi networks 8c785066d98 Workaround presumably wrong macOS SDK detection Fixes: QTBUG-78997 Change-Id: Ib23116fb51e89ca32ae4631350969377d2d8a42e 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 56c9ec962..8c785066d 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 56c9ec96237de4c7787c643c7ac7ac4e00c9a1d1 +Subproject commit 8c785066d987b663ed7d3386151ec8144c31cdcc -- cgit v1.2.3 From 7d08de5b527cb2112556a126b889dd7d0d888d22 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 7 Oct 2019 10:59:45 +0200 Subject: Fix life cycle issue of QWebEngineUrlRequestInterceptor Since 5e92adf intercept() is called on ui thread, however this patch does not consider deletion of interceptor while io thread still process the request and for examples checks interceptor's deprecated property. Fix it. Note this only fixes issue for interceptors which are not deprecated therefore run on ui thread. Change-Id: I5d5909065563e57a0cacb81fd04271b3f88596de Reviewed-by: Allan Sandfeld Jensen --- src/core/net/network_delegate_qt.cpp | 16 +++++++++------- src/core/net/url_request_notification.cpp | 2 +- src/core/profile_io_data_qt.cpp | 9 +++++++++ src/core/profile_io_data_qt.h | 4 +++- 4 files changed, 22 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp index 7f278fd92..2cca152e6 100644 --- a/src/core/net/network_delegate_qt.cpp +++ b/src/core/net/network_delegate_qt.cpp @@ -136,11 +136,11 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet // Deprecated =begin // quick peek if deprecated - QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->requestInterceptor(); - if (profileInterceptor && profileInterceptor->property("deprecated").toBool()) { - profileInterceptor = nullptr; - if (QWebEngineUrlRequestInterceptor* interceptor = m_profileIOData->acquireInterceptor()) { - interceptor->interceptRequest(requestInfo); + + if (m_profileIOData->isInterceptorDeprecated()) { + QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->acquireInterceptor(); + if (profileInterceptor && m_profileIOData->isInterceptorDeprecated()) { + profileInterceptor->interceptRequest(requestInfo); m_profileIOData->releaseInterceptor(); if (requestInfo.changed()) { int result = infoPrivate->shouldBlockRequest ? net::ERR_BLOCKED_BY_CLIENT : net::OK; @@ -174,7 +174,9 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet if (!resourceInfo) return net::OK; - if (!m_profileIOData->hasPageInterceptors() && !profileInterceptor && !content::IsResourceTypeFrame(resourceType)) + // try to bail out + if (!m_profileIOData->hasPageInterceptors() && (!m_profileIOData->requestInterceptor() || m_profileIOData->isInterceptorDeprecated()) && + !content::IsResourceTypeFrame(resourceType)) return net::OK; auto webContentsGetter = resourceInfo->GetWebContentsGetterForRequest(); @@ -185,7 +187,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet std::move(requestInfo), webContentsGetter, std::move(callback), - profileInterceptor ? m_profileIOData->profileAdapter() : nullptr + m_profileIOData->profileAdapter() ); // We'll run the callback after we notified the UI thread. diff --git a/src/core/net/url_request_notification.cpp b/src/core/net/url_request_notification.cpp index e37ad35bc..9d309e314 100644 --- a/src/core/net/url_request_notification.cpp +++ b/src/core/net/url_request_notification.cpp @@ -107,7 +107,7 @@ void URLRequestNotification::notify() if (webContents) { - if (m_profileAdapter) { + if (m_profileAdapter && m_profileAdapter->requestInterceptor()) { QWebEngineUrlRequestInterceptor* interceptor = m_profileAdapter->requestInterceptor(); if (!interceptor->property("deprecated").toBool()) interceptor->interceptRequest(m_requestInfo); diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp index 27c97a986..6ed172335 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -741,9 +741,18 @@ void ProfileIODataQt::updateRequestInterceptor() QMutexLocker 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() { m_mutex.lock(); diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index 570365085..a1b123771 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -120,7 +120,8 @@ public: void setGlobalCertificateVerification(); // Used in NetworkDelegateQt::OnBeforeURLRequest. - QWebEngineUrlRequestInterceptor *acquireInterceptor(); + bool isInterceptorDeprecated() const; // Remove for Qt6 + QWebEngineUrlRequestInterceptor *acquireInterceptor(); // Remove for Qt6 void releaseInterceptor(); QWebEngineUrlRequestInterceptor *requestInterceptor(); @@ -191,6 +192,7 @@ private: base::WeakPtrFactory m_weakPtrFactory; // this should be always the last member QString m_dataPath; bool m_pendingStorageRequestGeneration = false; + volatile bool m_isInterceptorDeprecated = false; // Remove for Qt6 DISALLOW_COPY_AND_ASSIGN(ProfileIODataQt); friend class BrowsingDataRemoverObserverQt; -- cgit v1.2.3 From 7c3977b60c59f5e4826f8c0a58ad887672d55fe1 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 10 Oct 2019 09:37:03 +0200 Subject: FIXUP: Fix page and profile interceptors initialization Previous commit showed an issue when interceptors are set before URLRequestContextGetterQt is created. The initial initialization was done on updateStorageSettings() which only affected profile interceptor initialization. Add explicit updateRequestInterceptor call to have profile and page interceptors initialized. This fixes also the issue of not set properly 'deprecated' flag. Change-Id: I0dda9eff67a2d779f4c9693920077a5aac2d9122 Reviewed-by: Allan Sandfeld Jensen --- src/core/profile_io_data_qt.cpp | 1 - src/core/profile_qt.cpp | 1 + 2 files 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 6ed172335..a2613d3fc 100644 --- a/src/core/profile_io_data_qt.cpp +++ b/src/core/profile_io_data_qt.cpp @@ -614,7 +614,6 @@ void ProfileIODataQt::setRequestContextData(content::ProtocolHandlerMap *protoco void ProfileIODataQt::setFullConfiguration() { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - m_requestInterceptor = m_profileAdapter->requestInterceptor(); m_persistentCookiesPolicy = m_profileAdapter->persistentCookiesPolicy(); m_cookiesPath = m_profileAdapter->cookiesPath(); m_channelIdPath = m_profileAdapter->channelIdPath(); diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index 5977a28a8..cd8ee8110 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -272,6 +272,7 @@ net::URLRequestContextGetter *ProfileQt::CreateRequestContext( m_profileIOData->setRequestContextData(protocol_handlers, std::move(request_interceptors)); m_profileIOData->updateStorageSettings(); + m_profileIOData->updateRequestInterceptor(); m_urlRequestContextGetter = new URLRequestContextGetterQt(m_profileIOData.get()); return m_urlRequestContextGetter.get(); } -- cgit v1.2.3 From 51228eb249a178ada6ebd2ccd5e662bcd7bd2c60 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 10 Oct 2019 08:08:24 +0200 Subject: Don't modify the allowed actions as they are correct already MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By not modifying the allowed actions instead of just setting it to be the MoveAction will enable dragging from a webpage to another webpage to work correctly. Otherwise it will potentially reject the drag because it is seen only as a move, whereas it wouldn't be possible to really move from one webpage to another as the original source cannot be deleted. Change-Id: I34105d10e7d1dc831016c33c9c6cfc544c4e084b Reviewed-by: Jüri Valdmann --- src/core/web_contents_adapter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index ca2479965..d1fe786f6 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1414,8 +1414,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD }); QMimeData *mimeData = mimeDataFromDropData(*m_currentDropData); - if (handleDropDataFileContents(dropData, mimeData)) - allowedActions = Qt::MoveAction; + handleDropDataFileContents(dropData, mimeData); drag->setMimeData(mimeData); if (!pixmap.isNull()) { -- cgit v1.2.3 From 2e15d4724e1984111d37370b4c2e56cbb87bb38c Mon Sep 17 00:00:00 2001 From: Allan Jensen Date: Wed, 9 Oct 2019 14:51:25 +0200 Subject: Fix accessiblity events for combo-boxes The editable text-fields gets value-changed events from Blink instead of the text-changed events we needed. Change-Id: I688c06b644f333a3ba1ebd8831adbbbb7d49cbe7 Fixes: QTBUG-78206 Reviewed-by: Peter Varga --- src/core/browser_accessibility_manager_qt.cpp | 18 ++++++++++++++++++ src/core/browser_accessibility_manager_qt.h | 2 ++ 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp index 7fb1386c5..8e3ee5940 100644 --- a/src/core/browser_accessibility_manager_qt.cpp +++ b/src/core/browser_accessibility_manager_qt.cpp @@ -146,6 +146,24 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type, break; } } + +void BrowserAccessibilityManagerQt::FireGeneratedEvent(ui::AXEventGenerator::Event event_type, + BrowserAccessibility* node) +{ + BrowserAccessibilityQt *iface = static_cast(node); + + switch (event_type) { + case ui::AXEventGenerator::Event::VALUE_CHANGED: + if (iface->role() == QAccessible::EditableText) { + QAccessibleTextUpdateEvent event(iface, -1, QString(), QString()); + QAccessible::updateAccessibility(&event); + } + break; + default: + break; + } +} + #endif // QT_NO_ACCESSIBILITY } diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h index 87c8875ba..16e2d1fe7 100644 --- a/src/core/browser_accessibility_manager_qt.h +++ b/src/core/browser_accessibility_manager_qt.h @@ -60,6 +60,8 @@ public: ~BrowserAccessibilityManagerQt() override; void FireBlinkEvent(ax::mojom::Event event_type, BrowserAccessibility* node) override; + void FireGeneratedEvent(ui::AXEventGenerator::Event event_type, + BrowserAccessibility* node) override; QAccessibleInterface *rootParentAccessible(); bool isValid() const { return m_valid; } -- cgit v1.2.3 From 986a1e024cc273f613d2c11e8f2ecc6ecd120ea0 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 23 Sep 2019 13:04:24 +0200 Subject: Add workaround for broken rendering on embedded On some boards we get wrong tile textures on the screen. It looks like this is some sort of a race condition or a problem with gl fencing. Add quick workaround by setting QTWEBENGINE_DISABLE_GPU_THREAD env. variable to force no in-process-gpu-thread. Change-Id: Ib397b04e039a279413c79277e25b77064b9b6854 Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index a3a5881bf..07e0d3ba8 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -362,6 +362,7 @@ ProxyAuthentication WebEngineContext::qProxyNetworkAuthentication(QString host, const static char kChromiumFlagsEnv[] = "QTWEBENGINE_CHROMIUM_FLAGS"; const static char kDisableSandboxEnv[] = "QTWEBENGINE_DISABLE_SANDBOX"; +const static char kDisableInProcGpuThread[] = "QTWEBENGINE_DISABLE_GPU_THREAD"; static void appendToFeatureList(std::string &featureList, const char *feature) { @@ -608,6 +609,7 @@ WebEngineContext::WebEngineContext() #ifndef QT_NO_OPENGL threadedGpu = QOpenGLContext::supportsThreadedOpenGL(); #endif + threadedGpu = threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread); registerMainThreadFactories(threadedGpu); SetContentClient(new ContentClientQt); -- cgit v1.2.3 From 4a141b148d04be3b97d29d2ef808c30c2e8f54b1 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 14 Oct 2019 15:33:36 +0200 Subject: Update Chromium Changes: 6a5dc3af3537 [Backport] Reintroduce glib message event loop 1/3 580ffe2cb750 [Backport] Reintroduce glib event loop 2/3 9ae8ddaeea11 Reintroduce glib event loop 3/3 1f07ca687b1a [Backport] CVE-2019-5870 00d9e1e3be09 [Backport] CVE-2019-5872 d627df149baa [Backport] CVE-2019-5875 2d9ed8b1aaa6 [Backport] CVE-2019-5876 bebd1df6d51d [Backport] CVE-2019-13691 1c7141ad185b [Backport] CVE-2019-13692 f0e6f7f8a392 [Backport] CVE-2019-13688 495b2ebcd9d3 [Backport] CVE-2019-13687 cc18c848e174 [Backport] CVE-2019-13693 b41d57627c00 [Backport] CVE-2019-13695 c88d2026cc60 [Backport] CVE-2019-13697 Task-number: QTBUG-79193 Change-Id: I1a318d573d5f95c8bad02e96ed5084a1a1ef7bf8 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 8c785066d..c88d2026c 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 8c785066d987b663ed7d3386151ec8144c31cdcc +Subproject commit c88d2026cc604c9cc7b42e4684eb480f12690e30 -- cgit v1.2.3 From 0cbd705b119169db0dc6cb83f811a045570dd975 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 15 Oct 2019 10:44:14 +0200 Subject: Disable explicitly glib There some issue with running glib event message pump, due to coming release just make sure glib is disabled. Change-Id: Ibe7b89ddfbcd57dbb41cfbc5d6a8ad1c69be39cb Reviewed-by: Allan Sandfeld Jensen --- src/core/config/linux.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 22cb5991f..f45c418fe 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -178,7 +178,7 @@ host_build { } else { gn_args += use_system_harfbuzz=false } - !qtConfig(webengine-system-glib): gn_args += use_glib=false + gn_args += use_glib=false qtConfig(webengine-pulseaudio) { gn_args += use_pulseaudio=true } else { -- cgit v1.2.3 From 0d8e9d612951f2501f7e1f92f0173ab0e680324e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Thu, 10 Oct 2019 13:53:17 +0200 Subject: Fix getDisplayMedia crash The MEDIA_DISPLAY_VIDEO_CAPTURE stream type is handled incorrectly by MediaCaptureDevicesDispatcher causing a crash when an unexpected type of media device is returned to Chromium. This patch only fixes the crash, screen sharing is nonetheless not properly supported by WebEngine due to limitations of the public API which does not allow selecting between screens, not to mention windows or tabs. On Linux WebRTC's ScreenCapturer is not even built since it depends on use_x11 being set in GN. Fixes: QTBUG-78016 Change-Id: I7fa49febaba1be94bdb6c31265dfc24ee809d635 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Qt CI Bot --- src/core/media_capture_devices_dispatcher.cpp | 76 +++++++++++++++------------ 1 file changed, 41 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index ecc46f244..29230c27b 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -87,22 +87,25 @@ const blink::MediaStreamDevice *findDeviceWithId(const blink::MediaStreamDevices return 0; } -// Based on chrome/browser/media/desktop_capture_access_handler.cc: -void getDevicesForDesktopCapture(blink::MediaStreamDevices *devices, content::DesktopMediaID mediaId, bool captureAudio) +// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc: +void getDevicesForDesktopCapture(blink::MediaStreamDevices *devices, + content::DesktopMediaID mediaId, + bool captureAudio, + blink::MediaStreamType videoType, + blink::MediaStreamType audioType) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Add selected desktop source to the list. - devices->push_back(blink::MediaStreamDevice(blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE, mediaId.ToString(), "Screen")); + devices->push_back(blink::MediaStreamDevice(videoType, mediaId.ToString(), mediaId.ToString())); if (captureAudio) { if (mediaId.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) { devices->push_back( - blink::MediaStreamDevice(blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE, - mediaId.ToString(), "Tab audio")); + blink::MediaStreamDevice(audioType, mediaId.ToString(), "Tab audio")); } else { // Use the special loopback device ID for system audio capture. devices->push_back(blink::MediaStreamDevice( - blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE, + audioType, media::AudioDeviceDescription::kLoopbackInputDeviceId, "System Audio")); } @@ -151,19 +154,27 @@ content::DesktopMediaID getDefaultScreenId() WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const content::MediaStreamRequest &request) { - WebContentsAdapterClient::MediaRequestFlags requestFlags = WebContentsAdapterClient::MediaNone; + if (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE && + request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE) + return {WebContentsAdapterClient::MediaAudioCapture, WebContentsAdapterClient::MediaVideoCapture}; - if (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE) - requestFlags |= WebContentsAdapterClient::MediaAudioCapture; - else if (request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE) - requestFlags |= WebContentsAdapterClient::MediaDesktopAudioCapture; + if (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE && + request.video_type == blink::MEDIA_NO_SERVICE) + return {WebContentsAdapterClient::MediaAudioCapture}; - if (request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE) - requestFlags |= WebContentsAdapterClient::MediaVideoCapture; - else if (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) - requestFlags |= WebContentsAdapterClient::MediaDesktopVideoCapture; + if (request.audio_type == blink::MEDIA_NO_SERVICE && + request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE) + return {WebContentsAdapterClient::MediaVideoCapture}; - return requestFlags; + if (request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE && + request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) + return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture}; + + if (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE || + request.video_type == blink::MEDIA_DISPLAY_VIDEO_CAPTURE) + return {WebContentsAdapterClient::MediaDesktopVideoCapture}; + + return {}; } } // namespace @@ -198,14 +209,13 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content: if (!securityOriginsMatch) qWarning("Security origin mismatch for media access permission: %s requested and %s provided\n", qPrintable(requestSecurityOrigin.toString()), qPrintable(securityOrigin.toString())); - bool microphoneRequested = - (request.audio_type && authorizationFlags & WebContentsAdapterClient::MediaAudioCapture); - bool webcamRequested = - (request.video_type && authorizationFlags & WebContentsAdapterClient::MediaVideoCapture); - bool desktopAudioRequested = - (request.audio_type && authorizationFlags & WebContentsAdapterClient::MediaDesktopAudioCapture); - bool desktopVideoRequested = - (request.video_type && authorizationFlags & WebContentsAdapterClient::MediaDesktopVideoCapture); + WebContentsAdapterClient::MediaRequestFlags requestFlags = mediaRequestFlagsForRequest(request); + WebContentsAdapterClient::MediaRequestFlags finalFlags = requestFlags & authorizationFlags; + + bool microphoneRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture); + bool webcamRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture); + bool desktopAudioRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaDesktopAudioCapture); + bool desktopVideoRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture); if (securityOriginsMatch) { if (microphoneRequested || webcamRequested) { @@ -221,7 +231,8 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content: break; } } else if (desktopVideoRequested) { - getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested); + getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested, + request.video_type, request.audio_type); } } @@ -274,13 +285,13 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter { DCHECK_CURRENTLY_ON(BrowserThread::UI); - // Let's not support tab capture for now. - if (request.video_type == blink::MEDIA_GUM_TAB_VIDEO_CAPTURE || request.audio_type == blink::MEDIA_GUM_TAB_AUDIO_CAPTURE) { + WebContentsAdapterClient::MediaRequestFlags flags = mediaRequestFlagsForRequest(request); + if (!flags) { std::move(callback).Run(blink::MediaStreamDevices(), blink::MEDIA_DEVICE_NOT_SUPPORTED, std::unique_ptr()); return; } - if (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE || request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE) { + if (flags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture)) { const bool screenCaptureEnabled = adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::ScreenCaptureEnabled); const bool originIsSecure = content::IsOriginSecure(request.security_origin); @@ -298,18 +309,13 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter enqueueMediaAccessRequest(webContents, request, std::move(callback)); // We might not require this approval for pepper requests. - adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), mediaRequestFlagsForRequest(request)); + adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), flags); } void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback) { blink::MediaStreamDevices devices; - if (request.video_type != blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE || request.requested_video_device_id.empty()) { - std::move(callback).Run(devices, blink::MEDIA_DEVICE_INVALID_STATE, std::unique_ptr()); - return; - } - content::WebContents *const web_contents_for_stream = content::WebContents::FromRenderFrameHost( content::RenderFrameHost::FromID(request.render_process_id, request.render_frame_id)); content::RenderFrameHost *const main_frame = web_contents_for_stream ? web_contents_for_stream->GetMainFrame() : NULL; @@ -334,7 +340,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content:: // Audio is only supported for screen capture streams. bool capture_audio = (mediaId.type == content::DesktopMediaID::TYPE_SCREEN && request.audio_type == blink::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE); - getDevicesForDesktopCapture(&devices, mediaId, capture_audio); + getDevicesForDesktopCapture(&devices, mediaId, capture_audio, request.video_type, request.audio_type); std::move(callback).Run(devices, devices.empty() ? blink::MEDIA_DEVICE_INVALID_STATE : blink::MEDIA_DEVICE_OK, std::unique_ptr()); -- cgit v1.2.3 From 808645a7518aca9f67fed4a911342fb7f728afaa Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 16 Oct 2019 13:01:47 +0200 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: 01b3f792f17b [Backport] CVE-2019-13659 d0e61ebba346 [Backport] CVE-2019-13694 9312eb97bf60 [Backport] Security issue 986727 [1/2] 66c739040bba [Backport] Security issue 986727 [2/2] b1ce3367b489 [Backport] CVE-2019-13660 ade14af90b01 [Backport] CVE-2019-13633 [1/2] 5f5f67b3a1f5 [Backport] CVE-2019-13664 6ddab05a4c71 [Backport] Security issue 990234 e8ba421d30c9 [Backport] CVE-2019-13663 [2/2] 1f64c1f27840 [Backport] CVE-2019-13665 8635cf233cdf [Backport] CVE-2019-13668 691467ccbb87 [Backport] CVE-2019-13673 fe065266295e [Backport] Security issue 946351 e989f4cb8907 [Backport] Security issue 964938 6114514c9e76 [Backport] Security issue 974354 [1/2] 858447a76544 [Backport] Security issue 974354 [2/2] 3d7a96629b79 Convert asserts to logs and returns in the PpapiHost a42666a17663 Apply workarounds to build extensions with gcc 5.3.1 18d4c6e82503 Revert "[Backport] CVE-2019-13668" Task-number: QTBUG-79193 Change-Id: I2b70a4343fd37321e0c10e574e515e42930ada10 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 c88d2026c..18d4c6e82 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit c88d2026cc604c9cc7b42e4684eb480f12690e30 +Subproject commit 18d4c6e8250324d084d89b17ad80721bb46ddbd9 -- cgit v1.2.3 From d8295dc15d8dd80089c8493a35c88d046d6a4884 Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Wed, 16 Oct 2019 13:19:16 +0200 Subject: Activate extensions on Linux for GCC version 5.3.1 as well This removes the special handling for the lower GCC versions that we support on linux. This will make the extensions and the PDF viewer available on the pre-built linux packages. Change-Id: I7b79c82f8e2596e2401e05f81041d736486d1c7d Fixes: QTBUG-76329 Reviewed-by: Allan Sandfeld Jensen --- src/core/configure.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/core/configure.json b/src/core/configure.json index be686850b..cd3c5c661 100644 --- a/src/core/configure.json +++ b/src/core/configure.json @@ -334,10 +334,6 @@ "label": "thumb instruction set", "type": "hasThumbFlag" }, - "webengine-extensions-gcc-version" : { - "label": "GCC 6 or newer", - "type": "hasGcc6OrNewer" - }, "webengine-noexecstack" : { "label": "linker supports -z noexecstack", "type": "linkerSupportsFlag", @@ -566,7 +562,7 @@ "label": "Extensions", "purpose": "Enables Chromium extensions within certain limits. Currently used for enabling the pdf viewer.", "section": "WebEngine", - "condition": "features.webengine-printing-and-pdf && (tests.webengine-extensions-gcc-version || config.clang || !config.gcc)", + "condition": "features.webengine-printing-and-pdf", "autoDetect": "features.webengine-printing-and-pdf", "output": [ "publicFeature" ] }, -- cgit v1.2.3 From 9bba6cf6ebdb1f174312d447711f3a9a2d33fbe2 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 21 Oct 2019 10:15:53 +0200 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: b5d06a458283 [Backport] Security issue 946978 [1/2] 4f553e3a0c62 [Backport] Security issue 946978 [2/2] 32d77d99be3f [Backport] CVE-2019-13674 2a45953d844a [Backport] CVE-2019-13675 2708f4fe1f1a [Backport] Plumb initiating origin info to download stack. 1d21cbce407f [Backport] CVE-2019-13678/CVE-2019-13681 0da18c7f04e3 [Backport] Security issue 960354 4e50fd02436d [Backport] Security issue 973628 9e3becc64121 [Backport] Security issue 979373 729e9b30bbf2 [Backport] Security issue 981459 28150e5eb962 [Backport] Security issue 981597 843d70ac87de [Backport] Security issue 971904 Fixes: QTBUG-79193 Change-Id: Ic90455446f79500d5971a975e2a04344f65238ac Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- src/core/content_browser_client_qt.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 18d4c6e82..843d70ac8 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 18d4c6e8250324d084d89b17ad80721bb46ddbd9 +Subproject commit 843d70ac87de7482c1c1195aa73899bc05efc8f3 diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 04a8fc363..6d1bf07a9 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -196,7 +196,7 @@ public: void* GetHandle() override { return m_handle; } // Qt currently never creates contexts using robustness attributes. - bool WasAllocatedUsingRobustnessExtension() override { return false; } + unsigned int CheckStickyGraphicsResetStatus() override { return 0 /*GL_NO_ERROR*/; } // We don't care about the rest, this context shouldn't be used except for its handle. bool Initialize(gl::GLSurface *, const gl::GLContextAttribs &) override { Q_UNREACHABLE(); return false; } -- cgit v1.2.3 From 49e660a9e8e47c9cd81bb38f2b74575e7de50aca Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Thu, 17 Oct 2019 18:04:51 +0200 Subject: Track request interceptor destroy and update profile io data accordingly On destroy profile level interceptor is cleaned through QPointer in ProfileAdapter but not in ProfileIOData where it is stored as a raw pointer and used by NetworkDelegateQt. Track 'destroyed' signal and clean it from ProfileIOData, which resolves these issues after interceptor is deleted without explicitly being reset in profile: - for deprecated 'setRequestInterceptor': one of possible access violation in NetworkDelegateQt::OnBeforeURLRequest - for setUrlRequestInterceptor: sending URLRequestNotification for every url request after interceptor is deleted Fixes: QTBUG-79156 Change-Id: Ie2dd3f0909bc45748278c5f97c5c2701742591b5 Reviewed-by: Michal Klocek --- src/core/profile_adapter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index ebb533206..dbe76f0d1 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -179,7 +179,16 @@ void ProfileAdapter::setRequestInterceptor(QWebEngineUrlRequestInterceptor *inte { 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()); + }); + if (m_profile->m_urlRequestContextGetter.get()) m_profile->m_profileIOData->updateRequestInterceptor(); } -- cgit v1.2.3