summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-04 15:41:19 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-04 15:41:19 +0100
commitca08e3ab5dd250581911f2a58185443aed91ee92 (patch)
treec6480688db34f2806b90afe3f696782bfdb34ef9
parentcc2b1d2b66806a67f13996cbb8631d5ea8cdf71a (diff)
parentd366f1d5d37ce6f1833ac67c7ebda540b16690f2 (diff)
Merge remote-tracking branch 'origin/5.14.0' into 5.14
-rw-r--r--dist/changes-5.14.088
-rw-r--r--examples/webengine/lifecycle/WebTab.qml2
-rw-r--r--examples/webengine/lifecycle/WebTabButton.qml2
-rw-r--r--examples/webengine/lifecycle/main.cpp2
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.cpp13
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.h2
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp8
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadwidget.cpp4
-rw-r--r--examples/webenginewidgets/simplebrowser/main.cpp2
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.cpp2
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.h2
-rw-r--r--examples/webenginewidgets/simplebrowser/webpage.cpp12
m---------src/3rdparty0
-rw-r--r--src/buildtools/config/linux.pri1
-rw-r--r--src/core/content_client_qt.cpp14
-rw-r--r--src/core/download_manager_delegate_qt.cpp2
-rw-r--r--src/core/find_text_helper.cpp1
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp2
-rw-r--r--src/core/profile_adapter.cpp7
-rw-r--r--src/core/profile_adapter.h1
-rw-r--r--src/core/profile_adapter_client.h2
-rw-r--r--src/core/render_widget_host_view_qt.cpp14
-rw-r--r--src/core/render_widget_host_view_qt.h5
-rw-r--r--src/core/web_contents_delegate_qt.cpp11
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp6
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p_p.h1
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp1
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp6
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem_p.h1
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp1
-rw-r--r--tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp4
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp31
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp34
33 files changed, 229 insertions, 55 deletions
diff --git a/dist/changes-5.14.0 b/dist/changes-5.14.0
new file mode 100644
index 000000000..b7df882ad
--- /dev/null
+++ b/dist/changes-5.14.0
@@ -0,0 +1,88 @@
+Qt 5.14 introduces many new features and improvements as well as bugfixes
+over the 5.13.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.14 series is binary compatible with the 5.13.x series.
+Applications compiled for 5.13 will continue to run with 5.14.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+Chromium Snapshot
+-----------------
+
+ - Updated the Chromium version to 77.0.3865.129
+ - Applied security fixes from Chrome up to version 78.0.3904.108
+
+General
+-------
+
+ - [QTBUG-71885] Qt WebEngine will now use the Viz Display Compositor by
+ default when multithreaded OpenGL is available. Can be turned off using
+ the command line flag --disable-viz-display-compositor.
+ - [QTBUG-68448] WebRTC devices now have persistent IDs.
+ - [QTBUG-76173] Support qrc protocol in UrlPattern.
+ - [QTBUG-78280] Fixed permissions preventing Flash from showing.
+ - [QTBUG-79319] Fixed loading script as modules over custom schemes.
+ - [QTBUG-80352] Updated paths to look for Chrome's Widevine plugin.
+
+Platforms
+---------
+
+ - [QTBUG-78911] Fixed building with newer system ICU. Minimum is now 64.
+ - [QTBUG-79347] Fixed support for prefers-color-scheme CSS query.
+ - [QTBUG-80055] Re-enabled X11 WebRTC support for desktop sharing.
+ - [QTBUG-77072,QTBUG-78084] Fixed flashing when closing popup on macOS.
+
+
+****************************************************************************
+* Libraries *
+****************************************************************************
+
+QtWebEngineCore
+----------------
+
+ - [QTBUG-75651] Added the QWebEngineUrlScheme::CorsEnabled flag for enabling
+ cross-origin resource sharing with custom schemes.
+
+
+QtWebEngine + QtWebEngineWidgets
+--------------------------------
+
+ - [QTBUG-55079,QTBUG-74166] Added lifecycle API to WebEngineView and
+ QWebEnginePage that can be used to reduce CPU and memory consumption
+ of non-visible views.
+ - [QTBUG-56978] Added functions and property to get the suggested download
+ file name.
+ - [QTBUG-56978] Added functions and property to change the download
+ directory and file name in QWebEngineDownloadItem and
+ QQuickWebEngineDownloadItem and deprecate the path() and setPath().
+ - [QTBUG-74490] Redirects now have a separate navigation type.
+
+
+Qt WebEngine (QML)
+------------------
+
+ - [QTBUG-50420] Introduced findTextFinished signal and FindTextResult
+ type to provide extra information about the result of a text search.
+
+
+Qt WebEngineWidgets
+-------------------
+
+ - QWebEngineCertificateError:
+ * [QTBUG-51176] New method to get the peer's chain of digital certificates.
+ * [QTBUG-55110] New methods for asynchronous decision on certificate error
+ during load.
+ - [QTBUG-78998] Store favicon URL when serializing QWebEngineHistory.
diff --git a/examples/webengine/lifecycle/WebTab.qml b/examples/webengine/lifecycle/WebTab.qml
index 645758104..8649da3cb 100644
--- a/examples/webengine/lifecycle/WebTab.qml
+++ b/examples/webengine/lifecycle/WebTab.qml
@@ -53,7 +53,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12
-import QtWebEngine 1.11
+import QtWebEngine 1.10
ColumnLayout {
id: root
diff --git a/examples/webengine/lifecycle/WebTabButton.qml b/examples/webengine/lifecycle/WebTabButton.qml
index 815e2fb09..68057412b 100644
--- a/examples/webengine/lifecycle/WebTabButton.qml
+++ b/examples/webengine/lifecycle/WebTabButton.qml
@@ -52,7 +52,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12
-import QtWebEngine 1.11
+import QtWebEngine 1.10
TabButton {
id: root
diff --git a/examples/webengine/lifecycle/main.cpp b/examples/webengine/lifecycle/main.cpp
index 83907cbaf..bb93d64a7 100644
--- a/examples/webengine/lifecycle/main.cpp
+++ b/examples/webengine/lifecycle/main.cpp
@@ -58,8 +58,8 @@ int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QGuiApplication app(argc, argv);
QtWebEngine::initialize();
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/WebBrowser.qml")));
return app.exec();
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index c1d0ea359..12a1e6844 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -66,7 +66,9 @@
#include <QStatusBar>
#include <QToolBar>
#include <QVBoxLayout>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#include <QWebEngineFindTextResult>
+#endif
#include <QWebEngineProfile>
BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool forDevTools)
@@ -130,7 +132,9 @@ BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool
connect(m_urlLineEdit, &QLineEdit::returnPressed, [this]() {
m_tabWidget->setUrl(QUrl::fromUserInput(m_urlLineEdit->text()));
});
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
connect(m_tabWidget, &TabWidget::findTextFinished, this, &BrowserWindow::handleFindTextFinished);
+#endif
QAction *focusUrlLineEditAction = new QAction(this);
addAction(focusUrlLineEditAction);
@@ -462,7 +466,14 @@ void BrowserWindow::handleFindActionTriggered()
m_lastSearch, &ok);
if (ok && !search.isEmpty()) {
m_lastSearch = search;
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
currentTab()->findText(m_lastSearch);
+#else
+ currentTab()->findText(m_lastSearch, 0, [this](bool found) {
+ if (!found)
+ statusBar()->showMessage(tr("\"%1\" not found.").arg(m_lastSearch));
+ });
+#endif
}
}
@@ -526,6 +537,7 @@ void BrowserWindow::handleDevToolsRequested(QWebEnginePage *source)
source->triggerAction(QWebEnginePage::InspectElement);
}
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
void BrowserWindow::handleFindTextFinished(const QWebEngineFindTextResult &result)
{
if (result.numberOfMatches() == 0) {
@@ -536,3 +548,4 @@ void BrowserWindow::handleFindTextFinished(const QWebEngineFindTextResult &resul
QString::number(result.numberOfMatches())));
}
}
+#endif
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.h b/examples/webenginewidgets/simplebrowser/browserwindow.h
index 11a655469..ea12ad9df 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.h
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.h
@@ -88,7 +88,9 @@ private slots:
void handleWebViewTitleChanged(const QString &title);
void handleWebActionEnabledChanged(QWebEnginePage::WebAction action, bool enabled);
void handleDevToolsRequested(QWebEnginePage *source);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
void handleFindTextFinished(const QWebEngineFindTextResult &result);
+#endif
private:
QMenu *createFileMenu(TabWidget *tabWidget);
diff --git a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
index b6f9e9c13..2c8831429 100644
--- a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
@@ -69,12 +69,20 @@ void DownloadManagerWidget::downloadRequested(QWebEngineDownloadItem *download)
{
Q_ASSERT(download && download->state() == QWebEngineDownloadItem::DownloadRequested);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QString path = QFileDialog::getSaveFileName(this, tr("Save as"), QDir(download->downloadDirectory()).filePath(download->downloadFileName()));
+#else
+ QString path = QFileDialog::getSaveFileName(this, tr("Save as"), download->path());
+#endif
if (path.isEmpty())
return;
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
download->setDownloadDirectory(QFileInfo(path).path());
download->setDownloadFileName(QFileInfo(path).fileName());
+#else
+ download->setPath(path);
+#endif
download->accept();
add(new DownloadWidget(download));
diff --git a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
index ddddc5e5d..c4e3cd805 100644
--- a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
@@ -61,7 +61,11 @@ DownloadWidget::DownloadWidget(QWebEngineDownloadItem *download, QWidget *parent
{
m_timeAdded.start();
setupUi(this);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
m_dstName->setText(m_download->downloadFileName());
+#else
+ m_dstName->setText(QFileInfo(m_download->path()).fileName());
+#endif
m_srcUrl->setText(m_download->url().toDisplayString());
connect(m_cancelButton, &QPushButton::clicked,
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index 7b77a4bd2..ddc8b4d01 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -75,8 +75,10 @@ int main(int argc, char **argv)
app.setWindowIcon(QIcon(QStringLiteral(":AppLogoColor.png")));
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
QWebEngineProfile::defaultProfile()->setUseForGlobalCertificateVerification();
+#endif
QUrl url = commandLineUrlArgument();
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.cpp b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
index 3b6d84ebe..d7a69e61f 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
@@ -200,10 +200,12 @@ void TabWidget::setupView(WebView *webView)
closeTab(index);
});
connect(webView, &WebView::devToolsRequested, this, &TabWidget::devToolsRequested);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
connect(webPage, &QWebEnginePage::findTextFinished, [this, webView](const QWebEngineFindTextResult &result) {
if (currentIndex() == indexOf(webView))
emit findTextFinished(result);
});
+#endif
}
WebView *TabWidget::createTab()
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.h b/examples/webenginewidgets/simplebrowser/tabwidget.h
index fba61d44f..bf65c9505 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.h
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.h
@@ -78,7 +78,9 @@ signals:
void favIconChanged(const QIcon &icon);
void webActionEnabledChanged(QWebEnginePage::WebAction action, bool enabled);
void devToolsRequested(QWebEnginePage *source);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
void findTextFinished(const QWebEngineFindTextResult &result);
+#endif
public slots:
// current tab/page slots
diff --git a/examples/webenginewidgets/simplebrowser/webpage.cpp b/examples/webenginewidgets/simplebrowser/webpage.cpp
index 2e49f651f..9f7038cdb 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpage.cpp
@@ -76,6 +76,7 @@ bool WebPage::certificateError(const QWebEngineCertificateError &error)
{
QWidget *mainWindow = view()->window();
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QWebEngineCertificateError deferredError = error;
deferredError.defer();
@@ -83,6 +84,9 @@ bool WebPage::certificateError(const QWebEngineCertificateError &error)
if (!error.deferred()) {
QMessageBox::critical(mainWindow, tr("Certificate Error"), error.errorDescription());
} else {
+#else
+ if (error.isOverridable()) {
+#endif
QDialog dialog(mainWindow);
dialog.setModal(true);
dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
@@ -95,6 +99,7 @@ bool WebPage::certificateError(const QWebEngineCertificateError &error)
certificateDialog.m_errorLabel->setText(error.errorDescription());
dialog.setWindowTitle(tr("Certificate Error"));
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
if (dialog.exec() == QDialog::Accepted)
error.ignoreCertificateError();
else
@@ -102,6 +107,13 @@ bool WebPage::certificateError(const QWebEngineCertificateError &error)
}
});
return true;
+#else
+ return dialog.exec() == QDialog::Accepted;
+ }
+
+ QMessageBox::critical(mainWindow, tr("Certificate Error"), error.errorDescription());
+ return false;
+#endif
}
void WebPage::handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth)
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 040ccbbef2dbecdb33041a8c444467a72ad5ea4
+Subproject 939daf833fff3a9901afb6fd65d02e0f057a494
diff --git a/src/buildtools/config/linux.pri b/src/buildtools/config/linux.pri
index f3c4fc953..ee08f81bc 100644
--- a/src/buildtools/config/linux.pri
+++ b/src/buildtools/config/linux.pri
@@ -195,6 +195,7 @@ host_build {
qtConfig(webengine-ozone-x11) {
gn_args += ozone_platform_x11=true
packagesExist(xscrnsaver): gn_args += use_xscrnsaver=true
+ qtConfig(webengine-webrtc): gn_args += rtc_use_x11=true
}
qtConfig(webengine-system-libevent): gn_args += use_system_libevent=true
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 554ee3e12..22f3f548f 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -129,7 +129,8 @@ static QString getLocalAppDataDir()
static const int32_t kPepperFlashPermissions = ppapi::PERMISSION_DEV |
ppapi::PERMISSION_PRIVATE |
ppapi::PERMISSION_BYPASS_USER_GESTURE |
- ppapi::PERMISSION_FLASH;
+ ppapi::PERMISSION_FLASH |
+ ppapi::PERMISSION_SOCKET;
namespace switches {
const char kPpapiFlashPath[] = "ppapi-flash-path";
@@ -286,11 +287,11 @@ static bool IsWidevineAvailable(base::FilePath *cdm_path,
pluginPaths << ppapiPluginsPath() + QStringLiteral("/") + QString::fromLatin1(kWidevineCdmFileName);
#endif
#if defined(Q_OS_OSX)
- QDir potentialWidevineDir("/Applications/Google Chrome.app/Contents/Versions");
+ QDir potentialWidevineDir("/Applications/Google Chrome.app/Contents/Frameworks");
if (potentialWidevineDir.exists()) {
QFileInfoList widevineVersionDirs = potentialWidevineDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot,
QDir::Name | QDir::Reversed);
- const QString library = QLatin1String("/Google Chrome Framework.framework/Versions/A/Libraries/"
+ const QString library = QLatin1String("/Versions/Current/Libraries/"
"WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib");
for (const QFileInfo &info : widevineVersionDirs)
pluginPaths << info.absoluteFilePath() + library;
@@ -320,7 +321,12 @@ static bool IsWidevineAvailable(base::FilePath *cdm_path,
}
}
#elif defined(Q_OS_LINUX)
- pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdm.so") // Google Chrome
+ pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdm.so") // Old Google Chrome
+#if Q_PROCESSOR_WORDSIZE == 8
+ << QStringLiteral("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")
+#else
+ << QStringLiteral("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x86/libwidevinecdm.so")
+#endif
<< QStringLiteral("/usr/lib/chromium/libwidevinecdm.so") // Arch
<< QStringLiteral("/usr/lib/chromium-browser/libwidevinecdm.so") // Ubuntu/neon
<< QStringLiteral("/usr/lib64/chromium/libwidevinecdm.so"); // OpenSUSE style
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 34e290317..7049b8273 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -298,7 +298,7 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
ProfileAdapterClient::NoReason,
adapterClient,
QFileInfo(suggestedFilePath).fileName(),
- time_t(QDateTime::currentMSecsSinceEpoch())
+ QDateTime::currentMSecsSinceEpoch()
};
for (ProfileAdapterClient *client : qAsConst(clients)) {
diff --git a/src/core/find_text_helper.cpp b/src/core/find_text_helper.cpp
index 065fed38f..da9d7f352 100644
--- a/src/core/find_text_helper.cpp
+++ b/src/core/find_text_helper.cpp
@@ -108,6 +108,7 @@ void FindTextHelper::startFinding(const QString &findText, bool caseSensitively,
// waiting for it forever.
// Assume that any unfinished find has been unsuccessful when a new one is started
// to cover that case.
+ m_lastCompletedFindRequestId = m_currentFindRequestId;
m_viewClient->findTextFinished(QWebEngineFindTextResult());
invokeResultCallback(m_currentFindRequestId, 0);
}
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index c94ff7eee..7bf499917 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -126,7 +126,7 @@ content::DesktopMediaID getDefaultScreenId()
//
// [1]: webrtc::InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread
-#if QT_CONFIG(webengine_webrtc) && !defined(USE_X11)
+#if QT_CONFIG(webengine_webrtc) && !defined(WEBRTC_USE_X11)
// Source id patterns are different across platforms.
// On Linux, the hardcoded value "0" is used.
// On Windows, the screens are enumerated consecutively in increasing order from 0.
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index d421edf00..bccdf1ada 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -715,13 +715,6 @@ QString ProfileAdapter::determineDownloadPath(const QString &downloadDirectory,
return suggestedFilePath;
}
-QString ProfileAdapter::updateDownloadPath(int downloadId, const QString &directory, const QString &fileName)
-{
- download::DownloadItem *download = m_downloadManagerDelegate->findDownloadById(downloadId);
- Q_ASSERT(download);
- return determineDownloadPath(directory, fileName, download->GetStartTime().ToTimeT());
-}
-
#if QT_CONFIG(ssl)
QWebEngineClientCertificateStore *ProfileAdapter::clientCertificateStore()
{
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index 01477d0d9..1b89a8004 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -214,7 +214,6 @@ public:
{ return m_persistentNotifications; }
QString determineDownloadPath(const QString &downloadDirectory, const QString &suggestedFilename, const time_t &startTime);
- QString updateDownloadPath(int downloadId, const QString &directory, const QString &filename);
private:
void updateCustomUrlSchemeHandlers();
diff --git a/src/core/profile_adapter_client.h b/src/core/profile_adapter_client.h
index dc0f508a1..394f92270 100644
--- a/src/core/profile_adapter_client.h
+++ b/src/core/profile_adapter_client.h
@@ -140,7 +140,7 @@ public:
int downloadInterruptReason;
WebContentsAdapterClient *page;
QString suggestedFileName;
- time_t startTime;
+ qint64 startTime;
};
virtual ~ProfileAdapterClient() { }
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index e2fd074ae..15cc5174e 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -340,7 +340,6 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget
// May call SetNeedsBeginFrames
host()->SetView(this);
- host()->GetProcess()->AddObserver(this);
}
RenderWidgetHostViewQt::~RenderWidgetHostViewQt()
@@ -354,7 +353,6 @@ RenderWidgetHostViewQt::~RenderWidgetHostViewQt()
if (text_input_manager_)
text_input_manager_->RemoveObserver(this);
- host()->GetProcess()->RemoveObserver(this);
m_touchSelectionController.reset();
m_touchSelectionControllerClient.reset();
@@ -704,18 +702,6 @@ void RenderWidgetHostViewQt::ImeCompositionRangeChanged(const gfx::Range&, const
QT_NOT_YET_IMPLEMENTED
}
-void RenderWidgetHostViewQt::RenderProcessExited(content::RenderProcessHost *host,
- const content::ChildProcessTerminationInfo &info)
-{
- Q_UNUSED(host);
- // RenderProcessHost::FastShutdownIfPossible results in TERMINATION_STATUS_STILL_RUNNING
- if (m_adapterClient && info.status != base::TERMINATION_STATUS_STILL_RUNNING) {
- m_adapterClient->renderProcessTerminated(
- m_adapterClient->renderProcessExitStatus(info.status),
- info.exit_code);
- }
-}
-
void RenderWidgetHostViewQt::RenderProcessGone()
{
Destroy();
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 76807b37a..0e9d54b19 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -102,7 +102,6 @@ struct MultipleMouseClickHelper
class RenderWidgetHostViewQt
: public content::RenderWidgetHostViewBase
- , public content::RenderProcessHostObserver
, public ui::GestureProviderClient
, public RenderWidgetHostViewQtDelegateClient
, public base::SupportsWeakPtr<RenderWidgetHostViewQt>
@@ -176,10 +175,6 @@ public:
void DidStopFlinging() override;
std::unique_ptr<content::SyntheticGestureTarget> CreateSyntheticGestureTarget() override;
- // RenderProcessHostObserver implementation.
- void RenderProcessExited(content::RenderProcessHost *host,
- const content::ChildProcessTerminationInfo &info) override;
-
// Overridden from ui::GestureProviderClient.
void OnGestureEvent(const ui::GestureEventData& gesture) override;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 255ff0034..2a89556cf 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -286,10 +286,17 @@ void WebContentsDelegateQt::RenderFrameDeleted(content::RenderFrameHost *render_
void WebContentsDelegateQt::RenderProcessGone(base::TerminationStatus status)
{
+ // RenderProcessHost::FastShutdownIfPossible results in TERMINATION_STATUS_STILL_RUNNING
+ if (status != base::TERMINATION_STATUS_STILL_RUNNING) {
+ m_viewClient->renderProcessTerminated(
+ m_viewClient->renderProcessExitStatus(status),
+ web_contents()->GetCrashedErrorCode());
+ }
+
// Based one TabLoadTracker::RenderProcessGone
- if (status == base::TerminationStatus::TERMINATION_STATUS_NORMAL_TERMINATION
- || status == base::TerminationStatus::TERMINATION_STATUS_STILL_RUNNING) {
+ if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION
+ || status == base::TERMINATION_STATUS_STILL_RUNNING) {
return;
}
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index 878dddadb..6abd89910 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -521,9 +521,9 @@ void QQuickWebEngineDownloadItem::setDownloadDirectory(const QString &directory)
Q_EMIT downloadDirectoryChanged();
}
- QString newFileName = QFileInfo(d->profile->d_ptr->profileAdapter()->updateDownloadPath(d->downloadId,
- d->downloadDirectory,
- d->suggestedFileName)).fileName();
+ QString newFileName = QFileInfo(d->profile->d_ptr->profileAdapter()->determineDownloadPath(d->downloadDirectory,
+ d->suggestedFileName,
+ d->startTime)).fileName();
if (d->downloadFileName != newFileName) {
d->downloadFileName = newFileName;
Q_EMIT pathChanged();
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p_p.h b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
index 51deee18b..1be6434ec 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
@@ -71,6 +71,7 @@ public:
~QQuickWebEngineDownloadItemPrivate();
quint32 downloadId;
+ qint64 startTime;
QQuickWebEngineDownloadItem::DownloadState downloadState;
QQuickWebEngineDownloadItem::SavePageFormat savePageFormat;
QQuickWebEngineDownloadItem::DownloadType type;
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index edad7ec44..834bb6a05 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -245,6 +245,7 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QQuickWebEngineDownloadItemPrivate *itemPrivate = new QQuickWebEngineDownloadItemPrivate(q, info.url);
itemPrivate->downloadId = info.id;
itemPrivate->downloadState = QQuickWebEngineDownloadItem::DownloadRequested;
+ itemPrivate->startTime = info.startTime;
itemPrivate->totalBytes = info.totalBytes;
itemPrivate->mimeType = info.mimeType;
itemPrivate->downloadDirectory = QFileInfo(info.path).path();
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index 724249208..fd7d90704 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -599,9 +599,9 @@ void QWebEngineDownloadItem::setDownloadDirectory(const QString &directory)
if (!directory.isEmpty() && d->downloadDirectory != directory)
d->downloadDirectory = directory;
- d->downloadFileName = QFileInfo(d->profile->profileAdapter()->updateDownloadPath(d->downloadId,
- d->downloadDirectory,
- d->suggestedFileName)).fileName();
+ d->downloadFileName = QFileInfo(d->profile->profileAdapter()->determineDownloadPath(d->downloadDirectory,
+ d->suggestedFileName,
+ d->startTime)).fileName();
}
/*!
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem_p.h b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
index 08e478736..034684a00 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem_p.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
@@ -70,6 +70,7 @@ public:
bool downloadFinished;
quint32 downloadId;
+ qint64 startTime;
QWebEngineDownloadItem::DownloadState downloadState;
QWebEngineDownloadItem::SavePageFormat savePageFormat;
QWebEngineDownloadItem::DownloadType type;
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 09f5ce2fd..470babf8f 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -227,6 +227,7 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
itemPrivate->downloadId = info.id;
itemPrivate->downloadState = info.accepted ? QWebEngineDownloadItem::DownloadInProgress
: QWebEngineDownloadItem::DownloadRequested;
+ itemPrivate->startTime = info.startTime;
itemPrivate->downloadDirectory = QFileInfo(info.path).path();
itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
itemPrivate->suggestedFileName = info.suggestedFileName;
diff --git a/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp b/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp
index 1469ddb15..46038cdc6 100644
--- a/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp
+++ b/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp
@@ -522,10 +522,10 @@ void tst_FaviconManager::touchIconWithSameURL()
"<link rel='icon' type='image/png' href='" + icon + "'/>"
"<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>"
"</html>");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
// The default favicon has to be loaded even if its URL is also set as a touch icon while touch icons are disabled.
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
QCOMPARE(m_page->iconUrl().toString(), icon);
QTRY_COMPARE(iconChangedSpy.count(), 1);
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
index d34e3cefe..bbcef2226 100644
--- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
+++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
@@ -622,14 +622,17 @@ void tst_QWebEngineDownloadItem::downloadTwoLinks()
void tst_QWebEngineDownloadItem::downloadPage_data()
{
+ QTest::addColumn<bool>("saveWithPageAction");
QTest::addColumn<QWebEngineDownloadItem::SavePageFormat>("savePageFormat");
- QTest::newRow("SingleHtmlSaveFormat") << QWebEngineDownloadItem::SingleHtmlSaveFormat;
- QTest::newRow("CompleteHtmlSaveFormat") << QWebEngineDownloadItem::CompleteHtmlSaveFormat;
- QTest::newRow("MimeHtmlSaveFormat") << QWebEngineDownloadItem::MimeHtmlSaveFormat;
+ QTest::newRow("SingleHtmlSaveFormat") << false << QWebEngineDownloadItem::SingleHtmlSaveFormat;
+ QTest::newRow("CompleteHtmlSaveFormat") << false << QWebEngineDownloadItem::CompleteHtmlSaveFormat;
+ QTest::newRow("MimeHtmlSaveFormat") << false << QWebEngineDownloadItem::MimeHtmlSaveFormat;
+ QTest::newRow("SavePageAction") << true << QWebEngineDownloadItem::MimeHtmlSaveFormat;
}
void tst_QWebEngineDownloadItem::downloadPage()
{
+ QFETCH(bool, saveWithPageAction);
QFETCH(QWebEngineDownloadItem::SavePageFormat, savePageFormat);
// Set up HTTP server
@@ -649,12 +652,12 @@ void tst_QWebEngineDownloadItem::downloadPage()
// Set up profile and download handler
QTemporaryDir tmpDir;
QVERIFY(tmpDir.isValid());
- QString downloadPath = tmpDir.path() + QStringLiteral("/test.html");
+ QString downloadFileName("test.html"), downloadPath = tmpDir.filePath(downloadFileName);
QUrl downloadUrl = m_server->url("/");
int acceptedCount = 0;
int finishedCount = 0;
ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadInProgress);
+ QCOMPARE(item->state(), saveWithPageAction ? QWebEngineDownloadItem::DownloadRequested : QWebEngineDownloadItem::DownloadInProgress);
QCOMPARE(item->isFinished(), false);
QCOMPARE(item->totalBytes(), -1);
QCOMPARE(item->receivedBytes(), 0);
@@ -663,11 +666,19 @@ void tst_QWebEngineDownloadItem::downloadPage()
QCOMPARE(item->isSavePageDownload(), true);
// FIXME(juvaldma): why is mimeType always the same?
QCOMPARE(item->mimeType(), QStringLiteral("application/x-mimearchive"));
- QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
QCOMPARE(item->savePageFormat(), savePageFormat);
QCOMPARE(item->url(), downloadUrl);
QCOMPARE(item->page(), m_page);
- // no need to call item->accept()
+
+ if (saveWithPageAction) {
+ QVERIFY(!item->downloadDirectory().isEmpty());
+ QVERIFY(!item->downloadFileName().isEmpty());
+ item->setDownloadDirectory(tmpDir.path());
+ item->setDownloadFileName(downloadFileName);
+ item->accept();
+ } // save with explicit path accepts download automatically
+
+ QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
@@ -697,7 +708,11 @@ void tst_QWebEngineDownloadItem::downloadPage()
QCOMPARE(indexRequestCount, 1);
// Save some HTML
- m_page->save(downloadPath, savePageFormat);
+ if (saveWithPageAction)
+ m_page->triggerAction(QWebEnginePage::SavePage);
+ else
+ m_page->save(downloadPath, savePageFormat);
+
QTRY_COMPARE(acceptedCount, 1);
QTRY_COMPARE(finishedCount, 1);
QFile file(downloadPath);
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 27aa7a1f7..d8c1a5360 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -225,6 +225,7 @@ private Q_SLOTS:
void editActionsWithoutSelection();
void customUserAgentInNewTab();
+ void renderProcessCrashed();
private:
static QPoint elementCenter(QWebEnginePage *page, const QString &id);
@@ -991,6 +992,19 @@ void tst_QWebEnginePage::findText()
QTRY_COMPARE(signalSpy.count(), 1);
QTRY_COMPARE(m_view->selectedText(), QString("foo"));
}
+
+ // Invoking startFinding operation for the same text twice. Without any wait, the second one
+ // should interrupt the first one.
+ {
+ QSignalSpy signalSpy(m_view->page(), &QWebEnginePage::findTextFinished);
+ m_view->findText("foo", 0);
+ m_view->findText("foo", 0);
+ QTRY_COMPARE(signalSpy.count(), 2);
+ QTRY_VERIFY(m_view->selectedText().isEmpty());
+
+ QCOMPARE(signalSpy.at(0).value(0).value<QWebEngineFindTextResult>().numberOfMatches(), 0);
+ QCOMPARE(signalSpy.at(1).value(0).value<QWebEngineFindTextResult>().numberOfMatches(), 1);
+ }
}
void tst_QWebEnginePage::findTextResult()
@@ -4410,6 +4424,26 @@ void tst_QWebEnginePage::customUserAgentInNewTab()
QCOMPARE(lastUserAgent, profile2.httpUserAgent().toUtf8());
}
+void tst_QWebEnginePage::renderProcessCrashed()
+{
+ using Status = QWebEnginePage::RenderProcessTerminationStatus;
+ QWebEngineProfile profile;
+ QWebEnginePage page(&profile);
+ bool done = false;
+ Status status;
+ connect(&page, &QWebEnginePage::renderProcessTerminated, [&](Status newStatus) {
+ status = newStatus;
+ done = true;
+ });
+ page.load(QUrl("chrome://crash"));
+ QTRY_VERIFY_WITH_TIMEOUT(done, 20000);
+ // The status depends on whether stack traces are enabled. With
+ // --disable-in-process-stack-traces we get an AbnormalTerminationStatus,
+ // otherwise a CrashedTerminationStatus.
+ QVERIFY(status == QWebEnginePage::CrashedTerminationStatus ||
+ status == QWebEnginePage::AbnormalTerminationStatus);
+}
+
static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
W_QTEST_MAIN(tst_QWebEnginePage, params)