diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-04-15 14:05:08 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-04-19 23:11:09 +0000 |
commit | 7023f228b099c410081db5c697e2d69ed57558da (patch) | |
tree | 783b36e9728099e147fd248a248eaa921fd2da64 /src/webengine/api/qquickwebengineprofile_p.h | |
parent | 1e006305a7f450d6da3e700bcf0bbe70bf8c5105 (diff) |
Switch BrowserContextAdapter to QSharedPointer
BrowserContextAdapter is not a form of shared data, and using
QExplicitSharedDataPointer on it as always been a misuse of the class.
Instead we should switch it to QSharedPointer, which also allows us to
use QWeakPointer.
Change-Id: I8eb489b4a12d3fdddcde55821be294814a156a9d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Diffstat (limited to 'src/webengine/api/qquickwebengineprofile_p.h')
-rw-r--r-- | src/webengine/api/qquickwebengineprofile_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h index 8fb56a616..e405f1319 100644 --- a/src/webengine/api/qquickwebengineprofile_p.h +++ b/src/webengine/api/qquickwebengineprofile_p.h @@ -55,6 +55,7 @@ #include <QExplicitlySharedDataPointer> #include <QMap> #include <QPointer> +#include <QSharedPointer> QT_BEGIN_NAMESPACE @@ -64,10 +65,10 @@ class QQuickWebEngineSettings; class QQuickWebEngineProfilePrivate : public QtWebEngineCore::BrowserContextAdapterClient { public: Q_DECLARE_PUBLIC(QQuickWebEngineProfile) - QQuickWebEngineProfilePrivate(QtWebEngineCore::BrowserContextAdapter* browserContext); + QQuickWebEngineProfilePrivate(QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContext); ~QQuickWebEngineProfilePrivate(); - QtWebEngineCore::BrowserContextAdapter *browserContext() const { return m_browserContextRef.data(); } + QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContext() const { return m_browserContextRef; } QQuickWebEngineSettings *settings() const { return m_settings.data(); } void cancelDownload(quint32 downloadId); @@ -80,7 +81,7 @@ private: friend class QQuickWebEngineViewPrivate; QQuickWebEngineProfile *q_ptr; QScopedPointer<QQuickWebEngineSettings> m_settings; - QExplicitlySharedDataPointer<QtWebEngineCore::BrowserContextAdapter> m_browserContextRef; + QSharedPointer<QtWebEngineCore::BrowserContextAdapter> m_browserContextRef; QMap<quint32, QPointer<QQuickWebEngineDownloadItem> > m_ongoingDownloads; }; |