summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2021-11-30 13:01:39 +0100
committerKirill Burtsev <kirill.burtsev@qt.io>2022-01-03 15:15:52 +0100
commit387a5ee0c35364f6b4c9ce3bd3d50f5b825626ca (patch)
tree148e5c30f1a56b49effae0073c804aaf0e34111c /src
parent99e34e9c99453b4990c82468260f431dede4e256 (diff)
Cleanup code and clang build warnings
Fix build noise as reported by clang for issues like api deprecation, unused variables, sign/unsigned mismatch and other non critical issues. Change-Id: I4fba25406eea8170e3283c42e908ae86bd512e3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 02d58a067fb5f0db32c254e783170f9f283aeb9d) Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/api/qwebenginehttprequest.cpp8
-rw-r--r--src/core/api/qwebenginepage.cpp2
-rw-r--r--src/core/compositor/display_gl_output_surface.cpp2
-rw-r--r--src/core/content_browser_client_qt.cpp9
-rw-r--r--src/core/content_client_qt.cpp4
-rw-r--r--src/core/delegated_frame_host_client_qt.h2
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.cpp3
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.h4
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.cpp18
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.h14
-rw-r--r--src/core/render_widget_host_view_qt_delegate_client.cpp6
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp2
-rw-r--r--src/core/renderer/extensions/extensions_renderer_client_qt.cpp1
-rw-r--r--src/core/tools/main.cpp1
-rw-r--r--src/core/web_contents_adapter.cpp2
-rw-r--r--src/core/web_engine_error.cpp2
16 files changed, 18 insertions, 62 deletions
diff --git a/src/core/api/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp
index f5733cde4..d199bff1d 100644
--- a/src/core/api/qwebenginehttprequest.cpp
+++ b/src/core/api/qwebenginehttprequest.cpp
@@ -182,16 +182,16 @@ QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url,
QWebEngineHttpRequest result(url);
result.setMethod(QWebEngineHttpRequest::Post);
- QString buffer;
+ QByteArray buffer;
for (QMap<QString, QString>::const_iterator it = postData.begin(); it != postData.end(); it++) {
QByteArray key = QUrl::toPercentEncoding(it.key());
QByteArray value = QUrl::toPercentEncoding(it.value());
if (buffer.length() > 0)
- buffer += QLatin1Char('&');
- buffer += key + QLatin1Char('=') + value;
+ buffer += '&';
+ buffer.append(key).append('=').append(value);
}
- result.setPostData(buffer.toLatin1());
+ result.setPostData(buffer);
result.setHeader(QByteArrayLiteral("Content-Type"),
QByteArrayLiteral("application/x-www-form-urlencoded"));
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 758bf3905..8e03aea0d 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -456,8 +456,6 @@ void QWebEnginePagePrivate::didFetchDocumentInnerText(quint64 requestId, const Q
void QWebEnginePagePrivate::didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result)
{
#if QT_CONFIG(webengine_printing_and_pdf)
- Q_Q(QWebEnginePage);
-
// If no currentPrinter is set that means that were printing to PDF only.
if (!currentPrinter) {
if (!result.data())
diff --git a/src/core/compositor/display_gl_output_surface.cpp b/src/core/compositor/display_gl_output_surface.cpp
index 68ba957b0..7f27b6ac4 100644
--- a/src/core/compositor/display_gl_output_surface.cpp
+++ b/src/core/compositor/display_gl_output_surface.cpp
@@ -231,7 +231,7 @@ void DisplayGLOutputSurface::swapBuffersOnVizThread()
}
const auto now = base::TimeTicks::Now();
- m_client->DidReceiveSwapBuffersAck(gfx::SwapTimings{now, now}, gfx::GpuFenceHandle());
+ m_client->DidReceiveSwapBuffersAck(gfx::SwapTimings{now, now, {}, {}, {}}, gfx::GpuFenceHandle());
m_client->DidReceivePresentationFeedback(
gfx::PresentationFeedback(now, base::TimeDelta(),
gfx::PresentationFeedback::Flags::kVSync));
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 8f62d727c..2b1485b2d 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -613,9 +613,9 @@ bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::R
content::BrowserContext *browser_context,
const url::Origin & /*origin*/,
const net::IsolationInfo & /*isolation_info*/,
- bool is_service_worker,
- int process_id,
- int routing_id,
+ bool /*is_service_worker*/,
+ int /*process_id*/,
+ int /*routing_id*/,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> *receiver)
{
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> orig_receiver = std::move(*receiver);
@@ -626,7 +626,6 @@ bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::R
ProxyingRestrictedCookieManagerQt::CreateAndBind(
ProfileIODataQt::FromBrowserContext(browser_context),
std::move(target_rcm_remote),
- is_service_worker, process_id, routing_id,
std::move(orig_receiver));
return false; // only made a proxy, still need the actual impl to be made.
@@ -783,7 +782,7 @@ ContentBrowserClientQt::CreateURLLoaderThrottles(
ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context)));
#if BUILDFLAG(ENABLE_EXTENSIONS)
result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>(
- browser_context, request.destination, frame_tree_node_id));
+ request.destination, frame_tree_node_id));
#endif
return result;
}
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 67e2bed4f..90e604e7b 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -136,10 +136,6 @@ static QString getProgramFilesDir(bool x86Dir = false)
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
-namespace switches {
-const char kPpapiWidevinePath[] = "ppapi-widevine-path";
-}
-
static QString ppapiPluginsPath()
{
// Look for plugins in /plugins/ppapi or application dir.
diff --git a/src/core/delegated_frame_host_client_qt.h b/src/core/delegated_frame_host_client_qt.h
index f9bc99d24..89cd3700c 100644
--- a/src/core/delegated_frame_host_client_qt.h
+++ b/src/core/delegated_frame_host_client_qt.h
@@ -40,7 +40,7 @@
#ifndef DELEGATED_FRAME_HOST_CLIENT_QT_H
#define DELEGATED_FRAME_HOST_CLIENT_QT_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
index d66e69ef4..0fc518a9b 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
@@ -68,10 +68,9 @@
namespace QtWebEngineCore {
PluginResponseInterceptorURLLoaderThrottle::PluginResponseInterceptorURLLoaderThrottle(
- content::BrowserContext *browser_context,
network::mojom::RequestDestination request_destination,
int frame_tree_node_id)
- : m_browser_context(browser_context), m_request_destination(request_destination), m_frame_tree_node_id(frame_tree_node_id)
+ : m_request_destination(request_destination), m_frame_tree_node_id(frame_tree_node_id)
{}
void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(const GURL &response_url,
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.h b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
index 0e10b2124..d4ff87846 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.h
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
@@ -54,8 +54,7 @@ namespace QtWebEngineCore {
class PluginResponseInterceptorURLLoaderThrottle : public blink::URLLoaderThrottle
{
public:
- PluginResponseInterceptorURLLoaderThrottle(content::BrowserContext *browser_context,
- network::mojom::RequestDestination request_destination,
+ PluginResponseInterceptorURLLoaderThrottle(network::mojom::RequestDestination request_destination,
int frame_tree_node_id);
~PluginResponseInterceptorURLLoaderThrottle() override = default;
@@ -67,7 +66,6 @@ private:
// layer chance to initialize its browser side state.
void ResumeLoad();
- content::BrowserContext *m_browser_context = nullptr;
const network::mojom::RequestDestination m_request_destination;
const int m_frame_tree_node_id;
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index f86c0e997..f66a4c1a7 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -61,9 +61,6 @@ namespace QtWebEngineCore {
// static
void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -72,7 +69,6 @@ void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIo
base::BindOnce(&ProxyingRestrictedCookieManagerQt::CreateAndBindOnIoThread,
profileIoData,
std::move(underlying_rcm),
- is_service_worker, process_id, frame_id,
std::move(receiver)));
}
@@ -80,31 +76,21 @@ void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIo
// static
void ProxyingRestrictedCookieManagerQt::CreateAndBindOnIoThread(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
auto wrapper = base::WrapUnique(new ProxyingRestrictedCookieManagerQt(
profileIoData->getWeakPtrOnIOThread(),
- std::move(underlying_rcm),
- is_service_worker, process_id, frame_id));
+ std::move(underlying_rcm)));
mojo::MakeSelfOwnedReceiver(std::move(wrapper), std::move(receiver));
}
ProxyingRestrictedCookieManagerQt::ProxyingRestrictedCookieManagerQt(
base::WeakPtr<ProfileIODataQt> profileIoData,
- mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlyingRestrictedCookieManager,
- bool is_service_worker,
- int32_t process_id,
- int32_t frame_id)
+ mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlyingRestrictedCookieManager)
: m_profileIoData(std::move(profileIoData))
, underlying_restricted_cookie_manager_(std::move(underlyingRestrictedCookieManager))
- , is_service_worker_(is_service_worker)
- , process_id_(process_id)
- , frame_id_(frame_id)
, weak_factory_(this)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.h b/src/core/net/proxying_restricted_cookie_manager_qt.h
index 3d4765b3b..37271dfd3 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.h
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.h
@@ -56,9 +56,6 @@ public:
// Expects to be called on the UI thread.
static void CreateAndBind(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver);
~ProxyingRestrictedCookieManagerQt() override;
@@ -98,24 +95,15 @@ public:
private:
ProxyingRestrictedCookieManagerQt(base::WeakPtr<ProfileIODataQt> profileIoData,
- mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int32_t process_id,
- int32_t frame_id);
+ mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm);
static void CreateAndBindOnIoThread(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver);
base::WeakPtr<ProfileIODataQt> m_profileIoData;
mojo::Remote<network::mojom::RestrictedCookieManager> underlying_restricted_cookie_manager_;
- bool is_service_worker_;
- int process_id_;
- int frame_id_;
base::WeakPtrFactory<ProxyingRestrictedCookieManagerQt> weak_factory_;
diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index 1af0b782d..009f2f0ef 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -589,13 +589,13 @@ void RenderWidgetHostViewQtDelegateClient::handleTouchEvent(QTouchEvent *event)
// Check first if the touch event should be routed to the selectionController
if (!touchPoints.isEmpty()) {
switch (touchPoints[0].second.state()) {
- case Qt::TouchPointPressed:
+ case QEventPoint::Pressed:
action = ui::MotionEvent::Action::DOWN;
break;
- case Qt::TouchPointMoved:
+ case QEventPoint::Updated:
action = ui::MotionEvent::Action::MOVE;
break;
- case Qt::TouchPointReleased:
+ case QEventPoint::Released:
action = ui::MotionEvent::Action::UP;
break;
default:
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 474c9e765..e407c4f2c 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -120,8 +120,6 @@
namespace QtWebEngineCore {
-static const char kHttpErrorDomain[] = "http";
-
ContentRendererClientQt::ContentRendererClientQt()
{
#if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
index 4c214c45f..0506be876 100644
--- a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
+++ b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
@@ -71,7 +71,6 @@
namespace chrome {
const char kExtensionInvalidRequestURL[] = "chrome-extension://invalid/";
-const char kExtensionResourceInvalidRequestURL[] = "chrome-extension-resource://invalid/";
}
namespace QtWebEngineCore {
diff --git a/src/core/tools/main.cpp b/src/core/tools/main.cpp
index a23de0f8b..1721f71d3 100644
--- a/src/core/tools/main.cpp
+++ b/src/core/tools/main.cpp
@@ -197,7 +197,6 @@ int main(int argc, char *argv[])
}
#endif // USE_ICU_FILE
- base::AtExitManager exit_manager;
base::i18n::InitializeICU();
base::FilePath file_in_path = toFilePath(argv[1]);
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 9472e7748..6137d2223 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -133,8 +133,6 @@ namespace QtWebEngineCore {
return; \
}
-static const int kTestWindowWidth = 800;
-static const int kTestWindowHeight = 600;
static const int kHistoryStreamVersion = 4;
static QVariant fromJSValue(const base::Value *result)
diff --git a/src/core/web_engine_error.cpp b/src/core/web_engine_error.cpp
index 0d326473b..52a84494c 100644
--- a/src/core/web_engine_error.cpp
+++ b/src/core/web_engine_error.cpp
@@ -44,12 +44,10 @@ const int WebEngineError::UserAbortedError = net::ERR_ABORTED;
namespace {
const int noError = 0;
-const int systemRelatedErrors = -1;
const int connectionRelatedErrors = -100;
const int certificateErrors = -200;
const int httpErrors = -300;
const int cacheErrors = -400;
-const int internalErrors = -500;
const int ftpErrors = -600;
const int certificateManagerErrors = -700;
const int dnsResolverErrors = -800;