summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-29 12:57:29 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-07-15 14:49:31 +0200
commit603a1809481eb4d4ca972f0f64915d29fb99f53b (patch)
tree09989c621f2db8a0dba0d9e05c421268e6d1552b /src/core
parent561d82242f67bb9b0520bfa04f05623f359171e2 (diff)
Use QList instead of QVector
Task-number: QTBUG-84469 Change-Id: I666a060351f73783e15e3f96884c9393a5cd7e46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/api/qwebengineclientcertificatestore.cpp4
-rw-r--r--src/core/api/qwebengineclientcertificatestore.h4
-rw-r--r--src/core/api/qwebenginecookiestore_p.h4
-rw-r--r--src/core/api/qwebenginehttprequest.cpp10
-rw-r--r--src/core/api/qwebenginehttprequest.h6
-rw-r--r--src/core/client_cert_select_controller.cpp2
-rw-r--r--src/core/client_cert_select_controller.h6
-rw-r--r--src/core/net/client_cert_store_data.h4
-rw-r--r--src/core/profile_adapter.h3
-rw-r--r--src/core/web_contents_adapter.cpp4
-rw-r--r--src/core/web_contents_delegate_qt.h6
-rw-r--r--src/core/web_engine_context.cpp1
-rw-r--r--src/core/web_engine_context.h4
13 files changed, 28 insertions, 30 deletions
diff --git a/src/core/api/qwebengineclientcertificatestore.cpp b/src/core/api/qwebengineclientcertificatestore.cpp
index 84f273328..462a63b26 100644
--- a/src/core/api/qwebengineclientcertificatestore.cpp
+++ b/src/core/api/qwebengineclientcertificatestore.cpp
@@ -88,9 +88,9 @@ void QWebEngineClientCertificateStore::add(const QSslCertificate &certificate, c
Returns an empty list if the store does not contain any certificates.
*/
-QVector<QSslCertificate> QWebEngineClientCertificateStore::certificates() const
+QList<QSslCertificate> QWebEngineClientCertificateStore::certificates() const
{
- QVector<QSslCertificate> certificateList;
+ QList<QSslCertificate> certificateList;
for (auto data : qAsConst(m_storeData->extraCerts))
certificateList.append(data->certificate);
return certificateList;
diff --git a/src/core/api/qwebengineclientcertificatestore.h b/src/core/api/qwebengineclientcertificatestore.h
index a4c83bb2e..31a6b9c38 100644
--- a/src/core/api/qwebengineclientcertificatestore.h
+++ b/src/core/api/qwebengineclientcertificatestore.h
@@ -42,7 +42,7 @@
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslkey.h>
@@ -59,7 +59,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateStore {
public:
void add(const QSslCertificate &certificate, const QSslKey &privateKey);
- QVector<QSslCertificate> certificates() const;
+ QList<QSslCertificate> certificates() const;
void remove(const QSslCertificate &certificate);
void clear();
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index a79e2b095..e6fa245c2 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -56,7 +56,7 @@
#include "qwebenginecallback_p.h"
#include "qwebenginecookiestore.h"
-#include <QVector>
+#include <QList>
#include <QNetworkCookie>
#include <QUrl>
@@ -79,7 +79,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
public:
QtWebEngineCore::CallbackDirectory callbackDirectory;
std::function<bool(const QWebEngineCookieStore::FilterRequest &)> filterCallback;
- QVector<CookieData> m_pendingUserCookies;
+ QList<CookieData> m_pendingUserCookies;
quint64 m_nextCallbackId;
bool m_deleteSessionCookiesPending;
bool m_deleteAllCookiesPending;
diff --git a/src/core/api/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp
index 3395cc99f..f5733cde4 100644
--- a/src/core/api/qwebenginehttprequest.cpp
+++ b/src/core/api/qwebenginehttprequest.cpp
@@ -72,7 +72,7 @@ public:
QUrl url;
QWebEngineHttpRequest::Method method;
typedef QPair<QByteArray, QByteArray> HeaderPair;
- typedef QVector<HeaderPair> Headers;
+ typedef QList<HeaderPair> Headers;
Headers headers;
QByteArray postData;
@@ -96,7 +96,7 @@ public:
Headers::ConstIterator findHeader(const QByteArray &key) const;
Headers allHeaders() const;
- QVector<QByteArray> headersKeys() const;
+ QList<QByteArray> headersKeys() const;
void setHeader(const QByteArray &key, const QByteArray &value);
void unsetHeader(const QByteArray &key);
void setAllHeaders(const Headers &list);
@@ -293,7 +293,7 @@ QByteArray QWebEngineHttpRequest::header(const QByteArray &headerName) const
\sa setHeader(), header(), hasHeader(), unsetHeader()
*/
-QVector<QByteArray> QWebEngineHttpRequest::headers() const
+QList<QByteArray> QWebEngineHttpRequest::headers() const
{
return d->headersKeys();
}
@@ -339,9 +339,9 @@ QWebEngineHttpRequestPrivate::Headers QWebEngineHttpRequestPrivate::allHeaders()
return headers;
}
-QVector<QByteArray> QWebEngineHttpRequestPrivate::headersKeys() const
+QList<QByteArray> QWebEngineHttpRequestPrivate::headersKeys() const
{
- QVector<QByteArray> result;
+ QList<QByteArray> result;
result.reserve(headers.size());
Headers::ConstIterator it = headers.constBegin(), end = headers.constEnd();
for (; it != end; ++it)
diff --git a/src/core/api/qwebenginehttprequest.h b/src/core/api/qwebenginehttprequest.h
index 1c4d7837b..ce77c04dd 100644
--- a/src/core/api/qwebenginehttprequest.h
+++ b/src/core/api/qwebenginehttprequest.h
@@ -41,9 +41,9 @@
#define QWEBENGINEHTTPREQUEST_H
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/qshareddata.h>
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtCore/qmap.h>
+#include <QtCore/qshareddata.h>
#include <QtCore/qstring.h>
#include <QtCore/qurl.h>
@@ -87,7 +87,7 @@ public:
void setPostData(const QByteArray &postData);
bool hasHeader(const QByteArray &headerName) const;
- QVector<QByteArray> headers() const;
+ QList<QByteArray> headers() const;
QByteArray header(const QByteArray &headerName) const;
void setHeader(const QByteArray &headerName, const QByteArray &value);
void unsetHeader(const QByteArray &headerName);
diff --git a/src/core/client_cert_select_controller.cpp b/src/core/client_cert_select_controller.cpp
index 0baaf2bc5..0bfdba851 100644
--- a/src/core/client_cert_select_controller.cpp
+++ b/src/core/client_cert_select_controller.cpp
@@ -132,7 +132,7 @@ void ClientCertSelectController::select(const QSslCertificate &certificate)
<< " Selected certificate needs to be one of the offered";
}
-QVector<QSslCertificate> ClientCertSelectController::certificates() const
+QList<QSslCertificate> ClientCertSelectController::certificates() const
{
if (!m_certificates.isEmpty())
return m_certificates;
diff --git a/src/core/client_cert_select_controller.h b/src/core/client_cert_select_controller.h
index f121c1155..59157f7cc 100644
--- a/src/core/client_cert_select_controller.h
+++ b/src/core/client_cert_select_controller.h
@@ -56,7 +56,7 @@
#include <QtCore/QUrl>
#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-#include <QtCore/QVector>
+#include <QtCore/QList>
#include <QtNetwork/QSslCertificate>
#endif
#include <memory>
@@ -85,14 +85,14 @@ public:
void select(const QSslCertificate &certificate);
void select(int index);
- QVector<QSslCertificate> certificates() const;
+ QList<QSslCertificate> certificates() const;
#endif
private:
QUrl m_hostAndPort;
std::vector<std::unique_ptr<net::ClientCertIdentity>> m_clientCerts;
std::unique_ptr<content::ClientCertificateDelegate> m_delegate;
- mutable QVector<QSslCertificate> m_certificates;
+ mutable QList<QSslCertificate> m_certificates;
bool m_selected;
};
diff --git a/src/core/net/client_cert_store_data.h b/src/core/net/client_cert_store_data.h
index e47a909e4..4976ac936 100644
--- a/src/core/net/client_cert_store_data.h
+++ b/src/core/net/client_cert_store_data.h
@@ -46,7 +46,7 @@
#if QT_CONFIG(ssl)
#include "base/memory/ref_counted.h"
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslkey.h>
@@ -71,7 +71,7 @@ struct ClientCertificateStoreData
void remove(const QSslCertificate &certificate);
void clear();
- QVector<Entry *> extraCerts;
+ QList<Entry *> extraCerts;
};
} // namespace QtWebEngineCore
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index efd56e50e..f59768004 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -58,7 +58,6 @@
#include <QPointer>
#include <QScopedPointer>
#include <QString>
-#include <QVector>
#include "api/qwebengineclientcertificatestore.h"
#include "api/qwebenginecookiestore.h"
@@ -247,7 +246,7 @@ private:
QHash<QByteArray, QSharedPointer<UserNotificationController>> m_persistentNotifications;
QList<ProfileAdapterClient*> m_clients;
- QVector<WebContentsAdapterClient *> m_webContentsAdapterClients;
+ QList<WebContentsAdapterClient *> m_webContentsAdapterClients;
int m_httpCacheMaxSize;
QrcUrlSchemeHandler m_qrcHandler;
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index e88c80bc8..389f53002 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -715,8 +715,8 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
}
// convert the custom headers into the format that chromium expects
- QVector<QByteArray> headers = request.headers();
- for (QVector<QByteArray>::const_iterator it = headers.cbegin(); it != headers.cend(); ++it) {
+ QList<QByteArray> headers = request.headers();
+ for (QList<QByteArray>::const_iterator it = headers.cbegin(); it != headers.cend(); ++it) {
if (params.extra_headers.length() > 0)
params.extra_headers += '\n';
params.extra_headers += (*it).toStdString() + ": " + request.header(*it).toStdString();
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index bfef9a1df..861310e9b 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -53,7 +53,7 @@
#include "find_text_helper.h"
#include "javascript_dialog_manager_qt.h"
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
QT_FORWARD_DECLARE_CLASS(CertificateErrorController)
QT_FORWARD_DECLARE_CLASS(ClientCertSelectController)
@@ -87,7 +87,7 @@ protected:
private:
WebContentsAdapterClient *m_viewClient;
- QVector<content::FrameTreeNode *> m_observedNodes;
+ QList<content::FrameTreeNode *> m_observedNodes;
};
class SavePageInfo
@@ -215,7 +215,7 @@ private:
int &streamCount(blink::mojom::MediaStreamType type);
WebContentsAdapterClient *m_viewClient;
- QVector<int64_t> m_loadingErrorFrameList;
+ QList<int64_t> m_loadingErrorFrameList;
QScopedPointer<FaviconManager> m_faviconManager;
QScopedPointer<FindTextHelper> m_findTextHelper;
SavePageInfo m_savePageInfo;
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 25655bc71..5b0e9d0c1 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -132,7 +132,6 @@
#include <QQuickWindow>
#include <QStringList>
#include <QSurfaceFormat>
-#include <QVector>
#include <QNetworkProxy>
#include <QtGui/qpa/qplatformintegration.h>
#include <QtGui/private/qguiapplication_p.h>
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index e2190f8a2..fcc569969 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -47,7 +47,7 @@
#include "base/values.h"
#include <QtGui/qtgui-config.h>
-#include <QVector>
+#include <QList>
namespace base {
class RunLoop;
@@ -144,7 +144,7 @@ private:
std::unique_ptr<QObject> m_globalQObject;
std::unique_ptr<ProfileAdapter> m_defaultProfileAdapter;
std::unique_ptr<DevToolsServerQt> m_devtoolsServer;
- QVector<ProfileAdapter*> m_profileAdapters;
+ QList<ProfileAdapter*> m_profileAdapters;
#if QT_CONFIG(accessibility)
std::unique_ptr<AccessibilityActivationObserver> m_accessibilityActivationObserver;
#endif