From f4815cebae99bc27f6880e3281eda81078821d08 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 11 Oct 2016 13:56:31 +0200 Subject: Fix crash in WebEngineContext when using Wayland For some reason the OpenGL context wayland QPA sets has no nativeHandle, so we end up crashing in strcmp. Assume a context without nativeHandle is Wayland or other GLES2 platform and also force GLES2 when using Ozone. Change-Id: Ia3fc524f3ffbb278d86f9153ec96c7258ef86656 Reviewed-by: Michal Klocek --- src/core/web_engine_context.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 7d1e5d609..ceb14f843 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -311,8 +311,15 @@ WebEngineContext::WebEngineContext() const char *glType = 0; if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) { - if (qt_gl_global_share_context()) { - if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) { + if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) { + // If the native handle is QEGLNativeContext try to use GL ES/2, if there is no native handle + // assume we are using wayland and try GL ES/2, and finally Ozone demands GL ES/2 too. + if (qt_gl_global_share_context()->nativeHandle().isNull() +#ifdef USE_OZONE + || true +#endif + || !strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) + { if (qt_gl_global_share_context()->isOpenGLES()) { glType = gfx::kGLImplementationEGLName; } else { -- cgit v1.2.3 From afedaaf2492ea4899198cb9886f9e249c6cbe119 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Oct 2016 14:05:43 +0200 Subject: Update Chromium Change-Id: I6803569bd7bee4bf8eb94f61771ea2a318eb752b Reviewed-by: Kai Koehne --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 881a7672e..b82d94c4f 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 881a7672e23192eaf7e1ac2f94e086b560104f10 +Subproject commit b82d94c4f82330ed64ccb639985312198a9cda7a -- cgit v1.2.3 From d82fb129145f933659f0315ca6203ab51c24937a Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Thu, 6 Oct 2016 16:08:30 +0200 Subject: Fix nullpointer dereferencing error Check whether iconUrls is NULL before calling contains(iconUrl) on it, which, under certain circumstances, caused a SEGFAULT. Task-number: QTBUG-56330 Change-Id: Ia167d68a4c4d62af4740a8cbab2686bfbc975455 Reviewed-by: Peter Varga --- src/webengine/api/qquickwebenginefaviconprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp index fe8436d6c..b5ad6960a 100644 --- a/src/webengine/api/qquickwebenginefaviconprovider.cpp +++ b/src/webengine/api/qquickwebenginefaviconprovider.cpp @@ -152,7 +152,7 @@ QQuickWebEngineView *QQuickWebEngineFaviconProvider::viewForIconUrl(const QUrl & // latest WebEngineView which was raised an iconChanged signal. if (m_latestView) { QList *iconUrls = m_iconUrlMap[m_latestView]; - if (iconUrls->contains(iconUrl)) + if (iconUrls && iconUrls->contains(iconUrl)) return m_latestView; } -- cgit v1.2.3 From 330de004cfab4651e7c3c8f105d530e41eb5a939 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 13 Oct 2016 10:30:51 +0200 Subject: Add changes for 5.7.1 Change-Id: Iec54a4a3a117ce5f6bca8ff22218eb8fea0008e8 Reviewed-by: Leena Miettinen --- dist/changes-5.7.1 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 dist/changes-5.7.1 diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 new file mode 100644 index 000000000..ece3095df --- /dev/null +++ b/dist/changes-5.7.1 @@ -0,0 +1,51 @@ +Qt 5.7.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.7.0. + +Qt 5.7.1 contains a merge from Qt 5.6.2 and all changes in Qt 5.6.2 are +also in Qt 5.7.1. For more see changes-5.6.2. + +Qt 5.7 introduces many new features and improvements as well as bugfixes +over the 5.6.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.7 series is binary compatible with the 5.6.x series. +Applications compiled for 5.6 will continue to run with 5.7. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + + - Chromium Snapshot: + * Security fixes from Chromium up to version 53.0.2785.143. + Including: CVE-2016-5133, CVE-2016-5147, CVE-2016-5153, CVE-2016-5155, + CVE-2016-5161, CVE-2016-5166, CVE-2016-5170, CVE-2016-5171, + CVE-2016-5172 + * Support for macOS 10.12 Sierra + + - QtWebEngineCore: + * [QTBUG-51244, QTBUG-54795] Fixed select control issues + * Fixed several focus issues. + * Fixed regression with fine-grained wheel events. + * [QTBUG-54221] Fixed editing short-cuts in plugins. + * [QTBUG-54222] Fixed potential infinite loop on history load. + * Fixed Flash plugin clipboard access. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + + - Linux: + * [QTBUG-55367] Fixed reading timezone when running sandboxed + * Fixed crash when using Wayland QPA + * Improved OpenGL check, so EGL/GLES2 mode can be used with Desktop + OpenGL if the driver has th ARB_ES2_compatibility extension. -- cgit v1.2.3 From 99a2a538eba5e3c351e3118b3c6f71458af91886 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 13 Oct 2016 13:59:08 +0200 Subject: Update Chromium Pulls in security fixes from the Chromium 54.0.2840.59 release, Changes included: - Fix renderer crash on null family strings - [Backport] Blink-in-JS should not run micro tasks - [Backport] Disallow reentrance of FrameView::updateLifecyclePhasesInternal() - [Backport] Check CORS policy on redirect in TextTrackLoader - [Backport] Keep top controls visible if SHOW is called right after HIDE. - [Backport] Merge to 2840 "[DevTools] Avoid current_ and pending_ being the same host in RenderFrameDevToolsAgentHost." - [Backport] Enable do not allow default action for untrusted events. - [Backport] Compare font-feature-settings as part of Font::operator==(). - Stop the flood of accessibility messages - [Backport] Fix for hitting an assert when refreshing a page with an image - [Backport] Report the decoded size to ImageObserver, instead of deltas Change-Id: I142cc070ba7fb215e4a5b9c162852b583dab9784 Reviewed-by: Kai Koehne --- dist/changes-5.7.1 | 6 ++++-- src/3rdparty | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 index ece3095df..5e0953ee6 100644 --- a/dist/changes-5.7.1 +++ b/dist/changes-5.7.1 @@ -26,11 +26,13 @@ information about a particular change. **************************************************************************** - Chromium Snapshot: - * Security fixes from Chromium up to version 53.0.2785.143. + * Security fixes from Chromium up to version 54.0.2840.59 Including: CVE-2016-5133, CVE-2016-5147, CVE-2016-5153, CVE-2016-5155, CVE-2016-5161, CVE-2016-5166, CVE-2016-5170, CVE-2016-5171, - CVE-2016-5172 + CVE-2016-5172, CVE-2016-5181, CVE-2016-5185, CVE-2016-5186, + CVE-2016-5187, CVE-2016-5188, CVE-2016-5192 * Support for macOS 10.12 Sierra + * Various backported crash and assert fixes - QtWebEngineCore: * [QTBUG-51244, QTBUG-54795] Fixed select control issues diff --git a/src/3rdparty b/src/3rdparty index b82d94c4f..d3651e09c 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit b82d94c4f82330ed64ccb639985312198a9cda7a +Subproject commit d3651e09c34202cc83e32c200fd50cc1f90ab169 -- cgit v1.2.3 From e2541ebdfadea0fe43baac748cfa9e07f3b57215 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 26 Sep 2016 20:26:01 +0200 Subject: Do not call QOpenGLContext::openGLModuleType() from MainDll In case of dynamic OpenGL on Windows this ends on calling QWindowsIntegration::staticOpenGLContext() from MainDll which in case of angle will end up badly. Add warning message when webengine is loaded from plugin and context is not initialized. Task-number: QTBUG-52201 Task-number: QTBUG-55501 Task-number: QTBUG-56020 Change-Id: I03570cad5f686c4a63910c71136bf3eb9499f223 Reviewed-by: Kai Koehne --- src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp index e47f135e8..bf3514f71 100644 --- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp +++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp @@ -48,17 +48,22 @@ namespace QtWebEngineCore } QT_BEGIN_NAMESPACE + +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); + static void initialize() { - //On window/ANGLE, calling QtWebEngine::initialize from DllMain will result in a crash. - //To ensure it doesn't, we check that when loading the library - //QCoreApplication is not yet instantiated, ensuring the call will be deferred -#if defined(Q_OS_WIN) - if (QCoreApplication::instance() - && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) { + if (QCoreApplication::instance()) { + //On window/ANGLE, calling QtWebEngine::initialize from DllMain will result in a crash. + if (!qt_gl_global_share_context()) { + qWarning("Qt WebEngine seems to be initialized from a plugin. Please " + "set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute " + "before constructing QGuiApplication."); + } return; } -#endif + + //QCoreApplication is not yet instantiated, ensuring the call will be deferred qAddPreRoutine(QtWebEngineCore::initialize); } -- cgit v1.2.3 From 37c8cc637d8f2e06b715362d5b8fa491e1ce93ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Thu, 27 Oct 2016 11:01:53 +0200 Subject: Update changes file for 5.7.1 Change-Id: Ib683ecda4c4bb2d58f36ad92f703d58f00e9d445 Reviewed-by: Michal Klocek --- dist/changes-5.7.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 index 5e0953ee6..7ba4fd2ff 100644 --- a/dist/changes-5.7.1 +++ b/dist/changes-5.7.1 @@ -51,3 +51,7 @@ information about a particular change. * Fixed crash when using Wayland QPA * Improved OpenGL check, so EGL/GLES2 mode can be used with Desktop OpenGL if the driver has th ARB_ES2_compatibility extension. + + - Windows: + * [QTBUG-52201, QTBUG-55501, QTBUG-56020] Fixed crashes and asserts + upon initialization of the global shared OpenGL context. -- cgit v1.2.3 From 15ded5ca62f53a01f85a52326f0b335a8a012bbd Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 8 Nov 2016 10:55:05 +0100 Subject: Update Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pulls in the security fix from Chrome 54.0.2840.87 Change-Id: I70064927cba01b7978742951ba0636b780d9eb68 Reviewed-by: Michael BrĂ¼ning Reviewed-by: Joerg Bornemann --- dist/changes-5.7.1 | 4 ++-- src/3rdparty | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 index 7ba4fd2ff..bf5934320 100644 --- a/dist/changes-5.7.1 +++ b/dist/changes-5.7.1 @@ -26,11 +26,11 @@ information about a particular change. **************************************************************************** - Chromium Snapshot: - * Security fixes from Chromium up to version 54.0.2840.59 + * Security fixes from Chromium up to version 54.0.2840.87 Including: CVE-2016-5133, CVE-2016-5147, CVE-2016-5153, CVE-2016-5155, CVE-2016-5161, CVE-2016-5166, CVE-2016-5170, CVE-2016-5171, CVE-2016-5172, CVE-2016-5181, CVE-2016-5185, CVE-2016-5186, - CVE-2016-5187, CVE-2016-5188, CVE-2016-5192 + CVE-2016-5187, CVE-2016-5188, CVE-2016-5192, CVE-2016-5198 * Support for macOS 10.12 Sierra * Various backported crash and assert fixes diff --git a/src/3rdparty b/src/3rdparty index d3651e09c..b3c79e92f 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit d3651e09c34202cc83e32c200fd50cc1f90ab169 +Subproject commit b3c79e92f0a631273b639af171e59f4c367ae02e -- cgit v1.2.3 From 58467ed1950ee070d0907cbdabb8466aba277305 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 13 Sep 2016 18:17:43 +0200 Subject: Fix select tag interaction when the web view is inside a modal dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously when a QWebEngineView was inside a modal QDialog, trying to click on a select tag option did not properly select the option. It either focused the new option without closing the popup, or didn't focus it at all. Fix consists in making sure the newly created popup QWindow and RenderWidgetHostViewQtDelegateWidget are marked as children of the QWebEngineView, so that they are considered part of the current modal session by the OS, thus allowing user interaction with them. Because the ownership of the delegate widget should still be retained by its respective RenderWidgetHostViewQt instance, the QObject parent of the delegate is unset before the parent is destroyed. Also to make it work on macOS, the window attribute has to be set to Qt::Tool instead of Qt::ToolTip. Change-Id: I56d6f446254a624428a0c661ac3c49eb409c931e Task-number: QTBUG-54836 Reviewed-by: Qt CI Bot Reviewed-by: Michael BrĂ¼ning --- src/webenginewidgets/api/qwebenginepage.cpp | 11 ++++++++++- .../render_widget_host_view_qt_delegate_widget.cpp | 21 ++++++++++++++++++++- .../render_widget_host_view_qt_delegate_widget.h | 1 + 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index df96f4c17..a9a908e13 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -144,7 +144,16 @@ QWebEnginePagePrivate::~QWebEnginePagePrivate() RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) { - return new RenderWidgetHostViewQtDelegateWidget(client); + // Set the QWebEngineView as the parent for a popup delegate, so that the new popup window + // responds properly to clicks in case the QWebEngineView is inside a modal QDialog. Setting the + // parent essentially notifies the OS that the popup window is part of the modal session, and + // should allow interaction. + // The new delegate will not be deleted by the parent view though, because we unset the parent + // when the parent is destroyed. The delegate will be destroyed by Chromium when the popup is + // dismissed. + // If the delegate is not for a popup, but for a newly created QWebEngineView, the parent is 0 + // just like before. + return new RenderWidgetHostViewQtDelegateWidget(client, this->view); } void QWebEnginePagePrivate::titleChanged(const QString &title) diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 5bc1671df..a3ad898ad 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -103,6 +103,21 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(Rende setAttribute(Qt::WA_AcceptTouchEvents); setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_AlwaysShowToolTips); + + if (parent) { + // Unset the popup parent if the parent is being destroyed, thus making sure a double + // delete does not happen. + // Also in case the delegate is destroyed before its parent (when a popup is simply + // dismissed), this connection will automatically be removed by ~QObject(), preventing + // a use-after-free. + connect(parent, &QObject::destroyed, + this, &RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete); + } +} + +void RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete() +{ + setParent(Q_NULLPTR); } void RenderWidgetHostViewQtDelegateWidget::initAsChild(WebContentsAdapterClient* container) @@ -125,7 +140,11 @@ void RenderWidgetHostViewQtDelegateWidget::initAsPopup(const QRect& screenRect) // to be destroyed. setAttribute(Qt::WA_ShowWithoutActivating); setFocusPolicy(Qt::NoFocus); - setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); + + // macOS doesn't like Qt::ToolTip when QWebEngineView is inside a modal dialog, specifically by + // not forwarding click events to the popup. So we use Qt::Tool which behaves the same way, but + // works on macOS too. + setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); setGeometry(screenRect); show(); diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h index ecf2d2d33..aa9495105 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h @@ -92,6 +92,7 @@ protected: private slots: void onWindowPosChanged(); + void removeParentBeforeParentDelete(); private: RenderWidgetHostViewQtDelegateClient *m_client; -- cgit v1.2.3 From 5fc3be56ea6c1d7b1b7567ce429774e92859dd14 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 9 Nov 2016 10:30:04 +0100 Subject: Check if the .git directory exists before invoking git If .git does not exist then this is not from a git build and therefore there is no reason to invoke git (which might not even exist on the system anyway). This prevents an error appearing due to trying to invoke git on Windows when it does not exist. Change-Id: I8c0b5b237cfdaffdbb33efdd16cf20cd1560f1a1 Reviewed-by: Joerg Bornemann --- tools/qmake/mkspecs/features/functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index a5481e2b9..2fbbb1b42 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -102,7 +102,7 @@ defineReplace(getConfigDir) { } defineReplace(getChromiumSrcDir) { - git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir") + exists($$QTWEBENGINE_ROOT/.git): git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir") # Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used) isEmpty(git_chromium_src_dir): git_chromium_src_dir = "src/3rdparty/chromium" return($$git_chromium_src_dir) -- cgit v1.2.3 From 7a4324f5e4c3927b51e4176daf0d8ae6599c984a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 15 Nov 2016 17:44:19 +0100 Subject: Pass size to URLRequestJob If QIODevice has a size we can pass that on as expected size. This fixes media playback where Chromium does not always support streaming outside of HTTP or HTTPS. Task-number: QTBUG-57139 Change-Id: Ie8bf96b1f7f6af80fe707936055620d154c3ef2d Reviewed-by: Michal Klocek Reviewed-by: Milian Wolff --- src/core/url_request_custom_job.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/url_request_custom_job.cpp b/src/core/url_request_custom_job.cpp index 887222285..d093efd0a 100644 --- a/src/core/url_request_custom_job.cpp +++ b/src/core/url_request_custom_job.cpp @@ -229,6 +229,9 @@ void URLRequestCustomJobShared::setReplyDevice(QIODevice *device) if (m_device && !m_device->isReadable()) m_device->open(QIODevice::ReadOnly); + qint64 size = m_device ? m_device->size() : -1; + if (size > 0) + m_job->set_expected_content_size(size); if (m_device && m_device->isReadable()) content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyStarted, m_weakFactory.GetWeakPtr())); else -- cgit v1.2.3 From db1f77b2c44baa8426d0a5911b6c234704e9cc90 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Mon, 21 Nov 2016 14:52:05 +0100 Subject: Fix IPC message logging Register Qt IPC messages for logging. The usage of content::RegisterIPCLogger function adds the content_common.content_ipc_logging.o to the link dependency. Thus it will register the Chromium Content IPC messages too. Task-number: QTBUG-57224 Change-Id: I2c45691feb22a34f6074940cc35b8a4ba7804370 Reviewed-by: Allan Sandfeld Jensen --- src/core/common/qt_ipc_logging.cpp | 48 ++++++++++++++++++++++++++++++++++++++ src/core/core_gyp_generator.pro | 1 + 2 files changed, 49 insertions(+) create mode 100644 src/core/common/qt_ipc_logging.cpp diff --git a/src/core/common/qt_ipc_logging.cpp b/src/core/common/qt_ipc_logging.cpp new file mode 100644 index 000000000..124124de1 --- /dev/null +++ b/src/core/common/qt_ipc_logging.cpp @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED + +#if defined(IPC_MESSAGE_LOG_ENABLED) +#define IPC_MESSAGE_MACROS_LOG_ENABLED +#include "content/public/common/content_ipc_logging.h" +#define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \ + content::RegisterIPCLogger(msg_id, logger) +#include "common/qt_messages.h" +#endif diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index ec180d38e..4b0f6d90a 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -44,6 +44,7 @@ SOURCES = \ chromium_gpu_helper.cpp \ chromium_overrides.cpp \ clipboard_qt.cpp \ + common/qt_ipc_logging.cpp \ common/qt_messages.cpp \ common/user_script_data.cpp \ content_client_qt.cpp \ -- cgit v1.2.3 From 95435bbef3102727759e826bed63fe3d0a6ce057 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 23 Nov 2016 15:20:41 +0100 Subject: Blacklist doNotSendMouseKeyboardEventsWhenDisabled on Windows It fails occasionally and blocks integration Task-number: QTBUG-57117 Change-Id: I7266ccf4fe7e0905dc31e5e7c085be6f90d0aa03 Reviewed-by: Alexandru Croitor --- tests/auto/widgets/qwebengineview/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/widgets/qwebengineview/BLACKLIST diff --git a/tests/auto/widgets/qwebengineview/BLACKLIST b/tests/auto/widgets/qwebengineview/BLACKLIST new file mode 100644 index 000000000..0a909d0f6 --- /dev/null +++ b/tests/auto/widgets/qwebengineview/BLACKLIST @@ -0,0 +1,2 @@ +[doNotSendMouseKeyboardEventsWhenDisabled] +windows -- cgit v1.2.3 From 95a22234a4671e6e79ce1cecbd720551a185d278 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 16 Nov 2016 13:46:56 +0100 Subject: ResourceType ABI/API fixup [ChangeLog][Important Changes] The enum value ResourceTypeUnknown has changed value since there was a mismatch between 5.6 and 5.7+ definitions. In general any unknown ResourceType value should handled as unknown for forward compatibility, since more types are and can be added in later Qt versions. Change-Id: I0a9f8a2129d4549deeae01e199f432fbbf1bbb9e Reviewed-by: Leena Miettinen Reviewed-by: Kai Koehne --- src/core/api/qwebengineurlrequestinfo.cpp | 5 ++++- src/core/api/qwebengineurlrequestinfo.h | 5 ++++- src/core/network_delegate_qt.cpp | 26 +++++++++++++++++++------- src/core/web_contents_delegate_qt.cpp | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp index f229a9748..93cdf012f 100644 --- a/src/core/api/qwebengineurlrequestinfo.cpp +++ b/src/core/api/qwebengineurlrequestinfo.cpp @@ -59,7 +59,7 @@ ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::RESOU ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::RESOURCE_TYPE_XHR) ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::RESOURCE_TYPE_PING) ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::RESOURCE_TYPE_SERVICE_WORKER) -ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeUnknown, content::RESOURCE_TYPE_LAST_TYPE) +ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::RESOURCE_TYPE_LAST_TYPE) ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink) ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped) @@ -166,6 +166,9 @@ QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPriva \value ResourceTypePing A ping request for . \value ResourceTypeServiceWorker The main resource of a service worker. \value ResourceTypeUnknown Unknown request type. + + \note For forward compatibility all values not matched should be treated as unknown, + not just \c ResourceTypeUnknown. */ /*! diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h index 9a13b3faf..c7af45375 100644 --- a/src/core/api/qwebengineurlrequestinfo.h +++ b/src/core/api/qwebengineurlrequestinfo.h @@ -70,7 +70,10 @@ public: ResourceTypeXhr, // a XMLHttpRequest ResourceTypePing, // a ping request for ResourceTypeServiceWorker, // the main resource of a service worker. - ResourceTypeUnknown +#ifndef Q_QDOC + ResourceTypeLast, +#endif + ResourceTypeUnknown = 255 }; enum NavigationType { diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp index fd79917f4..e14180ae6 100644 --- a/src/core/network_delegate_qt.cpp +++ b/src/core/network_delegate_qt.cpp @@ -55,7 +55,7 @@ namespace QtWebEngineCore { -int pageTransitionToNavigationType(ui::PageTransition transition) +WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::PageTransition transition) { int32 qualifier = ui::PageTransitionGetQualifier(transition); @@ -78,6 +78,18 @@ int pageTransitionToNavigationType(ui::PageTransition transition) } } +QWebEngineUrlRequestInfo::ResourceType toQt(content::ResourceType resourceType) +{ + if (resourceType >= 0 && resourceType < content::ResourceType(QWebEngineUrlRequestInfo::ResourceTypeLast)) + return static_cast(resourceType); + return QWebEngineUrlRequestInfo::ResourceTypeUnknown; +} + +QWebEngineUrlRequestInfo::NavigationType toQt(WebContentsAdapterClient::NavigationType navigationType) +{ + return static_cast(navigationType); +} + NetworkDelegateQt::NetworkDelegateQt(URLRequestContextGetterQt *requestContext) : m_requestContextGetter(requestContext) { @@ -91,7 +103,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C const content::ResourceRequestInfo *resourceInfo = content::ResourceRequestInfo::ForRequest(request); content::ResourceType resourceType = content::RESOURCE_TYPE_LAST_TYPE; - int navigationType = QWebEngineUrlRequestInfo::NavigationTypeOther; + WebContentsAdapterClient::NavigationType navigationType = WebContentsAdapterClient::OtherNavigation; if (resourceInfo) { resourceType = resourceInfo->GetResourceType(); @@ -102,11 +114,11 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C QWebEngineUrlRequestInterceptor* interceptor = m_requestContextGetter->m_requestInterceptor; if (interceptor) { - QWebEngineUrlRequestInfoPrivate *infoPrivate = new QWebEngineUrlRequestInfoPrivate(static_cast(resourceType) - , static_cast(navigationType) - , qUrl - , toQt(request->first_party_for_cookies()) - , QByteArray::fromStdString(request->method())); + QWebEngineUrlRequestInfoPrivate *infoPrivate = new QWebEngineUrlRequestInfoPrivate(toQt(resourceType), + toQt(navigationType), + qUrl, + toQt(request->first_party_for_cookies()), + QByteArray::fromStdString(request->method())); QWebEngineUrlRequestInfo requestInfo(infoPrivate); interceptor->interceptRequest(requestInfo); if (requestInfo.changed()) { diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 5e9157069..95a66f622 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -393,7 +393,7 @@ void WebContentsDelegateQt::requestGeolocationPermission(const QUrl &requestingO m_viewClient->runGeolocationPermissionRequest(requestingOrigin); } -extern int pageTransitionToNavigationType(ui::PageTransition transition); +extern WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::PageTransition transition); void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame) { -- cgit v1.2.3 From 6766290699acd0d73c81cf690012d52729e518b9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 24 Nov 2016 10:58:43 +0100 Subject: Increase timeout in loadSignalsOrder tests Use a standard QTRY_VERIFY. Apparently launching the web-process might sometimes take more than 500ms on the CI under load. Task-number: QTBUG-57119 Change-Id: Icb7706b5aed3cf72f026af6d1d2f9430c4942a2a Reviewed-by: Peter Varga Reviewed-by: Joerg Bornemann --- tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 518713b51..1629ec617 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -3410,7 +3410,7 @@ void tst_QWebEnginePage::loadSignalsOrder() SpyForLoadSignalsOrder loadSpy(&page); waitForSignal(&loadSpy, SIGNAL(started()), 500); page.load(url); - QTRY_VERIFY_WITH_TIMEOUT(loadSpy.isFinished(), 500); + QTRY_VERIFY(loadSpy.isFinished()); } void tst_QWebEnginePage::undoActionHaveCustomText() -- cgit v1.2.3