diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-16 13:09:44 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-16 17:01:24 +0100 |
commit | 819e00f71e37f5230b9b2c2ff756db4cc4cfda5e (patch) | |
tree | ed8f247651f06581c462c6cbefde4fa097000946 /src/webenginewidgets/api/qwebengineprofile.cpp | |
parent | 9ed734bfdd7b70f4f7f8e78529ead40031607f99 (diff) | |
parent | 2620f6baa55dc13d65ea0d4b09a23ddfae580279 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/3rdparty
src/core/web_contents_adapter.cpp
src/webengine/api/qquickwebengineprofile.cpp
src/webenginewidgets/api/qwebengineprofile.cpp
tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp
tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
Change-Id: I56c093ebab5ee8b577783ce71761719159cd3ddd
Diffstat (limited to 'src/webenginewidgets/api/qwebengineprofile.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebengineprofile.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 5a6c0e18a..2897d9798 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,30 +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() -{ - if (m_profile) - shutdown(); -} - -void QWebEngineBrowserContext::shutdown() -{ - 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); - m_profile = 0; -} - QWebEngineProfilePrivate::QWebEngineProfilePrivate(QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContext) : m_settings(new QWebEngineSettings()) , m_scriptCollection(new QWebEngineScriptCollection(new QWebEngineScriptCollectionPrivate(browserContext->userResourceController()))) @@ -194,7 +171,7 @@ QWebEngineProfilePrivate::~QWebEngineProfilePrivate() QSharedPointer<QtWebEngineCore::BrowserContextAdapter> QWebEngineProfilePrivate::browserContext() const { - return m_browserContext->browserContextRef; + return m_browserContext ? m_browserContext->browserContextRef : nullptr; } void QWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId) |