diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-29 14:09:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-02 12:00:57 +0200 |
commit | 1a49f193afe1ba54339182a49d891917159f6719 (patch) | |
tree | 986cf277193c625c2f61015c7f29c6b403a5eb02 /src/webenginewidgets/api/qwebenginescriptcollection.cpp | |
parent | 47d6b5ce11d1014548ba69df5d7b698381a8343e (diff) | |
parent | fa138d4a76e9e820f01a75771c30dbced8c4e6f3 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/3rdparty
src/core/resources/resources.gyp
src/webengine/doc/src/qtwebengine-overview.qdoc
src/webenginewidgets/api/qwebenginepage.cpp
src/webenginewidgets/api/qwebenginescriptcollection.cpp
src/webenginewidgets/api/qwebenginescriptcollection_p.h
tests/auto/widgets/qwebenginepage/BLACKLIST
And readded newly in 5.6 enabled tests to the BLACKLIST.
Change-Id: I4ab1fc54ebfaaf940df81b0d8d6bdd15cae8b7c4
Diffstat (limited to 'src/webenginewidgets/api/qwebenginescriptcollection.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebenginescriptcollection.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp index a31c26a16..4b77b4699 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp +++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp @@ -167,7 +167,7 @@ QList<QWebEngineScript> QWebEngineScriptCollection::toList() const } -QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *controller, QtWebEngineCore::WebContentsAdapter *webContents) +QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *controller, QSharedPointer<QtWebEngineCore::WebContentsAdapter> webContents) : m_scriptController(controller) , m_contents(webContents) { @@ -175,32 +175,32 @@ QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngine int QWebEngineScriptCollectionPrivate::count() const { - return m_scriptController->registeredScripts(m_contents).count(); + return m_scriptController->registeredScripts(m_contents.data()).count(); } bool QWebEngineScriptCollectionPrivate::contains(const QWebEngineScript &s) const { - return m_scriptController->containsUserScript(*s.d, m_contents); + return m_scriptController->containsUserScript(*s.d, m_contents.data()); } void QWebEngineScriptCollectionPrivate::insert(const QWebEngineScript &script) { if (!script.d) return; - m_scriptController->addUserScript(*script.d, m_contents); + m_scriptController->addUserScript(*script.d, m_contents.data()); } bool QWebEngineScriptCollectionPrivate::remove(const QWebEngineScript &script) { if (!script.d) return false; - return m_scriptController->removeUserScript(*script.d, m_contents); + return m_scriptController->removeUserScript(*script.d, m_contents.data()); } QList<QWebEngineScript> QWebEngineScriptCollectionPrivate::toList(const QString &scriptName) const { QList<QWebEngineScript> ret; - Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents)) + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) if (scriptName.isNull() || scriptName == script.name()) ret.append(QWebEngineScript(script)); return ret; @@ -208,7 +208,7 @@ QList<QWebEngineScript> QWebEngineScriptCollectionPrivate::toList(const QString QWebEngineScript QWebEngineScriptCollectionPrivate::find(const QString &name) const { - Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents)) + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) if (name == script.name()) return QWebEngineScript(script); return QWebEngineScript(); @@ -216,22 +216,22 @@ QWebEngineScript QWebEngineScriptCollectionPrivate::find(const QString &name) co void QWebEngineScriptCollectionPrivate::clear() { - m_scriptController->clearAllScripts(m_contents); + m_scriptController->clearAllScripts(m_contents.data()); } void QWebEngineScriptCollectionPrivate::reserve(int capacity) { - m_scriptController->reserve(m_contents, 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)) { - m_scriptController->addUserScript(script, page); + Q_FOREACH (const UserScript &script, m_scriptController->registeredScripts(m_contents.data())) { + m_scriptController->addUserScript(script, contents.data()); } - m_contents = page; + m_contents = contents; } |