summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebengineprofile.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-15 14:05:08 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-19 23:11:09 +0000
commit7023f228b099c410081db5c697e2d69ed57558da (patch)
tree783b36e9728099e147fd248a248eaa921fd2da64 /src/webenginewidgets/api/qwebengineprofile.cpp
parent1e006305a7f450d6da3e700bcf0bbe70bf8c5105 (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/webenginewidgets/api/qwebengineprofile.cpp')
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index aa6101450..535196ed8 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -130,7 +130,7 @@ using QtWebEngineCore::BrowserContextAdapter;
\sa QWebEngineDownloadItem
*/
-QWebEngineProfilePrivate::QWebEngineProfilePrivate(BrowserContextAdapter* browserContext)
+QWebEngineProfilePrivate::QWebEngineProfilePrivate(QSharedPointer<BrowserContextAdapter> browserContext)
: m_settings(new QWebEngineSettings())
, m_scriptCollection(new QWebEngineScriptCollection(new QWebEngineScriptCollectionPrivate(browserContext->userScriptController())))
, m_browserContextRef(browserContext)
@@ -222,7 +222,7 @@ void QWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
*/
QWebEngineProfile::QWebEngineProfile(QObject *parent)
: QObject(parent)
- , d_ptr(new QWebEngineProfilePrivate(new BrowserContextAdapter(true)))
+ , d_ptr(new QWebEngineProfilePrivate(QSharedPointer<BrowserContextAdapter>::create(true)))
{
d_ptr->q_ptr = this;
}
@@ -239,7 +239,7 @@ QWebEngineProfile::QWebEngineProfile(QObject *parent)
*/
QWebEngineProfile::QWebEngineProfile(const QString &storageName, QObject *parent)
: QObject(parent)
- , d_ptr(new QWebEngineProfilePrivate(new BrowserContextAdapter(storageName)))
+ , d_ptr(new QWebEngineProfilePrivate(QSharedPointer<BrowserContextAdapter>::create(storageName)))
{
d_ptr->q_ptr = this;
}