summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineprofile.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-17 12:51:21 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-17 12:51:21 +0100
commit2c6e6b86ef0a6c63297f9d5daa41c294aaf31a9b (patch)
treea8bcb1c7cb5aaf8194eab09f8bc56b2659f13ea5 /src/webengine/api/qquickwebengineprofile.cpp
parentaa527a2e553bea0514bc088bfc09105703fe87ba (diff)
parent819e00f71e37f5230b9b2c2ff756db4cc4cfda5e (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: .qmake.conf src/webengine/api/qquickwebengineview_p_p.h src/webenginewidgets/api/qwebenginepage_p.h tests/auto/quick/qmltests/data/TestWebEngineView.qml Change-Id: Id2acc92e8d0364bdaaf5a63ea2d2cb9cd533ade3
Diffstat (limited to 'src/webengine/api/qquickwebengineprofile.cpp')
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index f966f2dc6..728f0b4a4 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -142,9 +142,8 @@ ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineC
QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(QSharedPointer<BrowserContextAdapter> browserContext)
: m_settings(new QQuickWebEngineSettings())
- , m_browserContextRef(browserContext)
+ , m_browserContext(new QWebEngineBrowserContext(browserContext, this))
{
- m_browserContextRef->addClient(this);
m_settings->d_ptr->initDefaults();
// Fullscreen API was implemented before the supported setting, so we must
// make it default true to avoid change in default API behavior.
@@ -153,21 +152,26 @@ QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(QSharedPointer<Brow
QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate()
{
- m_browserContextRef->setRequestInterceptor(nullptr);
-
- m_browserContextRef->removeClient(this);
-
- Q_FOREACH (QQuickWebEngineDownloadItem* download, m_ongoingDownloads) {
+ Q_FOREACH (QQuickWebEngineDownloadItem *download, m_ongoingDownloads) {
if (download)
download->cancel();
}
m_ongoingDownloads.clear();
+
+ if (m_browserContext)
+ m_browserContext->shutdown();
+}
+
+QSharedPointer<QtWebEngineCore::BrowserContextAdapter> QQuickWebEngineProfilePrivate::browserContext() const
+{
+ return m_browserContext ? m_browserContext->browserContextRef : nullptr;
}
void QQuickWebEngineProfilePrivate::cancelDownload(quint32 downloadId)
{
- browserContext()->cancelDownload(downloadId);
+ if (m_browserContext)
+ m_browserContext->browserContextRef->cancelDownload(downloadId);
}
void QQuickWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId)