From 5aa433cf1dc116326308e610dce80033aba67a85 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Dec 2014 14:17:29 +0100 Subject: Flush UI message loop before quitting Cookies were not flushed on application exit because objects deleted lazy on the UI-thread never had their destructors called because we did not flush the queue on exit. Change-Id: If53cdb5547e15a9f39de8b99b1da313e307b1c90 Reviewed-by: Jocelyn Turcotte --- src/core/web_engine_context.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index ac9a921e7..db3956e5a 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -41,6 +41,7 @@ #include "base/base_switches.h" #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/threading/thread_restrictions.h" #include "cc/base/switches.h" @@ -93,6 +94,9 @@ void destroyContext() WebEngineContext::~WebEngineContext() { + base::MessagePump::Delegate *delegate = m_runLoop->loop_; + // Flush the UI message loop before quitting. + while (delegate->DoWork()) { } GLContextHelper::destroy(); m_runLoop->AfterRun(); } -- cgit v1.2.3 From b4b6d85fea56fde2447b57c8a6e379b6d8a2ec41 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 1 Dec 2014 11:53:59 +0100 Subject: Add class and enum documentation to QWebEngineCertificateError Without the class description the methods documentation was never generated. Change-Id: I0d7232e8f5cc6765908cb28b77d0fe0f514d359d Task-number: QTBUG-42996 Reviewed-by: Jocelyn Turcotte --- .../api/qwebenginecertificateerror.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.cpp b/src/webenginewidgets/api/qwebenginecertificateerror.cpp index 7be8c75d0..bf7239cf3 100644 --- a/src/webenginewidgets/api/qwebenginecertificateerror.cpp +++ b/src/webenginewidgets/api/qwebenginecertificateerror.cpp @@ -38,6 +38,15 @@ QT_BEGIN_NAMESPACE +/*! + \class QWebEngineCertificateError + \brief The QWebEngineCertificateError class provides information about a certificate error. + + \inmodule QtWebEngineWidgets + + QWebEngineCertificateError holds known information about a certificate error to be used to determine whether to allow it or not, and to be reported to the user. +*/ + class QWebEngineCertificateErrorPrivate { public: QWebEngineCertificateErrorPrivate(int error, QUrl url, bool overridable, QString errorDescription); @@ -56,14 +65,38 @@ QWebEngineCertificateErrorPrivate::QWebEngineCertificateErrorPrivate(int error, { } +/*! \internal +*/ QWebEngineCertificateError::QWebEngineCertificateError(int error, QUrl url, bool overridable, QString errorDescription) : d_ptr(new QWebEngineCertificateErrorPrivate(error, url, overridable, errorDescription)) { } +/*! \internal +*/ QWebEngineCertificateError::~QWebEngineCertificateError() { } +/*! + \enum QWebEngineCertificateError::Error + + This enum describes the type of certificate error encountered. + + \value SslPinnedKeyNotInCertificateChain The certificate did not match the built-in public key pins for the host name. + \value CertificateCommonNameInvalid The certificate's common name did not match the host name. + \value CertificateDateInvalid The certificate is not valid at the current date and time. + \value CertificateAuthorityInvalid The certificate is not signed by a trusted authority. + \value CertificateContainsErrors The certificate contains errors. + \value CertificateNoRevocationMechanism The certificate has no mechanism for determining if it has been revoked. + \value CertificateUnableToCheckRevocation Revocation information for the certificate is not available. + \value CertificateRevoked The certificate has been revoked. + \value CertificateInvalid The certificate is invalid. + \value CertificateWeakSignatureAlgorithm The certificate is signed using a weak signature algorithm. + \value CertificateNonUniqueName The host name specified in the certificate is not unique. + \value CertificateWeakKey The certificate contains a weak key. + \value CertificateNameConstraintViolation The certificate claimed DNS names that are in violation of name constraints. +*/ + /*! Returns whether this error can be overridden and accepted. -- cgit v1.2.3 From ff47f09a94a0a31edd40500985ff670e8f35cc2c Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Thu, 4 Dec 2014 07:07:32 -0800 Subject: Add a stub QuotaPermissionContext implementation This prevents the crash when the application requests persistent storage access using the Quota API (e.g. on http://codepen.io/matt-west/full/CrfKh). The request has been disallowed for now, because it should rely on user permission. Change-Id: I4ae057c9485d3f06f45a637c7eeda9dd69fe6b54 Reviewed-by: Andras Becsi --- src/core/content_browser_client_qt.cpp | 16 ++++++++++++++++ src/core/content_browser_client_qt.h | 1 + 2 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index ee403298b..4948d1d8d 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -42,6 +42,7 @@ #include "content/public/browser/browser_main_parts.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/media_observer.h" +#include "content/public/browser/quota_permission_context.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" @@ -294,6 +295,16 @@ void ShareGroupQtQuick::AboutToAddFirstContext() m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext)); } +class QuotaPermissionContextQt : public content::QuotaPermissionContext { +public: + virtual void RequestQuotaPermission(const content::StorageQuotaParams ¶ms, int render_process_id, const PermissionCallback &callback) Q_DECL_OVERRIDE + { + Q_UNUSED(params); + Q_UNUSED(render_process_id); + callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); + } +}; + ContentBrowserClientQt::ContentBrowserClientQt() : m_browserMainParts(0) { @@ -374,6 +385,11 @@ void ContentBrowserClientQt::enableInspector(bool enable) } } +content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionContext() +{ + return new QuotaPermissionContextQt; +} + void ContentBrowserClientQt::AllowCertificateError(int render_process_id, int render_frame_id, int cert_error, const net::SSLInfo& ssl_info, const GURL& request_url, ResourceType::Type resource_type, diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 4f216030c..f1ecf5825 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -80,6 +80,7 @@ public: virtual content::MediaObserver* GetMediaObserver() Q_DECL_OVERRIDE; virtual void OverrideWebkitPrefs(content::RenderViewHost *, const GURL &, WebPreferences *) Q_DECL_OVERRIDE; virtual content::AccessTokenStore *CreateAccessTokenStore() Q_DECL_OVERRIDE; + virtual content::QuotaPermissionContext *CreateQuotaPermissionContext() Q_DECL_OVERRIDE; virtual void AllowCertificateError( int render_process_id, int render_frame_id, -- cgit v1.2.3 From 5c3bfe0e4ddea18c0d44b26cc3b950f9dbf9349f Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Thu, 4 Dec 2014 17:59:06 +0100 Subject: Check for EGL_KHR_fence_sync instead of EGL_KHR_reusable_sync We create an EGL_KHR_fence_sync on the chromium thread but try to verify if the wait function implementation is available by testing for the EGL_KHR_reusable_sync extension in the scene graph thread. Since the latter extension is not supported by most of our devices, we never actually waited for the rendering to finish. Change-Id: Ied829d4035d42899cfb3f86de018bc48e61c0cc0 Reviewed-by: Jocelyn Turcotte --- src/3rdparty | 2 +- src/core/delegated_frame_node.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/3rdparty b/src/3rdparty index 577cd47e5..be4ec3fa6 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 577cd47e54bb88c81b7a5b5a6d658d8d61b2c747 +Subproject commit be4ec3fa64a4c6c2b641830a9811ab7847c7dd39 diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp index 1a393a0c7..e12873c81 100644 --- a/src/core/delegated_frame_node.cpp +++ b/src/core/delegated_frame_node.cpp @@ -218,7 +218,7 @@ static void waitChromiumSync(gfx::TransferableFence *sync) static PFNEGLCLIENTWAITSYNCKHRPROC eglClientWaitSyncKHR = 0; if (!resolved) { - if (gfx::GLSurfaceQt::HasEGLExtension("EGL_KHR_reusable_sync")) { + if (gfx::GLSurfaceQt::HasEGLExtension("EGL_KHR_fence_sync")) { QOpenGLContext *context = QOpenGLContext::currentContext(); eglClientWaitSyncKHR = (PFNEGLCLIENTWAITSYNCKHRPROC)context->getProcAddress("eglClientWaitSyncKHR"); } @@ -261,7 +261,7 @@ static void deleteChromiumSync(gfx::TransferableFence *sync) static PFNEGLDESTROYSYNCKHRPROC eglDestroySyncKHR = 0; if (!resolved) { - if (gfx::GLSurfaceQt::HasEGLExtension("EGL_KHR_reusable_sync")) { + if (gfx::GLSurfaceQt::HasEGLExtension("EGL_KHR_fence_sync")) { QOpenGLContext *context = QOpenGLContext::currentContext(); eglDestroySyncKHR = (PFNEGLDESTROYSYNCKHRPROC)context->getProcAddress("eglDestroySyncKHR"); } -- cgit v1.2.3 From 8eefc3a0658d1b10de12f43534cfd63af825ebc8 Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Thu, 4 Dec 2014 18:04:08 +0100 Subject: Force active focus for touch begin This fixes the focusing issues on touch devices. Change-Id: I26c0080ea70aeabbd608e15fbd3705b907bdb68e Reviewed-by: Jocelyn Turcotte --- src/webengine/render_widget_host_view_qt_delegate_quick.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index a2f60d4ef..7c04cb8c0 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -192,6 +192,8 @@ void RenderWidgetHostViewQtDelegateQuick::wheelEvent(QWheelEvent *event) void RenderWidgetHostViewQtDelegateQuick::touchEvent(QTouchEvent *event) { + if (event->type() == QEvent::TouchBegin && !m_isPopup) + forceActiveFocus(); m_client->forwardEvent(event); } -- cgit v1.2.3 From 75b979f2f0bf3eaf623595b5bc8c3d5959194f72 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 12 Dec 2014 15:28:33 +0100 Subject: Enable cmake config files generation As QtWebEngine now uses 5.x as its version number, we can just provide cmake tests and let qmake scripts do the rest. Task-number: QTBUG-42073 Change-Id: I28ccddbd1849980074dfbeefb5cb5a70c9209ab1 Reviewed-by: Andras Becsi --- src/core/core_module.pro | 2 -- src/webengine/webengine.pro | 2 -- src/webenginewidgets/webenginewidgets.pro | 2 -- 3 files changed, 6 deletions(-) (limited to 'src') diff --git a/src/core/core_module.pro b/src/core/core_module.pro index ceb248372..14f249142 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -1,8 +1,6 @@ MODULE = webenginecore TARGET = QtWebEngineCore -CMAKE_MODULE_TESTS = "-" - QT += qml quick QT_PRIVATE += gui-private diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro index 6f48e9d49..4c4606690 100644 --- a/src/webengine/webengine.pro +++ b/src/webengine/webengine.pro @@ -1,7 +1,5 @@ TARGET = QtWebEngine -CMAKE_MODULE_TESTS = "-" - # For our export macros DEFINES += QT_BUILD_WEBENGINE_LIB diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro index 71240cbaf..4da888baa 100644 --- a/src/webenginewidgets/webenginewidgets.pro +++ b/src/webenginewidgets/webenginewidgets.pro @@ -1,7 +1,5 @@ TARGET = QtWebEngineWidgets -CMAKE_MODULE_TESTS = "-" - # For our export macros DEFINES += QT_BUILD_WEBENGINEWIDGETS_LIB -- cgit v1.2.3 From f8bdc6c7de5ace3ff4b0335cf425e0ebb21ed75d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 15 Dec 2014 11:41:50 +0100 Subject: Use QDir::separator() where paths might be generated for Windows Change-Id: Id7afc11cd58f671ff5ce629cfc29bdb6d9567dc2 Reviewed-by: Pierre Rossi --- src/core/web_engine_library_info.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 026f4db83..beae9dd75 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -171,7 +171,7 @@ QString localesPath() #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) return getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); #else - return location(QLibraryInfo::TranslationsPath) % QLatin1String("/qtwebengine_locales"); + return location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); #endif } @@ -204,7 +204,7 @@ base::FilePath WebEngineLibraryInfo::getPath(int key) #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) return toFilePath(getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_resources.pak")); #else - return toFilePath(location(QLibraryInfo::DataPath) % QLatin1String("/qtwebengine_resources.pak")); + return toFilePath(location(QLibraryInfo::DataPath) % QDir::separator() % QLatin1String("qtwebengine_resources.pak")); #endif case base::FILE_EXE: case content::CHILD_PROCESS_EXE: -- cgit v1.2.3