summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-16 18:24:17 +0100
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-16 18:24:17 +0100
commit0fc1516692fb11f3489bce11a8f0cc15ad8f6b63 (patch)
treed39aa29c33b87430598fe17751a7d65529792660 /src
parentdb2f69bb58ab369e44ea8bb30dcdbe90660578a2 (diff)
parentae657b918ff22da2553dc577c877b03f49cc2bdf (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/3rdparty Change-Id: Ied43de29444d4803218e250b096b9c72bc017af7
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/core/core_gyp_generator.pro3
-rw-r--r--src/core/core_module.pro104
-rw-r--r--src/core/web_engine_context.cpp1
-rw-r--r--src/core/web_engine_library_info.cpp14
-rw-r--r--src/process/Info_mac.plist22
-rw-r--r--src/process/process.pro3
-rw-r--r--src/src.pro42
-rw-r--r--src/webengine/api/qquickwebengineview.cpp2
-rw-r--r--src/webengine/ui_delegates_manager.cpp31
10 files changed, 125 insertions, 97 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 66388297cf2ca42049fb099237134ec33465e2f
+Subproject f9c03801de86b5e9da2b915a9e490c2f2254fec
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index 90a665e84..ae2422957 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -29,8 +29,7 @@ else: DEFINES += QT_NO_EGL
RESOURCES += devtools.qrc
-# something fishy with qmake in 5.2 ?
-INCLUDEPATH += $$[QT_INSTALL_HEADERS] $$PWD
+INCLUDEPATH += $$PWD
SOURCES = \
access_token_store_qt.cpp \
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 8801dd4cf..e6933cc4b 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -13,6 +13,18 @@ QMAKE_INFO_PLIST = Info_mac.plist
error("Could not find the linking information that gyp should have generated.")
}
+# We distribute the module binary but headers are only available in-tree.
+CONFIG += no_module_headers
+load(qt_module)
+
+# Using -Wl,-Bsymbolic-functions seems to confuse the dynamic linker
+# and doesn't let Chromium get access to libc symbols through dlsym.
+CONFIG -= bsymbolic_functions
+
+contains(QT_CONFIG, egl): CONFIG += egl
+
+linux: contains(QT_CONFIG, separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)"
+
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
@@ -32,58 +44,48 @@ 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)
-
-# Using -Wl,-Bsymbolic-functions seems to confuse the dynamic linker
-# and doesn't let Chromium get access to libc symbols through dlsym.
-CONFIG -= bsymbolic_functions
-
-contains(QT_CONFIG, egl): CONFIG += egl
-
-linux: contains(QT_CONFIG, separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)"
+!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
+ }
-!contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) {
- ICU_TARGET = $$shell_path($$[QT_INSTALL_DATA]/icudtl.dat)
- ICU_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/icudtl.dat)
- icu_rule.target = $$ICU_TARGET
- unix: icu_rule.commands = if [ -e $$ICU_FILE ] ; then $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ; fi
- win32: icu_rule.commands = if exist $$ICU_FILE ( $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET )
+ !contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) {
+ ICU_TARGET = $$shell_path($$[QT_INSTALL_DATA]/icudtl.dat)
+ ICU_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/icudtl.dat)
+ icu_rule.target = $$ICU_TARGET
+ unix: icu_rule.commands = if [ -e $$ICU_FILE ] ; then $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET ; fi
+ win32: icu_rule.commands = if exist $$ICU_FILE ( $$QMAKE_COPY $$ICU_FILE $$ICU_TARGET )
- PLUGIN_DIR = $$shell_path($$[QT_INSTALL_PLUGINS]/qtwebengine)
- PLUGIN_TARGET = $$shell_path($$PLUGIN_DIR/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION})
- PLUGIN_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION})
- plugins_rule.target = $$PLUGIN_TARGET
- unix: plugins_rule.commands = $$QMAKE_MKDIR $$PLUGIN_DIR && if [ -e $$PLUGIN_FILE ] ; then $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET ; fi
- win32: plugins_rule.commands = (if not exist $$PLUGIN_DIR ( $$QMAKE_MKDIR $$PLUGIN_DIR )) && \
- if exist $$PLUGIN_FILE ( $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET )
+ PLUGIN_DIR = $$shell_path($$[QT_INSTALL_PLUGINS]/qtwebengine)
+ PLUGIN_TARGET = $$shell_path($$PLUGIN_DIR/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION})
+ PLUGIN_FILE = $$shell_path($$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION})
+ plugins_rule.target = $$PLUGIN_TARGET
+ unix: plugins_rule.commands = $$QMAKE_MKDIR $$PLUGIN_DIR && if [ -e $$PLUGIN_FILE ] ; then $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET ; fi
+ win32: plugins_rule.commands = (if not exist $$PLUGIN_DIR ( $$QMAKE_MKDIR $$PLUGIN_DIR )) && \
+ if exist $$PLUGIN_FILE ( $$QMAKE_COPY $$PLUGIN_FILE $$PLUGIN_TARGET )
- QMAKE_EXTRA_TARGETS += icu_rule plugins_rule
- PRE_TARGETDEPS += $$ICU_TARGET $$PLUGIN_TARGET
+ QMAKE_EXTRA_TARGETS += icu_rule plugins_rule
+ PRE_TARGETDEPS += $$ICU_TARGET $$PLUGIN_TARGET
+ }
}
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index d48c23815..85c1136d9 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -250,6 +250,7 @@ WebEngineContext::WebEngineContext()
content::GpuProcessHost::RegisterGpuMainThreadFactory(content::CreateInProcessGpuThread);
content::ContentMainParams contentMainParams(m_mainDelegate.get());
+ contentMainParams.setup_signal_handlers = false;
#if defined(OS_WIN)
sandbox::SandboxInterfaceInfo sandbox_info = {0};
content::InitializeSandboxInfo(&sandbox_info);
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 09e2af495..452eee306 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -101,7 +101,12 @@ static inline CFBundleRef frameworkBundle()
static QString getPath(CFBundleRef frameworkBundle)
{
QString path;
- if (frameworkBundle) {
+ // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
+ // We use it for the other OS X versions as well to make sure it works and because
+ // the directory structure should be the same.
+ if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+ path = QDir::cleanPath(qApp->applicationDirPath() % QLatin1String("/../../../.."));
+ } else if (frameworkBundle) {
CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle);
CFStringRef bundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle);
path = QString::fromCFString(bundlePath);
@@ -114,7 +119,12 @@ static QString getPath(CFBundleRef frameworkBundle)
static QString getResourcesPath(CFBundleRef frameworkBundle)
{
QString path;
- if (frameworkBundle) {
+ // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
+ // We use it for the other OS X versions as well to make sure it works and because
+ // the directory structure should be the same.
+ if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+ path = getPath(frameworkBundle) % QLatin1String("/Resources");
+ } else if (frameworkBundle) {
CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle);
CFStringRef resourcesRelativePath = CFURLCopyFileSystemPath(resourcesRelativeUrl, kCFURLPOSIXPathStyle);
path = getPath(frameworkBundle) % QLatin1Char('/') % QString::fromCFString(resourcesRelativePath);
diff --git a/src/process/Info_mac.plist b/src/process/Info_mac.plist
new file mode 100644
index 000000000..de1d010bc
--- /dev/null
+++ b/src/process/Info_mac.plist
@@ -0,0 +1,22 @@
+<?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>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>CFBundleIconFile</key>
+ <string>@ICON@</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@EXECUTABLE@</string>
+ <key>CFBundleIdentifier</key>
+ <string>@BUNDLEIDENTIFIER@</string>
+ <key>LSUIElement</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/src/process/process.pro b/src/process/process.pro
index ad1575c81..443c5c3d9 100644
--- a/src/process/process.pro
+++ b/src/process/process.pro
@@ -1,6 +1,9 @@
TARGET = $$QTWEBENGINEPROCESS_NAME
TEMPLATE = app
+# Needed to set LSUIElement=1
+QMAKE_INFO_PLIST = Info_mac.plist
+
load(qt_build_paths)
contains(QT_CONFIG, qt_framework) {
# Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework.
diff --git a/src/src.pro b/src/src.pro
index 60f873c76..ed402c582 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,30 +1,26 @@
TEMPLATE = subdirs
-isPlatformSupported() {
- process.depends = core
- webengine.depends = core
- webenginewidgets.depends = core webengine
- webengine_plugin.subdir = webengine/plugin
- webengine_plugin.target = sub-webengine-plugin
- webengine_plugin.depends = webengine
- webengine_experimental_plugin.subdir = webengine/plugin/experimental
- webengine_experimental_plugin.target = sub-webengine-experimental-plugin
- webengine_experimental_plugin.depends = webengine
+process.depends = core
+webengine.depends = core
+webenginewidgets.depends = core webengine
+webengine_plugin.subdir = webengine/plugin
+webengine_plugin.target = sub-webengine-plugin
+webengine_plugin.depends = webengine
+webengine_experimental_plugin.subdir = webengine/plugin/experimental
+webengine_experimental_plugin.target = sub-webengine-experimental-plugin
+webengine_experimental_plugin.depends = webengine
- SUBDIRS += core \
- process \
- webengine \
- webengine_plugin \
- webengine_experimental_plugin
+SUBDIRS += core \
+ process \
+ webengine \
+ webengine_plugin \
+ webengine_experimental_plugin
- # FIXME: We probably want a bit more control over config options to tweak what to build/ship or not.
- # Another example of where this could be necessary is to make it easy to build proprietery codecs support.
- !contains(WEBENGINE_CONFIG, no_ui_delegates): SUBDIRS += webengine/ui
+# FIXME: We probably want a bit more control over config options to tweak what to build/ship or not.
+# Another example of where this could be necessary is to make it easy to build proprietery codecs support.
+!contains(WEBENGINE_CONFIG, no_ui_delegates): SUBDIRS += webengine/ui
- qtHaveModule(widgets) {
- SUBDIRS += webenginewidgets
- }
-} else {
- warning("QtWebEngine is not maintained for this platform/configuration and is therefore disabled.")
+qtHaveModule(widgets) {
+ SUBDIRS += webenginewidgets
}
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 6d666feb9..1b95f86b4 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -188,7 +188,7 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
// FIXME: expose the context menu data as an attached property to make this more useful
if (contextMenuExtraItems) {
ui()->addMenuSeparator(menu);
- if (QObject* menuExtras = contextMenuExtraItems->create(ui()->creationContextForComponent(contextMenuExtraItems))) {
+ if (QObject* menuExtras = contextMenuExtraItems->create(qmlContext(q))) {
menuExtras->setParent(menu);
QQmlListReference entries(menu, defaultPropertyName(menu), qmlEngine(q));
if (entries.isValid())
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index 95e04d699..48e1bee7e 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -173,24 +173,15 @@ bool UIDelegatesManager::ensureComponentLoaded(ComponentType type)
*component = (new QQmlComponent(engine, QUrl::fromLocalFile(fi.absoluteFilePath()), QQmlComponent::PreferSynchronous, m_view));
if ((*component)->status() != QQmlComponent::Ready) {
-#ifdef UI_DELEGATES_DEBUG
Q_FOREACH (const QQmlError& err, (*component)->errors())
- fprintf(stderr, " component error: %s\n", qPrintable(err.toString()));
-#endif
+ qWarning("QtWebEngine: component error: %s\n", qPrintable(err.toString()));
+ delete *component;
+ *component = 0;
return false;
}
return true;
}
-QQmlContext *UIDelegatesManager::creationContextForComponent(QQmlComponent *component)
-{
- Q_ASSERT(component);
-
- QQmlContext* baseContext = component->creationContext() ? component->creationContext() : qmlContext(m_view);
- Q_ASSERT(baseContext);
- return baseContext;
-}
-
#define CHECK_QML_SIGNAL_PROPERTY(prop, location) \
if (!prop.isSignalProperty()) \
qWarning("%s is missing %s signal property.\n", qPrintable(location.toString()), qPrintable(prop.name()));
@@ -200,7 +191,7 @@ void UIDelegatesManager::addMenuItem(MenuItemHandler *menuItemHandler, const QSt
Q_ASSERT(menuItemHandler);
if (!ensureComponentLoaded(MenuItem))
return;
- QObject *it = menuItemComponent->beginCreate(creationContextForComponent(menuItemComponent));
+ QObject *it = menuItemComponent->beginCreate(qmlContext(m_view));
QQmlProperty(it, QStringLiteral("text")).write(text);
QQmlProperty(it, QStringLiteral("iconName")).write(iconName);
@@ -224,7 +215,7 @@ void UIDelegatesManager::addMenuSeparator(QObject *menu)
if (!ensureComponentLoaded(MenuSeparator))
return;
- QQmlContext *itemContext = creationContextForComponent(menuSeparatorComponent);
+ QQmlContext *itemContext = qmlContext(m_view);
QObject *sep = menuSeparatorComponent->create(itemContext);
sep->setParent(menu);
@@ -238,7 +229,7 @@ QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title,
if (!ensureComponentLoaded(Menu))
return 0;
- QQmlContext *context(creationContextForComponent(menuComponent));
+ QQmlContext *context = qmlContext(m_view);
QObject *menu = menuComponent->beginCreate(context);
// Useful when not using Qt Quick Controls' Menu
if (QQuickItem* item = qobject_cast<QQuickItem*>(menu))
@@ -296,8 +287,12 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
Q_UNREACHABLE();
}
- if (!ensureComponentLoaded(dialogComponentType))
+ if (!ensureComponentLoaded(dialogComponentType)) {
+ // Let the controller know it couldn't be loaded
+ qWarning("Failed to load dialog, rejecting.");
+ dialogController->reject();
return;
+ }
QQmlComponent *dialogComponent = Q_NULLPTR;
switch (dialogComponentType) {
@@ -306,7 +301,7 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
Q_UNREACHABLE();
}
- QQmlContext *context(creationContextForComponent(dialogComponent));
+ QQmlContext *context = qmlContext(m_view);
QObject *dialog = dialogComponent->beginCreate(context);
dialog->setParent(m_view);
QQmlProperty textProp(dialog, QStringLiteral("text"));
@@ -391,7 +386,7 @@ void UIDelegatesManager::showFilePicker(WebContentsAdapterClient::FileChooserMod
if (!ensureComponentLoaded(FilePicker))
return;
- QQmlContext *context(creationContextForComponent(filePickerComponent));
+ QQmlContext *context = qmlContext(m_view);
QObject *filePicker = filePickerComponent->beginCreate(context);
if (QQuickItem* item = qobject_cast<QQuickItem*>(filePicker))
item->setParentItem(m_view);