summaryrefslogtreecommitdiffstats
path: root/src/core/renderer_host
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-08-26 16:25:00 +0200
committerMichal Klocek <michal.klocek@qt.io>2020-09-28 13:59:08 +0200
commit3bf3d3fe7bcfa7933ecc2ec2f1607f586b2b00d8 (patch)
tree85efe06d6dd9a6afb997b016007376a86c4a2aaf /src/core/renderer_host
parentb598974f9cbde2688a75488d6920e474343c84d2 (diff)
Cleanup qwebenginescript and qwebenginescriptcollection api
This patch cleans up script and collection apis: * do not allocate user_script on heap, there is no need for that. * remove isNull(), which was used by collection.findScript(name) * remove collection.size(), there is already collection.count() * remove collection.findScript(name), user can use findScripts(name) which returns list of scripts or empty list if not found * collection.findScripts(name) is simply collection.find(name) [ChangeLog] Removed QWebEngineScriptCollection::findScript(name), use QWebEngineScriptCollection::find(name) instead. Change-Id: Iecf8f1d7c26275b9ce3a1ea97cf4bd74b17f681e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/renderer_host')
-rw-r--r--src/core/renderer_host/user_resource_controller_host.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/core/renderer_host/user_resource_controller_host.cpp b/src/core/renderer_host/user_resource_controller_host.cpp
index 6b9bb63fe..0c0818ba9 100644
--- a/src/core/renderer_host/user_resource_controller_host.cpp
+++ b/src/core/renderer_host/user_resource_controller_host.cpp
@@ -116,8 +116,6 @@ void UserResourceControllerHost::RenderProcessObserverHelper::RenderProcessHostD
void UserResourceControllerHost::addUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
- if (script.isNull())
- return;
// Global scripts should be dispatched to all our render processes.
const bool isProfileWideScript = !adapter;
if (isProfileWideScript) {
@@ -150,8 +148,6 @@ void UserResourceControllerHost::addUserScript(const UserScript &script, WebCont
bool UserResourceControllerHost::removeUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
- if (script.isNull())
- return false;
const bool isProfileWideScript = !adapter;
if (isProfileWideScript) {
QList<UserScript>::iterator it = std::find(m_profileWideScripts.begin(), m_profileWideScripts.end(), script);