From 7023f228b099c410081db5c697e2d69ed57558da Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 15 Apr 2016 14:05:08 +0200 Subject: 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 Reviewed-by: Michal Klocek --- src/webengine/api/qquickwebengineprofile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/webengine/api/qquickwebengineprofile.cpp') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index c522ef1ea..c9d8cefed 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -125,7 +125,7 @@ QT_BEGIN_NAMESPACE The \a download argument holds the state of the finished download instance. */ -QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(BrowserContextAdapter* browserContext) +QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(QSharedPointer browserContext) : m_settings(new QQuickWebEngineSettings()) , m_browserContextRef(browserContext) { @@ -242,7 +242,7 @@ void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info */ QQuickWebEngineProfile::QQuickWebEngineProfile(QObject *parent) : QObject(parent), - d_ptr(new QQuickWebEngineProfilePrivate(new BrowserContextAdapter(false))) + d_ptr(new QQuickWebEngineProfilePrivate(QSharedPointer::create(false))) { // Sets up the global WebEngineContext QQuickWebEngineProfile::defaultProfile(); -- cgit v1.2.3 From be2ea540ce3d57c0c55da89c154483983317ddbc Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 20 Apr 2016 11:18:19 +0200 Subject: Remove direct access BrowserContextAdapter's customUrlSchemeHandlers Remove the non-const reference access to customUrlSchemeHandlers, and replace the last remaining use-case with clearCustomUrlSchemeHandlers. Change-Id: If9077e3900593d7f9520fb9bbcef2f1aa3307eac Reviewed-by: Kai Koehne --- src/webengine/api/qquickwebengineprofile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/webengine/api/qquickwebengineprofile.cpp') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index c9d8cefed..2e20d0f7b 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -689,8 +689,7 @@ void QQuickWebEngineProfile::removeUrlScheme(const QByteArray &scheme) void QQuickWebEngineProfile::removeAllUrlSchemeHandlers() { Q_D(QQuickWebEngineProfile); - d->browserContext()->customUrlSchemeHandlers().clear(); - d->browserContext()->updateCustomUrlSchemeHandlers(); + d->browserContext()->clearCustomUrlSchemeHandlers(); } void QQuickWebEngineProfile::destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler *obj) -- cgit v1.2.3