summaryrefslogtreecommitdiff
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-01-11 11:24:48 +0100
committerMichal Klocek <michal.klocek@qt.io>2018-05-18 10:49:44 +0000
commitcfddf26f78e521809a17d4fab5bb7cfe18d3f08e (patch)
tree5da7f2d15afd944f6b0bcdfab4e798063f2e582f /src/webengine/api/qquickwebengineview.cpp
parent7d6f72463ef372aabf4c4e6f212b9d331ef1338a (diff)
downloadqtwebengine-cfddf26f78e521809a17d4fab5bb7cfe18d3f08e.tar.gz
Change BrowserContextAdapter to be QPointer
BrowserContextAdapter is living and accessed only in UI thread, remove QSharedPointer usage and change QWebengineProfile to use QPointer. Prevent BrowserContextAdapter outliving WebEngineContext by setting globalObject as a parent to track WebEngineContext destruction. This commits tries to simplify the life cycle handling of browser context, it removes profile shutdown methods and QWebEngineBrowserContext, which was used to track profile destruction. Task-number: QTBUG-62147 Change-Id: I79f2c38a123cd053e3a59f4900afbdc759a396fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 3d873c49f..97a0adef3 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -103,9 +103,9 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje
#endif // QT_NO_ACCESSIBILITY
QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
- : adapter(QSharedPointer<WebContentsAdapter>::create())
+ : m_profile(QQuickWebEngineProfile::defaultProfile())
+ , adapter(QSharedPointer<WebContentsAdapter>::create())
, m_history(new QQuickWebEngineHistory(this))
- , m_profile(QQuickWebEngineProfile::defaultProfile())
, m_settings(new QQuickWebEngineSettings(m_profile->settings()))
#ifdef ENABLE_QML_TESTSUPPORT_API
, m_testSupport(0)
@@ -621,7 +621,7 @@ QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
return q;
}
-QSharedPointer<BrowserContextAdapter> QQuickWebEngineViewPrivate::browserContextAdapter()
+BrowserContextAdapter *QQuickWebEngineViewPrivate::browserContextAdapter()
{
return m_profile->d_ptr->browserContext();
}