diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-11-27 13:18:49 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-11-27 13:19:25 +0100 |
commit | 8c6f087296ec48790c3efd9564c1056802b4c9c0 (patch) | |
tree | da343f4ecd843a0ff83ef3f584cb62d9188dab5c /src/core | |
parent | aa1b2d20a80f53ce5e7f6097114d41a018d9350b (diff) | |
parent | c5957ac90cbaccccbd58b3fc73f94cf0d4795e54 (diff) |
Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I2c48688f5f034233660bd7891693f81525fc1d6d
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Info_mac.plist | 20 | ||||
-rw-r--r-- | src/core/access_token_store_qt.cpp | 56 | ||||
-rw-r--r-- | src/core/access_token_store_qt.h | 57 | ||||
-rw-r--r-- | src/core/config/embedded_linux.pri | 1 | ||||
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 6 | ||||
-rw-r--r-- | src/core/content_browser_client_qt.h | 1 | ||||
-rw-r--r-- | src/core/core.pro | 27 | ||||
-rw-r--r-- | src/core/core_gyp_generator.pro | 2 | ||||
-rw-r--r-- | src/core/core_module.pro | 47 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 10 | ||||
-rw-r--r-- | src/core/renderer/content_renderer_client_qt.h | 4 | ||||
-rw-r--r-- | src/core/renderer/qt_render_view_observer.h | 4 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 4 | ||||
-rw-r--r-- | src/core/web_engine_library_info.cpp | 56 |
14 files changed, 267 insertions, 28 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>@SHORT_VERSION@</string> + <key>CFBundleVersion</key> + <string>@FULL_VERSION@</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>@TYPEINFO@</string> + <key>CFBundleExecutable</key> + <string>@LIBRARY@</string> + <key>CFBundleIdentifier</key> + <string>org.qt-project.Qt.QtWebEngineCore</string> +</dict> +</plist> 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 <QDebug> + +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 <QtCore/qcompilerdetection.h> // 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/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 \ 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 <QGuiApplication> #include <QOpenGLContext> @@ -347,6 +348,11 @@ void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, c static_cast<WebContentsDelegateQt*>(webContents->GetDelegate())->overrideWebPreferences(webContents, web_prefs); } +content::AccessTokenStore *ContentBrowserClientQt::CreateAccessTokenStore() +{ + return new AccessTokenStoreQt; +} + BrowserContextQt* ContentBrowserClientQt::browser_context() { Q_ASSERT(m_browserMainParts); return static_cast<BrowserMainPartsQt*>(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.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_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 \ diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 08e0b7822..66ab3ee4d 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -6,11 +6,58 @@ 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 +# 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 + +PLUGIN_EXTENSION = .so +PLUGIN_PREFIX = lib +osx: PLUGIN_PREFIX = +win32 { + PLUGIN_EXTENSION = .dll + PLUGIN_PREFIX = +} +icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat + +plugins.files = $$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION} + +!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 load(qt_module) 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<QTouchEvent::TouchPoint> &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()) { 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<visitedlink::VisitedLinkSlave> 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 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) 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: |