diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-17 12:51:21 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-17 12:51:21 +0100 |
commit | 2c6e6b86ef0a6c63297f9d5daa41c294aaf31a9b (patch) | |
tree | a8bcb1c7cb5aaf8194eab09f8bc56b2659f13ea5 /src/webenginewidgets/api/qwebengineprofile.cpp | |
parent | aa527a2e553bea0514bc088bfc09105703fe87ba (diff) | |
parent | 819e00f71e37f5230b9b2c2ff756db4cc4cfda5e (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/webenginewidgets/api/qwebengineprofile.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebengineprofile.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 02fdfa113..737326c24 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -47,8 +47,9 @@ #include "qwebenginesettings.h" #include "qwebenginescriptcollection_p.h" +#include "qwebenginebrowsercontext_p.h" +#include "qtwebenginecoreglobal.h" #include "browser_context_adapter.h" -#include <qtwebenginecoreglobal.h> #include "visited_links_manager_qt.h" #include "web_engine_settings.h" @@ -145,23 +146,6 @@ using QtWebEngineCore::BrowserContextAdapter; \sa QWebEngineDownloadItem, QWebEnginePage::download() */ -QWebEngineBrowserContext::QWebEngineBrowserContext(QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContext, QWebEngineProfilePrivate *profile) - : QObject(BrowserContextAdapter::globalQObjectRoot()) - , browserContextRef(browserContext) - , m_profile(profile) -{ - browserContextRef->addClient(m_profile); -} - -QWebEngineBrowserContext::~QWebEngineBrowserContext() -{ - Q_ASSERT(m_profile); - // In the case the user sets this profile as the parent of the interceptor - // it can be deleted before the browser-context still referencing it is. - browserContextRef->setRequestInterceptor(nullptr); - browserContextRef->removeClient(m_profile); -} - QWebEngineProfilePrivate::QWebEngineProfilePrivate(QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContext) : m_settings(new QWebEngineSettings()) , m_scriptCollection(new QWebEngineScriptCollection(new QWebEngineScriptCollectionPrivate(browserContext->userResourceController()))) @@ -181,11 +165,13 @@ QWebEngineProfilePrivate::~QWebEngineProfilePrivate() } m_ongoingDownloads.clear(); + if (m_browserContext) + m_browserContext->shutdown(); } QSharedPointer<QtWebEngineCore::BrowserContextAdapter> QWebEngineProfilePrivate::browserContext() const { - return m_browserContext->browserContextRef; + return m_browserContext ? m_browserContext->browserContextRef : nullptr; } void QWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId) |