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/qwebenginescriptcollection.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/qwebenginescriptcollection.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebenginescriptcollection.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp index 8d581b60a..1ba16db9d 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp +++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp @@ -164,7 +164,7 @@ QList<QWebEngineScript> QWebEngineScriptCollection::toList() const } -QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *controller, QtWebEngineCore::WebContentsAdapter *webContents) +QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserScriptControllerHost *controller, QSharedPointer<QtWebEngineCore::WebContentsAdapter> webContents) : m_scriptController(controller) , m_contents(webContents) { @@ -221,14 +221,14 @@ void QWebEngineScriptCollectionPrivate::reserve(int capacity) m_scriptController->reserve(m_contents.data(), capacity); } -void QWebEngineScriptCollectionPrivate::rebindToContents(QtWebEngineCore::WebContentsAdapter *page) +void QWebEngineScriptCollectionPrivate::rebindToContents(QSharedPointer<QtWebEngineCore::WebContentsAdapter> contents) { Q_ASSERT(m_contents); - Q_ASSERT(page); - Q_ASSERT(m_contents != page); + Q_ASSERT(contents); + Q_ASSERT(m_contents != contents); Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) { - m_scriptController->addUserScript(script, page); + m_scriptController->addUserScript(script, contents.data()); } - m_contents = page; + m_contents = contents; } |