diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-30 17:41:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-07-01 18:31:43 +0000 |
commit | 06864c75f4d009bf8fd4e9f88215bb88341ed873 (patch) | |
tree | ad39aa23e8cc53b3c79a8717ada6aa71371e1a0c /src/webenginewidgets/api/qwebenginepage.cpp | |
parent | ea503a2f07f2505d8d91a7d7999a1fb1b1d6b57c (diff) |
Switch WebContentsAdapter to using shared pointers
QExplicitSharedDataPointer is meant for value objects, not for shared
objects. Instead switch to using QSharedPointer.
Change-Id: Ib3791bbcfde627a67508f2819e141d8c538a4a50
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index b35bb54ec..9685d19f1 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -120,13 +120,13 @@ QWebEnginePage::WebAction editorActionForKeyEvent(QKeyEvent* event) } QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile) - : adapter(new WebContentsAdapter) + : adapter(QSharedPointer<WebContentsAdapter>::create()) , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this))) , profile(_profile ? _profile : QWebEngineProfile::defaultProfile()) , settings(new QWebEngineSettings(profile->settings())) , view(0) , isLoading(false) - , scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userScriptController(), adapter.data())) + , scriptCollection(new QWebEngineScriptCollectionPrivate(browserContextAdapter()->userScriptController(), adapter)) , m_isBeingAdopted(false) , m_backgroundColor(Qt::white) , fullscreenMode(false) @@ -266,7 +266,7 @@ void QWebEnginePagePrivate::unhandledKeyEvent(QKeyEvent *event) QGuiApplication::sendEvent(view->parentWidget(), event); } -void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) +void QWebEnginePagePrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) { Q_Q(QWebEnginePage); Q_UNUSED(userGesture); @@ -451,13 +451,13 @@ void QWebEnginePagePrivate::_q_webActionTriggered(bool checked) void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input) { - QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); + QSharedPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); if (newWebContents) { - adapter = newWebContents.data(); + adapter = std::move(newWebContents); adapter->initialize(this); if (webChannel) adapter->setWebChannel(webChannel); - scriptCollection.d->rebindToContents(adapter.data()); + scriptCollection.d->rebindToContents(adapter); } } |