From fd47c264511e7dca55e666e49faa3a22612b584c Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 6 Nov 2014 11:33:47 +0100 Subject: Move extra installs from core.pro to core_module.pro core_module.pro is the one responsible for deployment of the binary so it makes sense to also let it handle the other files to install. This leaves core.pro to only handle sub-projects dependencies. Change-Id: Ibe433eceec7fb0a9f806dfa89dccb0bedeaccc59 Reviewed-by: Andras Becsi --- src/core/core.pro | 27 --------------------------- src/core/core_module.pro | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/core/core.pro b/src/core/core.pro index 927f8bab4..cf00f39cb 100644 --- a/src/core/core.pro +++ b/src/core/core.pro @@ -28,30 +28,3 @@ SUBDIRS += core_gyp_generator \ gyp_run.depends += gyp_configure_host gyp_configure_target SUBDIRS += gyp_configure_host gyp_configure_target } - -REPACK_DIR = $$OUT_PWD/$$getConfigDir()/gen/repack -locales.files = "$$REPACK_DIR/qtwebengine_locales/*" -locales.CONFIG += no_check_exist -locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales -resources.files = $$REPACK_DIR/qtwebengine_resources.pak -resources.CONFIG += no_check_exist -resources.path = $$[QT_INSTALL_DATA] - -PLUGIN_EXTENSION = .so -PLUGIN_PREFIX = lib -macx: PLUGIN_PREFIX = -win32 { - PLUGIN_EXTENSION = .dll - PLUGIN_PREFIX = -} - -icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat -icu.CONFIG += no_check_exist -icu.path = $$[QT_INSTALL_DATA] - -plugins.files = $$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION} -plugins.CONFIG += no_check_exist -plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine - -INSTALLS += icu locales resources plugins - diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 08e0b7822..3ba65e301 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -11,6 +11,32 @@ QT_PRIVATE += gui-private error("Could not find the linking information that gyp should have generated.") } +REPACK_DIR = $$OUT_PWD/$$getConfigDir()/gen/repack +locales.files = "$$REPACK_DIR/qtwebengine_locales/*" +locales.CONFIG += no_check_exist +locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales +resources.files = $$REPACK_DIR/qtwebengine_resources.pak +resources.CONFIG += no_check_exist +resources.path = $$[QT_INSTALL_DATA] + +PLUGIN_EXTENSION = .so +PLUGIN_PREFIX = lib +osx: PLUGIN_PREFIX = +win32 { + PLUGIN_EXTENSION = .dll + PLUGIN_PREFIX = +} + +icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat +icu.CONFIG += no_check_exist +icu.path = $$[QT_INSTALL_DATA] + +plugins.files = $$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION} +plugins.CONFIG += no_check_exist +plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine + +INSTALLS += icu locales resources plugins + # We distribute the module binary but headers are only available in-tree. CONFIG += no_module_headers load(qt_module) -- cgit v1.2.3 From 66cd31938c4dc97a32a094d3906c21ecdd034f95 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 6 Nov 2014 11:33:53 +0100 Subject: Deploy external data in QtWebEngineCore.framework for framework builds There is currently no convenient way to deploy QtWebEngine into an application bundle on OSX. macdeployqt copies frameworks into a .app bundle's Frameworks directory but this makes no sense unless all the needed files are also distributed with the bundle. This patch moves: - The ffmpegsumo.so library into Libraries/ - Locale .pak files, qtwebengine_resources.pak and icudtl.dat into Resources/ - QtWebEngineProcess into its own .app bundle, itself into Helpers/ QMAKE_BUNDLE_DATA is used to copy files into the bundle while INSTALLS is used when installing normally. A LOCALE_LIST is explicitly listed since QMAKE_BUNDLE_DATA can't handle the * glob to match all source files. Change-Id: I5c0df57b4b9e93f9cce34a74a6e024bf90d37b5c Task-number: QTBUG-41611 Reviewed-by: Zeno Albisser Reviewed-by: Andras Becsi --- src/core/Info_mac.plist | 20 +++++++++++++ src/core/core_module.pro | 43 ++++++++++++++++++++------- src/core/web_engine_library_info.cpp | 56 +++++++++++++++++++++++++++++++++++- src/process/process.pro | 16 ++++++++--- 4 files changed, 119 insertions(+), 16 deletions(-) create mode 100644 src/core/Info_mac.plist diff --git a/src/core/Info_mac.plist b/src/core/Info_mac.plist new file mode 100644 index 000000000..58362c810 --- /dev/null +++ b/src/core/Info_mac.plist @@ -0,0 +1,20 @@ + + + + + CFBundlePackageType + FMWK + CFBundleShortVersionString + @SHORT_VERSION@ + CFBundleVersion + @FULL_VERSION@ + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + @TYPEINFO@ + CFBundleExecutable + @LIBRARY@ + CFBundleIdentifier + org.qt-project.Qt.QtWebEngineCore + + diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 3ba65e301..66ab3ee4d 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -6,18 +6,21 @@ CMAKE_MODULE_TESTS = "-" QT += qml quick QT_PRIVATE += gui-private +# Needed to set a CFBundleIdentifier +QMAKE_INFO_PLIST = Info_mac.plist + # Look for linking information produced by gyp for our target according to core_generated.gyp !include($$OUT_PWD/$$getConfigDir()/$${TARGET}_linking.pri) { error("Could not find the linking information that gyp should have generated.") } REPACK_DIR = $$OUT_PWD/$$getConfigDir()/gen/repack -locales.files = "$$REPACK_DIR/qtwebengine_locales/*" -locales.CONFIG += no_check_exist -locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales +# Duplicated from resources/resources.gyp +LOCALE_LIST = am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk vi zh-CN zh-TW +for(LOC, LOCALE_LIST) { + locales.files += $$REPACK_DIR/qtwebengine_locales/$${LOC}.pak +} resources.files = $$REPACK_DIR/qtwebengine_resources.pak -resources.CONFIG += no_check_exist -resources.path = $$[QT_INSTALL_DATA] PLUGIN_EXTENSION = .so PLUGIN_PREFIX = lib @@ -26,16 +29,34 @@ win32 { PLUGIN_EXTENSION = .dll PLUGIN_PREFIX = } - icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat -icu.CONFIG += no_check_exist -icu.path = $$[QT_INSTALL_DATA] plugins.files = $$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION} -plugins.CONFIG += no_check_exist -plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine -INSTALLS += icu locales resources plugins +!debug_and_release|!build_all|CONFIG(release, debug|release):contains(QT_CONFIG, qt_framework) { + locales.version = Versions + locales.path = Resources/qtwebengine_locales + resources.version = Versions + resources.path = Resources + icu.version = Versions + icu.path = Resources + plugins.version = Versions + plugins.path = Libraries + # No files, this prepares the bundle Helpers symlink, process.pro will create the directories + qtwebengineprocessplaceholder.version = Versions + qtwebengineprocessplaceholder.path = Helpers + QMAKE_BUNDLE_DATA += icu locales resources plugins qtwebengineprocessplaceholder +} else { + locales.CONFIG += no_check_exist + locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales + resources.CONFIG += no_check_exist + resources.path = $$[QT_INSTALL_DATA] + icu.CONFIG += no_check_exist + icu.path = $$[QT_INSTALL_DATA] + plugins.CONFIG += no_check_exist + plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine + INSTALLS += icu locales resources plugins +} # We distribute the module binary but headers are only available in-tree. CONFIG += no_module_headers diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 4cdf3813e..026f4db83 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -92,6 +92,39 @@ QString location(QLibraryInfo::LibraryLocation path) return QLibraryInfo::location(path); } +#if defined(OS_MACOSX) +static inline CFBundleRef frameworkBundle() +{ + return CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.Qt.QtWebEngineCore")); +} + +static QString getPath(CFBundleRef frameworkBundle) +{ + QString path; + if (frameworkBundle) { + CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle); + CFStringRef bundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle); + path = QString::fromCFString(bundlePath); + CFRelease(bundlePath); + CFRelease(bundleUrl); + } + return path; +} + +static QString getResourcesPath(CFBundleRef frameworkBundle) +{ + QString path; + if (frameworkBundle) { + CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle); + CFStringRef resourcesRelativePath = CFURLCopyFileSystemPath(resourcesRelativeUrl, kCFURLPOSIXPathStyle); + path = getPath(frameworkBundle) % QLatin1Char('/') % QString::fromCFString(resourcesRelativePath); + CFRelease(resourcesRelativePath); + CFRelease(resourcesRelativeUrl); + } + return path; +} +#endif + QString subProcessPath() { static bool initialized = false; @@ -100,14 +133,19 @@ QString subProcessPath() #else static QString processBinary (QLatin1String(QTWEBENGINEPROCESS_NAME)); #endif +#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) + static QString processPath (getPath(frameworkBundle()) + % QStringLiteral("/Helpers/" QTWEBENGINEPROCESS_NAME ".app/Contents/MacOS/" QTWEBENGINEPROCESS_NAME)); +#else static QString processPath (location(QLibraryInfo::LibraryExecutablesPath) % QDir::separator() % processBinary); +#endif if (!initialized) { // Allow overriding at runtime for the time being. const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH"); if (!fromEnv.isEmpty()) processPath = QString::fromLatin1(fromEnv); - if (processPath.isEmpty() || !QFileInfo(processPath).exists()) { + if (!QFileInfo(processPath).exists()) { qWarning("QtWebEngineProcess not found at location %s. Trying fallback path...", qPrintable(processPath)); processPath = QCoreApplication::applicationDirPath() % QDir::separator() % processBinary; } @@ -121,12 +159,20 @@ QString subProcessPath() QString pluginsPath() { +#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) + return getPath(frameworkBundle()) % QLatin1String("/Libraries"); +#else return location(QLibraryInfo::PluginsPath) % QDir::separator() % QLatin1String("qtwebengine"); +#endif } 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"); +#endif } QString fallbackDir() { @@ -155,7 +201,11 @@ base::FilePath WebEngineLibraryInfo::getPath(int key) QString directory; switch (key) { case QT_RESOURCES_PAK: +#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")); +#endif case base::FILE_EXE: case content::CHILD_PROCESS_EXE: return toFilePath(subProcessPath()); @@ -171,7 +221,11 @@ base::FilePath WebEngineLibraryInfo::getPath(int key) directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); break; case base::DIR_QT_LIBRARY_DATA: +#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) + return toFilePath(getResourcesPath(frameworkBundle())); +#else return toFilePath(location(QLibraryInfo::DataPath)); +#endif #if defined(OS_ANDROID) case base::DIR_SOURCE_ROOT: case base::DIR_ANDROID_EXTERNAL_STORAGE: diff --git a/src/process/process.pro b/src/process/process.pro index a9f5d183f..8ed09612a 100644 --- a/src/process/process.pro +++ b/src/process/process.pro @@ -3,14 +3,22 @@ TEMPLATE = app QT_PRIVATE += webenginecore -CONFIG -= app_bundle - load(qt_build_paths) -DESTDIR = $$MODULE_BASE_OUTDIR/libexec +contains(QT_CONFIG, qt_framework) { + # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework. + DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers +} else { + CONFIG -= app_bundle + DESTDIR = $$MODULE_BASE_OUTDIR/libexec +} INCLUDEPATH += ../core SOURCES = main.cpp -target.path = $$[QT_INSTALL_LIBEXECS] +contains(QT_CONFIG, qt_framework) { + target.path = $$[QT_INSTALL_LIBS]/QtWebEngineCore.framework/Versions/5/Helpers +} else { + target.path = $$[QT_INSTALL_LIBEXECS] +} INSTALLS += target -- cgit v1.2.3 From 7a9ed4f2582815273b8ae9398dcddab4a8a9114b Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 5 Nov 2014 13:10:52 +0100 Subject: Fix crashes in QQuickWebEngineSettings Remove QQuickWebEngineSettingsPrivate object's pointer from the global setting list before the object is destructed. Change-Id: I1cca6bf8aa2438903692d9e2ef863c8fc543adbd Reviewed-by: Andras Becsi --- src/webengine/api/qquickwebenginesettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 7f36bad5e..743d22d81 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -78,6 +78,7 @@ QQuickWebEngineSettings *QQuickWebEngineSettings::globalSettings() QQuickWebEngineSettings::~QQuickWebEngineSettings() { + allSettings->removeAll(this->d_func()); } bool QQuickWebEngineSettings::autoLoadImages() const -- cgit v1.2.3 From 0b5a7d6132164994221fd83f70e705772337137e Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Tue, 21 Oct 2014 13:50:27 +0200 Subject: Disable error page while testing loadFail signal of Quick API Error page should be disabled while testing loadFail signal since testing signals of the internal error page is not possible yet. Change-Id: I07f0bb6378fcbf5d18634197808801c94606803c Reviewed-by: Andras Becsi --- tests/auto/quick/qmltests/data/tst_loadFail.qml | 39 ++++++++++++++++--------- tests/auto/quick/qmltests/data/tst_loadUrl.qml | 5 +++- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/tests/auto/quick/qmltests/data/tst_loadFail.qml b/tests/auto/quick/qmltests/data/tst_loadFail.qml index 7b0a1849e..694547863 100644 --- a/tests/auto/quick/qmltests/data/tst_loadFail.qml +++ b/tests/auto/quick/qmltests/data/tst_loadFail.qml @@ -42,38 +42,49 @@ import QtQuick 2.0 import QtTest 1.0 import QtWebEngine 1.0 +import QtWebEngine.experimental 1.0 TestWebEngineView { id: webEngineView width: 400 height: 300 - property variant testUrl - - SignalSpy { - id: spyIconChanged - target: webEngineView - signalName: "iconChanged" - } + property variant unavailableUrl TestCase { id: test name: "WebEngineViewLoadFail" + + function initTestCase() { + WebEngine.settings.errorPageEnabled = false + } + function test_fail() { - testUrl = Qt.resolvedUrl("file_that_does_not_exist.html") - webEngineView.url = testUrl + unavailableUrl = Qt.resolvedUrl("file_that_does_not_exist.html") + webEngineView.url = unavailableUrl verify(webEngineView.waitForLoadFailed()) - spyIconChanged.clear() + } - // If this testcase finishes too early, we can not handle the received replacement content. - // So we should wait to ignore this error page. - spyIconChanged.wait() + function test_fail_url() { + var url = Qt.resolvedUrl("test1.html") + webEngineView.url = url + compare(webEngineView.url, url) + verify(webEngineView.waitForLoadSucceeded()) + compare(webEngineView.url, url) + + unavailableUrl = Qt.resolvedUrl("file_that_does_not_exist.html") + webEngineView.url = unavailableUrl + compare(webEngineView.url, unavailableUrl) + verify(webEngineView.waitForLoadFailed()) + // When error page is disabled in case of LoadFail the entry of the unavailable page is not stored. + // We expect the url of the previously loaded page here. + compare(webEngineView.url, url) } } onLoadingChanged: { if (loadRequest.status == WebEngineView.LoadFailedStatus) { - test.compare(loadRequest.url, testUrl) + test.compare(loadRequest.url, unavailableUrl) test.compare(loadRequest.errorDomain, WebEngineView.InternalErrorDomain) } } diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml index 5f51e9036..e0e185eb0 100644 --- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml +++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml @@ -42,6 +42,7 @@ import QtQuick 2.0 import QtTest 1.0 import QtWebEngine 1.0 +import QtWebEngine.experimental 1.0 TestWebEngineView { id: webEngineView @@ -106,6 +107,8 @@ TestWebEngineView { } function test_urlProperty() { + WebEngine.settings.errorPageEnabled = false + var url = Qt.resolvedUrl("test1.html") webEngineView.url = url @@ -117,7 +120,7 @@ TestWebEngineView { webEngineView.url = bogusSite compare(webEngineView.url, bogusSite) verify(webEngineView.waitForLoadFailed()) - compare(webEngineView.url, bogusSite) + compare(webEngineView.url, url) webEngineView.url = "about:blank" // Reset from previous test verify(webEngineView.waitForLoadSucceeded()) -- cgit v1.2.3 From 81d94e618877cc651d2ad02bce9419965374675f Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Mon, 10 Nov 2014 11:37:27 +0100 Subject: Update snapshot sha1 to include various crash fixes for the release. Change-Id: I2d04e910c7a08e1c630bc490d1f8b1be3d27a6f1 Reviewed-by: Jocelyn Turcotte --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 0dcd4e350..577cd47e5 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 0dcd4e35086a90f643bb721fad1ef786f5fff8ba +Subproject commit 577cd47e54bb88c81b7a5b5a6d658d8d61b2c747 -- cgit v1.2.3 From 4f4a33467f4d41b1224948cc4c5d8828232b141a Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 11 Nov 2014 16:15:36 +0100 Subject: Disable accelerated 2D canvas rendering with ANGLE ANGLE isn't thread-safe and we're already taking a risk by letting Chromium do texture upload from the GPU thread with a shared GL context. Any kind of drawing happening concurrently between the GPU thread and the Qt scene graph thread might currently end up drawing on the same device context and this is creating visual artifacts and Direct3D errors. We're already disabling WebGL but we should also disable accelerated 2D canvas rendering to lower that risk. We should ultimately disable ANGLE from within Chromium or fix multithreading issues to properly support GL rendering scenarios across threads. Task-number: QTBUG-41627 Change-Id: I37a7a778f0e1066a454f51bb38e98df4dea8767e Reviewed-by: Pierre Rossi Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 20bf3e051..ac9a921e7 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -142,7 +142,11 @@ WebEngineContext::WebEngineContext() #if defined(OS_WIN) parsedCommandLine->AppendSwitch(switches::kDisableD3D11); + // ANGLE doesn't support multi-threading, doing texture upload from the GPU thread + // hasn't been causing problems yet but doing rendering there is conflicting with + // Qt's rendering of the scene graph. parsedCommandLine->AppendSwitch(switches::kDisableExperimentalWebGL); + parsedCommandLine->AppendSwitch(switches::kDisableAccelerated2dCanvas); #endif #if defined(QTWEBENGINE_MOBILE_SWITCHES) -- cgit v1.2.3 From 85d26a2919a016ae76c6d83af28281cffd8a3aa1 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 10 Nov 2014 16:49:05 -0800 Subject: Add a stub AccessTokenStore implementation. Callers inside Chromium expect an implementation of AccessTokenStore to exist. This fixes crashes with the geolocation-based APIs, exposed on e.g. google.com when faking an Android UA (as well as other places, probably). Change-Id: I45e6b483e096d5165fefd86927cdf34e799cc4d9 Reviewed-by: Pierre Rossi --- src/core/access_token_store_qt.cpp | 56 +++++++++++++++++++++++++++++++++ src/core/access_token_store_qt.h | 57 ++++++++++++++++++++++++++++++++++ src/core/content_browser_client_qt.cpp | 6 ++++ src/core/content_browser_client_qt.h | 1 + src/core/core_gyp_generator.pro | 2 ++ 5 files changed, 122 insertions(+) create mode 100644 src/core/access_token_store_qt.cpp create mode 100644 src/core/access_token_store_qt.h diff --git a/src/core/access_token_store_qt.cpp b/src/core/access_token_store_qt.cpp new file mode 100644 index 000000000..85a91c3f7 --- /dev/null +++ b/src/core/access_token_store_qt.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "access_token_store_qt.h" + +#include + +AccessTokenStoreQt::AccessTokenStoreQt() +{ +} + +AccessTokenStoreQt::~AccessTokenStoreQt() +{ +} + +void AccessTokenStoreQt::LoadAccessTokens(const LoadAccessTokensCallbackType& callback) +{ +} + +void AccessTokenStoreQt::SaveAccessToken(const GURL& server_url, const base::string16& access_token) +{ +} + diff --git a/src/core/access_token_store_qt.h b/src/core/access_token_store_qt.h new file mode 100644 index 000000000..2a76681f0 --- /dev/null +++ b/src/core/access_token_store_qt.h @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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.LGPLv3 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.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 later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ACCESS_TOKEN_STORE_QT_H +#define ACCESS_TOKEN_STORE_QT_H + +#include "content/public/browser/access_token_store.h" + +#include // Needed for Q_DECL_OVERRIDE + +class AccessTokenStoreQt : public content::AccessTokenStore +{ +public: + AccessTokenStoreQt(); + ~AccessTokenStoreQt(); + + virtual void LoadAccessTokens(const LoadAccessTokensCallbackType& callback) Q_DECL_OVERRIDE; + virtual void SaveAccessToken(const GURL& server_url, const base::string16& access_token) Q_DECL_OVERRIDE; + +private: + DISALLOW_COPY_AND_ASSIGN(AccessTokenStoreQt); +}; + +#endif // ACCESS_TOKEN_STORE_QT_H diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 3ead5314f..ee403298b 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -62,6 +62,7 @@ #include "media_capture_devices_dispatcher.h" #include "resource_dispatcher_host_delegate_qt.h" #include "web_contents_delegate_qt.h" +#include "access_token_store_qt.h" #include #include @@ -347,6 +348,11 @@ void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, c static_cast(webContents->GetDelegate())->overrideWebPreferences(webContents, web_prefs); } +content::AccessTokenStore *ContentBrowserClientQt::CreateAccessTokenStore() +{ + return new AccessTokenStoreQt; +} + BrowserContextQt* ContentBrowserClientQt::browser_context() { Q_ASSERT(m_browserMainParts); return static_cast(m_browserMainParts)->browser_context(); diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index dd5d9f3a1..4f216030c 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -79,6 +79,7 @@ public: virtual gfx::GLShareGroup* GetInProcessGpuShareGroup() Q_DECL_OVERRIDE; 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 void AllowCertificateError( int render_process_id, int render_frame_id, diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index c50d56df4..38aba3a76 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -33,6 +33,7 @@ RESOURCES += devtools.qrc INCLUDEPATH += $$[QT_INSTALL_HEADERS] $$PWD SOURCES = \ + access_token_store_qt.cpp \ browser_accessibility_manager_qt.cpp \ browser_accessibility_qt.cpp \ browser_context_qt.cpp \ @@ -80,6 +81,7 @@ SOURCES = \ yuv_video_node.cpp HEADERS = \ + access_token_store_qt.h \ browser_accessibility_manager_qt.h \ browser_accessibility_qt.h \ browser_context_qt.h \ -- cgit v1.2.3 From 51d7318aa4bebd38d43daad0dc19b45ab3afaa35 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Tue, 4 Nov 2014 06:05:39 -0800 Subject: Process touch events in sorted order. We are mapping a single QTouchEvent to multiple MotionEventQt for Chromium. For gesture recognition it is important that these motion events are being processed in a sorted manner, as a move event might trigger a different gesture depending on how many ACTION_DOWN or ACTION_POINTER_DOWN were received before. It is particularly illegal to process an ACTION_MOVE with multiple touch points without having received a ACTION_POINTER_DOWN before. Change-Id: I75d22dd845774a14b5f590e0e0ce46263c4a49f4 Reviewed-by: Jocelyn Turcotte Reviewed-by: Andras Becsi --- src/core/render_widget_host_view_qt.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 2cc5510ae..c221e94e3 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -133,6 +133,12 @@ static inline ui::GestureProvider::Config QtGestureProviderConfig() { return config; } +static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const QTouchEvent::TouchPoint &rhs) +{ + // TouchPointPressed < TouchPointMoved < TouchPointReleased + return lhs.state() < rhs.state(); +} + class MotionEventQt : public ui::MotionEvent { public: MotionEventQt(const QList &touchPoints, const base::TimeTicks &eventTime, Action action, int index = -1) @@ -983,6 +989,10 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev) if (ev->type() == QEvent::TouchBegin) m_sendMotionActionDown = true; + // Make sure that ACTION_POINTER_DOWN is delivered before ACTION_MOVE, + // and ACTION_MOVE before ACTION_POINTER_UP. + std::sort(touchPoints.begin(), touchPoints.end(), compareTouchPoints); + for (int i = 0; i < touchPoints.size(); ++i) { ui::MotionEvent::Action action; switch (touchPoints[i].state()) { -- cgit v1.2.3 From 8f09f9918b10d40b2823bdfe24aa82908aa37990 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Fri, 14 Nov 2014 15:14:03 +0100 Subject: Add missing header guards Change-Id: I67d0040c2e9f00e8a7b842ac1228212c0e93873c Reviewed-by: Jocelyn Turcotte --- src/core/renderer/content_renderer_client_qt.h | 4 ++++ src/core/renderer/qt_render_view_observer.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h index 4e3c70cf8..7103bc29b 100644 --- a/src/core/renderer/content_renderer_client_qt.h +++ b/src/core/renderer/content_renderer_client_qt.h @@ -33,6 +33,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#ifndef CONTENT_RENDERER_CLIENT_QT_H +#define CONTENT_RENDERER_CLIENT_QT_H #include "content/public/renderer/content_renderer_client.h" @@ -61,3 +63,5 @@ public: private: QScopedPointer m_visitedLinkSlave; }; + +#endif // CONTENT_RENDERER_CLIENT_QT_H diff --git a/src/core/renderer/qt_render_view_observer.h b/src/core/renderer/qt_render_view_observer.h index fed5852e4..94f8baa40 100644 --- a/src/core/renderer/qt_render_view_observer.h +++ b/src/core/renderer/qt_render_view_observer.h @@ -33,6 +33,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#ifndef QT_RENDER_VIEW_OBSERVER_H +#define QT_RENDER_VIEW_OBSERVER_H #include "content/public/renderer/render_view_observer.h" @@ -52,3 +54,5 @@ private: DISALLOW_COPY_AND_ASSIGN(QtRenderViewObserver); }; + +#endif // QT_RENDER_VIEW_OBSERVER_H -- cgit v1.2.3 From a659a309fa6f280e657458123c64a401707a9db0 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 14 Nov 2014 11:09:42 +0100 Subject: Doc: Fix issues related to example docs - Add documentation for Quick Nano Browser - Add all examples to the correct group - Add instructions to run the examples - Qt WebEngine Widgets index page: Add examples section Task-number: QTBUG-42668 Change-Id: Ie60f8708336b9c147d0c22afb555fe87287deddc Reviewed-by: Jocelyn Turcotte Reviewed-by: Venugopal Shivashankar --- .../doc/images/quicknanobrowser-demo.jpg | Bin 0 -> 30156 bytes .../quicknanobrowser/doc/src/quicknanobrowser.qdoc | 41 +++++++++++++++++++++ .../webenginewidgets/browser/doc/src/browser.qdoc | 5 ++- .../fancybrowser/doc/src/fancybrowser.qdoc | 5 ++- .../doc/src/qtwebenginewidgets.qdoc | 6 +++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg create mode 100644 examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc diff --git a/examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg b/examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg new file mode 100644 index 000000000..12693bb0f Binary files /dev/null and b/examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg differ diff --git a/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc new file mode 100644 index 000000000..e42637073 --- /dev/null +++ b/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example quicknanobrowser + \title WebEngine Quick Nano Browser + \ingroup webengine-examples + \brief A web browser implemented using the WebEngineView QML type. + + The Quick Nano Browser demo shows the \l{Qt WebEngine} module in action, + providing a little QML web browser with support for tabs and keyboard + shortcuts. + + \image quicknanobrowser-demo.jpg + + \include examples-run.qdocinc +*/ diff --git a/examples/webenginewidgets/browser/doc/src/browser.qdoc b/examples/webenginewidgets/browser/doc/src/browser.qdoc index a8208184d..f4a51518b 100644 --- a/examples/webenginewidgets/browser/doc/src/browser.qdoc +++ b/examples/webenginewidgets/browser/doc/src/browser.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -28,10 +28,13 @@ /*! \example browser \title WebEngine Tab Browser Example + \ingroup webengine-widgetexamples \brief The QtWebKit browser example ported to use QtWebEngine The Tab Browser example shows the \l{Qt WebEngine Widgets} module in action, providing a little Web browser application with support for tabs. \image browser-demo.png + + \include examples-run.qdocinc */ diff --git a/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc b/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc index 60652c69a..f4b5321a1 100644 --- a/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc +++ b/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -28,6 +28,7 @@ /*! \example fancybrowser \title WebEngine Fancy Browser Example + \ingroup webengine-widgetexamples \brief Demonstrates how to use browse web and manipulate content \brief The Fancy Browser example shows how to use JQuery with QtWebEngine to @@ -40,6 +41,8 @@ evaluate the jQuery JavaScript code. A QMainWindow with a QWebEngineView as central widget builds up the browser itself. + \include examples-run.qdocinc + \section1 MainWindow Class Definition The \c MainWindow class inherits QMainWindow. It implements a number of diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc index 3f6e888f3..d440dd06a 100644 --- a/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc +++ b/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc @@ -117,6 +117,12 @@ \li \l {Qt WebEngine Widgets C++ Classes} \endlist + \section1 Examples + + \list + \li \l {Qt WebEngine Widgets Examples} + \endlist + \section1 License Information This is a snapshot of the integration of Chromium into Qt. -- cgit v1.2.3 From 8af12f0c9ee0cfdf28f557e96086bb7b08d786bc Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 20 Nov 2014 11:49:34 +0100 Subject: Use a relative install_name for QtWebEngineProcess' dependencies Until we can rely on Qt using @rpath on OSX, QtWebEngineProcess' dependencies must either be updated by macdeployqt when creating an .app bundle, either we must make that path relative at build time. Since QtWebEngineProcess.app is always deployed inside QtWebEngineCore.framework, we can safely assume that the dylib is always in a parent directory and that QtCore.framework can be found one directory higher. The additional dependencies of QtWebEngineCore.framework will be handled by the dynamic linker when it gets loaded, but this only works for QtWebEngineProcess when macdeployqt uses @loader_path instead of @executable_path (then relative to the application which is in a different directory than QtWebEngineProcess). This can be forced by passing a non-empty value for its -executable= command-line argument (e.g `macdeployqt Browser.app -executable=Browser.app/Contents/MacOS/Browser`) All this will be much simpler once we got Qt framework builds to use @rpath instead in a future minor version. Task-number: QTBUG-41611 Change-Id: Ied46c65a09f7033b622708da6e3d85855f9abf34 Reviewed-by: Andras Becsi --- src/process/process.pro | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/process/process.pro b/src/process/process.pro index 8ed09612a..ad1575c81 100644 --- a/src/process/process.pro +++ b/src/process/process.pro @@ -1,15 +1,33 @@ TARGET = $$QTWEBENGINEPROCESS_NAME TEMPLATE = app -QT_PRIVATE += webenginecore - load(qt_build_paths) contains(QT_CONFIG, qt_framework) { # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework. DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers + + # FIXME: We can remove those steps in Qt 5.5 once @rpath works + # "QT += webenginecore" would pull all dependencies that we'd also need to update + # with install_name_tool on OSX, but we only need access to the private + # QtWebEngine::processMain. qtAddModule will take care of finding where + # the library is without pulling additional librarie. + QT = core + qtAddModule(webenginecore, LIBS) + CONFIG -= link_prl + QMAKE_POST_LINK = \ + "xcrun install_name_tool -change " \ + "`xcrun otool -X -L $(TARGET) | grep QtWebEngineCore | cut -d ' ' -f 1` " \ + "@executable_path/../../../../QtWebEngineCore " \ + "$(TARGET); " \ + "xcrun install_name_tool -change " \ + "`xcrun otool -X -L $(TARGET) | grep QtCore | cut -d ' ' -f 1` " \ + "@executable_path/../../../../../../../QtCore.framework/QtCore " \ + "$(TARGET) " } else { CONFIG -= app_bundle DESTDIR = $$MODULE_BASE_OUTDIR/libexec + + QT_PRIVATE += webenginecore } INCLUDEPATH += ../core -- cgit v1.2.3 From c5957ac90cbaccccbd58b3fc73f94cf0d4795e54 Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Mon, 24 Nov 2014 18:35:54 +0100 Subject: Disable using the ICU data file on embedded linux Since we use the system ICU we do not need the extra data file. This fixes a crash caused by missing icudtl.dat file. Change-Id: Ic7a6ad83d6595ea3a89c736c281499636b05945e Reviewed-by: Zeno Albisser --- src/core/config/embedded_linux.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/config/embedded_linux.pri b/src/core/config/embedded_linux.pri index dc6a5f612..4000625c6 100644 --- a/src/core/config/embedded_linux.pri +++ b/src/core/config/embedded_linux.pri @@ -46,6 +46,7 @@ GYP_CONFIG += \ use_pulseaudio=0 \ use_system_harfbuzz=0 \ use_system_icu=1 \ + icu_use_data_file_flag=0 \ use_x11=0 \ v8_use_snapshot=false \ want_separate_host_toolset=1 \ -- cgit v1.2.3