From 6b25e22685cfe434bb17db006c33db7341ca7028 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Nov 2019 13:20:57 +0100 Subject: Code-style cleanup in src/core/net MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picking suggested changes for a clang-format run. Change-Id: I3539dee65f153257015af4a8670312e74980a9e4 Reviewed-by: Michael BrĂ¼ning --- src/core/net/client_cert_override.h | 2 - src/core/net/client_cert_store_data.cpp | 5 +- src/core/net/client_cert_store_data.h | 8 ++- src/core/net/cookie_monster_delegate_qt.cpp | 26 ++++---- src/core/net/cookie_monster_delegate_qt.h | 20 ++++--- src/core/net/custom_protocol_handler.h | 3 +- src/core/net/network_delegate_qt.cpp | 75 ++++++++++-------------- src/core/net/network_delegate_qt.h | 50 +++++++++------- src/core/net/proxy_config_service_qt.cpp | 16 ++--- src/core/net/proxy_config_service_qt.h | 8 +-- src/core/net/qrc_url_scheme_handler.h | 3 +- src/core/net/restricted_cookie_manager_qt.cpp | 5 +- src/core/net/restricted_cookie_manager_qt.h | 6 +- src/core/net/ssl_host_state_delegate_qt.cpp | 19 +++--- src/core/net/ssl_host_state_delegate_qt.h | 20 ++++--- src/core/net/url_request_context_getter_qt.h | 4 +- src/core/net/url_request_custom_job.cpp | 6 +- src/core/net/url_request_custom_job.h | 9 +-- src/core/net/url_request_custom_job_delegate.cpp | 2 +- src/core/net/url_request_custom_job_delegate.h | 5 +- src/core/net/url_request_custom_job_proxy.h | 4 +- src/core/net/url_request_notification.cpp | 19 +++--- src/core/net/url_request_notification.h | 3 +- src/core/net/webui_controller_factory_qt.cpp | 6 +- src/core/net/webui_controller_factory_qt.h | 5 +- 25 files changed, 168 insertions(+), 161 deletions(-) diff --git a/src/core/net/client_cert_override.h b/src/core/net/client_cert_override.h index 4f2734485..7fd28eaeb 100644 --- a/src/core/net/client_cert_override.h +++ b/src/core/net/client_cert_override.h @@ -71,5 +71,3 @@ private: } // QtWebEngineCore #endif - - diff --git a/src/core/net/client_cert_store_data.cpp b/src/core/net/client_cert_store_data.cpp index 5a62cb6fe..314e64145 100644 --- a/src/core/net/client_cert_store_data.cpp +++ b/src/core/net/client_cert_store_data.cpp @@ -59,7 +59,8 @@ namespace { -class SSLPlatformKeyOverride : public net::ThreadedSSLPrivateKey::Delegate { +class SSLPlatformKeyOverride : public net::ThreadedSSLPrivateKey::Delegate +{ public: SSLPlatformKeyOverride(const QByteArray &sslKeyInBytes) { @@ -126,7 +127,7 @@ scoped_refptr wrapOpenSSLPrivateKey(const QByteArray &sslKey net::GetSSLPlatformKeyTaskRunner()); } -} // namespace +} // namespace namespace QtWebEngineCore { diff --git a/src/core/net/client_cert_store_data.h b/src/core/net/client_cert_store_data.h index 7f83f4b60..e47a909e4 100644 --- a/src/core/net/client_cert_store_data.h +++ b/src/core/net/client_cert_store_data.h @@ -57,8 +57,10 @@ class X509Certificate; namespace QtWebEngineCore { -struct ClientCertificateStoreData { - struct Entry { +struct ClientCertificateStoreData +{ + struct Entry + { QSslKey key; QSslCertificate certificate; scoped_refptr certPtr; @@ -69,7 +71,7 @@ struct ClientCertificateStoreData { void remove(const QSslCertificate &certificate); void clear(); - QVector extraCerts; + QVector extraCerts; }; } // namespace QtWebEngineCore diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp index 5f7b75f57..dad9a8db5 100644 --- a/src/core/net/cookie_monster_delegate_qt.cpp +++ b/src/core/net/cookie_monster_delegate_qt.cpp @@ -52,7 +52,8 @@ namespace QtWebEngineCore { -static GURL sourceUrlForCookie(const QNetworkCookie &cookie) { +static GURL sourceUrlForCookie(const QNetworkCookie &cookie) +{ QString urlFragment = QStringLiteral("%1%2").arg(cookie.domain()).arg(cookie.path()); return net::cookie_util::CookieOriginToURL(urlFragment.toStdString(), /* is_https */ cookie.isSecure()); } @@ -70,11 +71,10 @@ CookieMonsterDelegateQt::~CookieMonsterDelegateQt() void CookieMonsterDelegateQt::AddStore(net::CookieStore *store) { - std::unique_ptr sub = - store->GetChangeDispatcher().AddCallbackForAllChanges( + std::unique_ptr sub = store->GetChangeDispatcher().AddCallbackForAllChanges( base::Bind(&CookieMonsterDelegateQt::OnCookieChanged, - // this object's destruction will deregister the subscription. - base::Unretained(this))); + // this object's destruction will deregister the subscription. + base::Unretained(this))); m_subscriptions.push_back(std::move(sub)); } @@ -87,7 +87,7 @@ bool CookieMonsterDelegateQt::hasCookieMonster() void CookieMonsterDelegateQt::getAllCookies(quint64 callbackId) { net::CookieMonster::GetCookieListCallback callback = - base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesCallbackOnIOThread, this, callbackId); + base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesCallbackOnIOThread, this, callbackId); base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::IO}, base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesOnIOThread, this, std::move(callback))); @@ -115,9 +115,8 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie gurl, cookie.toRawForm().toStdString(), std::move(callback))); } -void CookieMonsterDelegateQt::SetCookieOnIOThread( - const GURL& url, const std::string& cookie_line, - net::CookieMonster::SetCookiesCallback callback) +void CookieMonsterDelegateQt::SetCookieOnIOThread(const GURL &url, const std::string &cookie_line, + net::CookieMonster::SetCookiesCallback callback) { net::CookieOptions options; options.set_include_httponly(); @@ -138,7 +137,7 @@ void CookieMonsterDelegateQt::deleteCookie(const QNetworkCookie &cookie, const Q gurl, cookie.name().toStdString())); } -void CookieMonsterDelegateQt::DeleteCookieOnIOThread(const GURL& url, const std::string& cookie_name) +void CookieMonsterDelegateQt::DeleteCookieOnIOThread(const GURL &url, const std::string &cookie_name) { if (m_cookieMonster) { net::CookieMonster::GetCookieListCallback callback = @@ -147,7 +146,8 @@ void CookieMonsterDelegateQt::DeleteCookieOnIOThread(const GURL& url, const std: } } -void CookieMonsterDelegateQt::GetCookiesToDeleteCallback(const std::string& cookie_name, const net::CookieList &cookies, const net::CookieStatusList &statusList) +void CookieMonsterDelegateQt::GetCookiesToDeleteCallback(const std::string &cookie_name, const net::CookieList &cookies, + const net::CookieStatusList &statusList) { Q_UNUSED(statusList); if (!m_cookieMonster) @@ -197,7 +197,7 @@ void CookieMonsterDelegateQt::DeleteAllOnIOThread(net::CookieMonster::DeleteCall m_cookieMonster->DeleteAllAsync(std::move(callback)); } -void CookieMonsterDelegateQt::setCookieMonster(net::CookieMonster* monster) +void CookieMonsterDelegateQt::setCookieMonster(net::CookieMonster *monster) { if (monster == m_cookieMonster) return; @@ -246,7 +246,7 @@ bool CookieMonsterDelegateQt::canGetCookies(const QUrl &firstPartyUrl, const QUr return m_client->d_func()->canAccessCookies(firstPartyUrl, url); } -void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie& cookie, net::CookieChangeCause cause) +void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie &cookie, net::CookieChangeCause cause) { if (!m_client) return; diff --git a/src/core/net/cookie_monster_delegate_qt.h b/src/core/net/cookie_monster_delegate_qt.h index 2ac04acb4..23b803790 100644 --- a/src/core/net/cookie_monster_delegate_qt.h +++ b/src/core/net/cookie_monster_delegate_qt.h @@ -72,13 +72,14 @@ namespace QtWebEngineCore { // cookies for the file:// scheme, which is disabled by default in Chromium. // Since qrc:// is similar to file:// and there are some unknowns about how // to correctly handle file:// cookies, qrc:// should only be used for testing. -static const char* const kCookieableSchemes[] = - { "http", "https", "qrc", "ws", "wss" }; +static const char *const kCookieableSchemes[] = { "http", "https", "qrc", "ws", "wss" }; -class Q_WEBENGINECORE_PRIVATE_EXPORT CookieMonsterDelegateQt : public base::RefCountedThreadSafe { +class Q_WEBENGINECORE_PRIVATE_EXPORT CookieMonsterDelegateQt : public base::RefCountedThreadSafe +{ QPointer m_client; net::CookieMonster *m_cookieMonster; std::vector> m_subscriptions; + public: CookieMonsterDelegateQt(); ~CookieMonsterDelegateQt(); @@ -91,7 +92,7 @@ public: void deleteSessionCookies(quint64 callbackId); void deleteAllCookies(quint64 callbackId); - void setCookieMonster(net::CookieMonster* monster); + void setCookieMonster(net::CookieMonster *monster); void setClient(QWebEngineCookieStore *client); bool canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url) const; @@ -102,13 +103,16 @@ public: private: void GetAllCookiesOnIOThread(net::CookieMonster::GetCookieListCallback callback); - void SetCookieOnIOThread(const GURL& url, const std::string& cookie_line, net::CookieMonster::SetCookiesCallback callback); - void DeleteCookieOnIOThread(const GURL& url, const std::string& cookie_name); + void SetCookieOnIOThread(const GURL &url, const std::string &cookie_line, + net::CookieMonster::SetCookiesCallback callback); + void DeleteCookieOnIOThread(const GURL &url, const std::string &cookie_name); void DeleteSessionCookiesOnIOThread(net::CookieMonster::DeleteCallback callback); void DeleteAllOnIOThread(net::CookieMonster::DeleteCallback callback); - void GetCookiesToDeleteCallback(const std::string& cookie_name, const net::CookieList &cookies, const net::CookieStatusList &statusList); - void GetAllCookiesCallbackOnIOThread(qint64 callbackId, const net::CookieList &cookies, const net::CookieStatusList &statusList); + void GetCookiesToDeleteCallback(const std::string &cookie_name, const net::CookieList &cookies, + const net::CookieStatusList &statusList); + void GetAllCookiesCallbackOnIOThread(qint64 callbackId, const net::CookieList &cookies, + const net::CookieStatusList &statusList); void SetCookieCallbackOnIOThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status); void DeleteCookiesCallbackOnIOThread(qint64 callbackId, uint numCookies); diff --git a/src/core/net/custom_protocol_handler.h b/src/core/net/custom_protocol_handler.h index 7b189763c..625afc1d5 100644 --- a/src/core/net/custom_protocol_handler.h +++ b/src/core/net/custom_protocol_handler.h @@ -71,7 +71,8 @@ class ProfileAdapter; // Implements a ProtocolHandler for custom URL schemes. // If |network_delegate_| is NULL then all file requests will fail with ERR_ACCESS_DENIED. -class Q_WEBENGINECORE_PRIVATE_EXPORT CustomProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { +class Q_WEBENGINECORE_PRIVATE_EXPORT CustomProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler +{ public: CustomProtocolHandler(QPointer profileAdapter); diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp index 772ef06aa..7d3801ffe 100644 --- a/src/core/net/network_delegate_qt.cpp +++ b/src/core/net/network_delegate_qt.cpp @@ -141,7 +141,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet // quick peek if deprecated if (m_profileIOData->isInterceptorDeprecated()) { - QWebEngineUrlRequestInterceptor* profileInterceptor = m_profileIOData->acquireInterceptor(); + QWebEngineUrlRequestInterceptor *profileInterceptor = m_profileIOData->acquireInterceptor(); if (profileInterceptor && m_profileIOData->isInterceptorDeprecated()) { profileInterceptor->interceptRequest(requestInfo); m_profileIOData->releaseInterceptor(); @@ -197,25 +197,19 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, net::Complet return net::ERR_IO_PENDING; } -void NetworkDelegateQt::OnURLRequestDestroyed(net::URLRequest*) -{ -} +void NetworkDelegateQt::OnURLRequestDestroyed(net::URLRequest *) {} -void NetworkDelegateQt::OnCompleted(net::URLRequest */*request*/, bool /*started*/, int /*net_error*/) -{ -} +void NetworkDelegateQt::OnCompleted(net::URLRequest * /*request*/, bool /*started*/, int /*net_error*/) {} -bool NetworkDelegateQt::OnCanSetCookie(const net::URLRequest& request, - const net::CanonicalCookie & /*cookie*/, - net::CookieOptions*, - bool allowedFromCaller) +bool NetworkDelegateQt::OnCanSetCookie(const net::URLRequest &request, const net::CanonicalCookie & /*cookie*/, + net::CookieOptions *, bool allowedFromCaller) { if (!allowedFromCaller) return false; return canSetCookies(request.site_for_cookies(), request.url(), std::string()); } -bool NetworkDelegateQt::OnCanGetCookies(const net::URLRequest& request, const net::CookieList&, bool allowedFromCaller) +bool NetworkDelegateQt::OnCanGetCookies(const net::URLRequest &request, const net::CookieList &, bool allowedFromCaller) { if (!allowedFromCaller) return false; @@ -225,8 +219,8 @@ bool NetworkDelegateQt::OnCanGetCookies(const net::URLRequest& request, const ne bool NetworkDelegateQt::OnForcePrivacyMode(const GURL &url, const GURL &site_for_cookies) const { return false; -// FIXME: This is what the NetworkContext implementation does (changes tst_QWebEngineCookieStore tests since 72) -// return !canGetCookies(site_for_cookies, url); + // FIXME: This is what the NetworkContext implementation does (changes tst_QWebEngineCookieStore tests since 72) + // return !canGetCookies(site_for_cookies, url); } bool NetworkDelegateQt::canSetCookies(const GURL &first_party, const GURL &url, const std::string &cookie_line) const @@ -246,71 +240,64 @@ int NetworkDelegateQt::OnBeforeStartTransaction(net::URLRequest *, net::Completi return net::OK; } -void NetworkDelegateQt::OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info, - const net::ProxyRetryInfoMap& proxy_retry_info, net::HttpRequestHeaders* headers) -{ -} +void NetworkDelegateQt::OnBeforeSendHeaders(net::URLRequest *request, const net::ProxyInfo &proxy_info, + const net::ProxyRetryInfoMap &proxy_retry_info, + net::HttpRequestHeaders *headers) +{} -void NetworkDelegateQt::OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers) -{ -} +void NetworkDelegateQt::OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers) {} -int NetworkDelegateQt::OnHeadersReceived(net::URLRequest*, net::CompletionOnceCallback, const net::HttpResponseHeaders*, scoped_refptr*, GURL*) +int NetworkDelegateQt::OnHeadersReceived(net::URLRequest *, net::CompletionOnceCallback, const net::HttpResponseHeaders *, + scoped_refptr *, GURL *) { return net::OK; } -void NetworkDelegateQt::OnBeforeRedirect(net::URLRequest*, const GURL&) -{ -} +void NetworkDelegateQt::OnBeforeRedirect(net::URLRequest *, const GURL &) {} -void NetworkDelegateQt::OnResponseStarted(net::URLRequest*, int) -{ -} +void NetworkDelegateQt::OnResponseStarted(net::URLRequest *, int) {} -void NetworkDelegateQt::OnNetworkBytesReceived(net::URLRequest*, int64_t) -{ -} +void NetworkDelegateQt::OnNetworkBytesReceived(net::URLRequest *, int64_t) {} -void NetworkDelegateQt::OnNetworkBytesSent(net::URLRequest*, int64_t) -{ -} +void NetworkDelegateQt::OnNetworkBytesSent(net::URLRequest *, int64_t) {} -void NetworkDelegateQt::OnPACScriptError(int, const base::string16&) -{ -} +void NetworkDelegateQt::OnPACScriptError(int, const base::string16 &) {} -net::NetworkDelegate::AuthRequiredResponse NetworkDelegateQt::OnAuthRequired(net::URLRequest*, const net::AuthChallengeInfo&, AuthCallback, net::AuthCredentials*) +net::NetworkDelegate::AuthRequiredResponse NetworkDelegateQt::OnAuthRequired(net::URLRequest *, + const net::AuthChallengeInfo &, + AuthCallback, net::AuthCredentials *) { return AUTH_REQUIRED_RESPONSE_NO_ACTION; } -bool NetworkDelegateQt::OnCanAccessFile(const net::URLRequest&, const base::FilePath&, const base::FilePath&) const +bool NetworkDelegateQt::OnCanAccessFile(const net::URLRequest &, const base::FilePath &, const base::FilePath &) const { return true; } -bool NetworkDelegateQt::OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest&, const GURL&, const GURL&) const +bool NetworkDelegateQt::OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest &, const GURL &, + const GURL &) const { return false; } -bool NetworkDelegateQt::OnCanQueueReportingReport(const url::Origin& origin) const +bool NetworkDelegateQt::OnCanQueueReportingReport(const url::Origin &origin) const { return false; } -void NetworkDelegateQt::OnCanSendReportingReports(std::set origins, base::OnceCallback)> result_callback) const +void NetworkDelegateQt::OnCanSendReportingReports(std::set origins, + base::OnceCallback)> result_callback) const { std::move(result_callback).Run(std::set()); } -bool NetworkDelegateQt::OnCanSetReportingClient(const url::Origin& origin, const GURL& endpoint) const +bool NetworkDelegateQt::OnCanSetReportingClient(const url::Origin &origin, const GURL &endpoint) const { return false; } -bool NetworkDelegateQt::OnCanUseReportingClient(const url::Origin& origin, const GURL& endpoint) const +bool NetworkDelegateQt::OnCanUseReportingClient(const url::Origin &origin, const GURL &endpoint) const { return false; } diff --git a/src/core/net/network_delegate_qt.h b/src/core/net/network_delegate_qt.h index 53debadcd..f294c6c7c 100644 --- a/src/core/net/network_delegate_qt.h +++ b/src/core/net/network_delegate_qt.h @@ -54,36 +54,44 @@ namespace QtWebEngineCore { class ProfileIODataQt; -class NetworkDelegateQt : public net::NetworkDelegate { +class NetworkDelegateQt : public net::NetworkDelegate +{ ProfileIODataQt *m_profileIOData; + public: NetworkDelegateQt(ProfileIODataQt *data); // net::NetworkDelegate implementation - int OnBeforeURLRequest(net::URLRequest* request, net::CompletionOnceCallback callback, GURL* new_url) override; - void OnURLRequestDestroyed(net::URLRequest* request) override; - bool OnCanSetCookie(const net::URLRequest& request, const net::CanonicalCookie& cookie, net::CookieOptions* options, bool) override; - int OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionOnceCallback callback, net::HttpRequestHeaders *headers) override; - void OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info, - const net::ProxyRetryInfoMap& proxy_retry_info, net::HttpRequestHeaders* headers) override; + int OnBeforeURLRequest(net::URLRequest *request, net::CompletionOnceCallback callback, GURL *new_url) override; + void OnURLRequestDestroyed(net::URLRequest *request) override; + bool OnCanSetCookie(const net::URLRequest &request, const net::CanonicalCookie &cookie, net::CookieOptions *options, + bool) override; + int OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionOnceCallback callback, + net::HttpRequestHeaders *headers) override; + void OnBeforeSendHeaders(net::URLRequest *request, const net::ProxyInfo &proxy_info, + const net::ProxyRetryInfoMap &proxy_retry_info, net::HttpRequestHeaders *headers) override; void OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers) override; - int OnHeadersReceived(net::URLRequest*, net::CompletionOnceCallback, const net::HttpResponseHeaders*, scoped_refptr*, GURL*) override; - void OnBeforeRedirect(net::URLRequest*, const GURL&) override; - void OnResponseStarted(net::URLRequest*, int) override; - void OnNetworkBytesReceived(net::URLRequest*, int64_t) override; + int OnHeadersReceived(net::URLRequest *, net::CompletionOnceCallback, const net::HttpResponseHeaders *, + scoped_refptr *, GURL *) override; + void OnBeforeRedirect(net::URLRequest *, const GURL &) override; + void OnResponseStarted(net::URLRequest *, int) override; + void OnNetworkBytesReceived(net::URLRequest *, int64_t) override; void OnNetworkBytesSent(net::URLRequest *, int64_t) override; void OnCompleted(net::URLRequest *request, bool started, int net_error) override; - void OnPACScriptError(int, const base::string16&) override; - net::NetworkDelegate::AuthRequiredResponse OnAuthRequired(net::URLRequest*, const net::AuthChallengeInfo&, AuthCallback, net::AuthCredentials*) override; - bool OnCanGetCookies(const net::URLRequest&, const net::CookieList&, bool) override; - bool OnCanAccessFile(const net::URLRequest&, const base::FilePath&, const base::FilePath&) const override; - bool OnForcePrivacyMode(const GURL&, const GURL&) const override; - bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest&, const GURL&, const GURL&) const override; + void OnPACScriptError(int, const base::string16 &) override; + net::NetworkDelegate::AuthRequiredResponse OnAuthRequired(net::URLRequest *, const net::AuthChallengeInfo &, + AuthCallback, net::AuthCredentials *) override; + bool OnCanGetCookies(const net::URLRequest &, const net::CookieList &, bool) override; + bool OnCanAccessFile(const net::URLRequest &, const base::FilePath &, const base::FilePath &) const override; + bool OnForcePrivacyMode(const GURL &, const GURL &) const override; + bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest &, const GURL &, + const GURL &) const override; - bool OnCanQueueReportingReport(const url::Origin& origin) const override; - void OnCanSendReportingReports(std::set origins, base::OnceCallback)> result_callback) const override; - bool OnCanSetReportingClient(const url::Origin& origin, const GURL& endpoint) const override; - bool OnCanUseReportingClient(const url::Origin& origin, const GURL& endpoint) const override; + bool OnCanQueueReportingReport(const url::Origin &origin) const override; + void OnCanSendReportingReports(std::set origins, + base::OnceCallback)> result_callback) const override; + bool OnCanSetReportingClient(const url::Origin &origin, const GURL &endpoint) const override; + bool OnCanUseReportingClient(const url::Origin &origin, const GURL &endpoint) const override; bool canSetCookies(const GURL &first_party, const GURL &url, const std::string &cookie_line) const; bool canGetCookies(const GURL &first_party, const GURL &url) const; diff --git a/src/core/net/proxy_config_service_qt.cpp b/src/core/net/proxy_config_service_qt.cpp index 00ff1c54d..8016c7e83 100644 --- a/src/core/net/proxy_config_service_qt.cpp +++ b/src/core/net/proxy_config_service_qt.cpp @@ -70,14 +70,14 @@ net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qt } ProxyConfigServiceQt::ProxyConfigServiceQt(std::unique_ptr baseService, - const net::ProxyConfigWithAnnotation& initialConfig, ProxyPrefs::ConfigState initialState) - : m_baseService(baseService.release()), - m_usesSystemConfiguration(false), - m_registeredObserver(false), - m_prefConfig(initialConfig), - m_perfState(initialState) -{ -} + const net::ProxyConfigWithAnnotation &initialConfig, + ProxyPrefs::ConfigState initialState) + : m_baseService(baseService.release()) + , m_usesSystemConfiguration(false) + , m_registeredObserver(false) + , m_prefConfig(initialConfig) + , m_perfState(initialState) +{} ProxyConfigServiceQt::~ProxyConfigServiceQt() { diff --git a/src/core/net/proxy_config_service_qt.h b/src/core/net/proxy_config_service_qt.h index 09e88d445..4d8619055 100644 --- a/src/core/net/proxy_config_service_qt.h +++ b/src/core/net/proxy_config_service_qt.h @@ -51,14 +51,14 @@ #include class ProxyConfigServiceQt - : public net::ProxyConfigService - , public net::ProxyConfigService::Observer { + : public net::ProxyConfigService + , public net::ProxyConfigService::Observer +{ public: - static net::ProxyServer fromQNetworkProxy(const QNetworkProxy &); explicit ProxyConfigServiceQt(std::unique_ptr baseService, - const net::ProxyConfigWithAnnotation& initialConfig, + const net::ProxyConfigWithAnnotation &initialConfig, ProxyPrefs::ConfigState initialState); ~ProxyConfigServiceQt() override; diff --git a/src/core/net/qrc_url_scheme_handler.h b/src/core/net/qrc_url_scheme_handler.h index f6ca92879..586147cdf 100644 --- a/src/core/net/qrc_url_scheme_handler.h +++ b/src/core/net/qrc_url_scheme_handler.h @@ -45,7 +45,8 @@ namespace QtWebEngineCore { -class QrcUrlSchemeHandler final : public QWebEngineUrlSchemeHandler { +class QrcUrlSchemeHandler final : public QWebEngineUrlSchemeHandler +{ public: void requestStarted(QWebEngineUrlRequestJob *) override; }; diff --git a/src/core/net/restricted_cookie_manager_qt.cpp b/src/core/net/restricted_cookie_manager_qt.cpp index e01969f4d..7f1ca163e 100644 --- a/src/core/net/restricted_cookie_manager_qt.cpp +++ b/src/core/net/restricted_cookie_manager_qt.cpp @@ -58,7 +58,8 @@ namespace QtWebEngineCore { -class RestrictedCookieManagerListenerQt : public network::mojom::CookieChangeListener { +class RestrictedCookieManagerListenerQt : public network::mojom::CookieChangeListener +{ public: RestrictedCookieManagerListenerQt(const GURL &url, const GURL &site_for_cookies, @@ -181,4 +182,4 @@ bool RestrictedCookieManagerQt::allowCookies(const GURL &url, const GURL &site_f return m_profileIoData->canGetCookies(toQt(site_for_cookies), toQt(url)); } -} // namespace QtWebEngineCore +} // namespace QtWebEngineCore diff --git a/src/core/net/restricted_cookie_manager_qt.h b/src/core/net/restricted_cookie_manager_qt.h index a277c7c96..9154f671d 100644 --- a/src/core/net/restricted_cookie_manager_qt.h +++ b/src/core/net/restricted_cookie_manager_qt.h @@ -85,7 +85,7 @@ public: CookiesEnabledForCallback callback) override; // Internal: - bool allowCookies(const GURL& url, const GURL &site_for_cookies) const; + bool allowCookies(const GURL &url, const GURL &site_for_cookies) const; private: base::WeakPtr m_profileIoData; @@ -95,6 +95,6 @@ private: DISALLOW_COPY_AND_ASSIGN(RestrictedCookieManagerQt); }; -} // namespace QtWebEngineCore +} // namespace QtWebEngineCore -#endif // RESTRICTED_COOKIE_MANAGER_QT_H +#endif // RESTRICTED_COOKIE_MANAGER_QT_H diff --git a/src/core/net/ssl_host_state_delegate_qt.cpp b/src/core/net/ssl_host_state_delegate_qt.cpp index b6cdf68dc..0885475be 100644 --- a/src/core/net/ssl_host_state_delegate_qt.cpp +++ b/src/core/net/ssl_host_state_delegate_qt.cpp @@ -67,19 +67,15 @@ bool CertPolicy::Check(const net::X509Certificate &cert, int error) const return false; } -void CertPolicy::Allow(const net::X509Certificate& cert, int error) +void CertPolicy::Allow(const net::X509Certificate &cert, int error) { net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256(); m_allowed[fingerprint] |= error; } -SSLHostStateDelegateQt::SSLHostStateDelegateQt() -{ -} +SSLHostStateDelegateQt::SSLHostStateDelegateQt() {} -SSLHostStateDelegateQt::~SSLHostStateDelegateQt() -{ -} +SSLHostStateDelegateQt::~SSLHostStateDelegateQt() {} void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509Certificate &cert, int error) { @@ -87,7 +83,7 @@ void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509C } // Clear all allow preferences. -void SSLHostStateDelegateQt::Clear(const base::Callback& host_filter) +void SSLHostStateDelegateQt::Clear(const base::Callback &host_filter) { if (host_filter.is_null()) { m_certPolicyforHost.clear(); @@ -107,9 +103,10 @@ void SSLHostStateDelegateQt::Clear(const base::Callback 0; } private: std::map m_allowed; }; -class SSLHostStateDelegateQt : public content::SSLHostStateDelegate { +class SSLHostStateDelegateQt : public content::SSLHostStateDelegate +{ public: SSLHostStateDelegateQt(); @@ -65,11 +67,11 @@ public: // content::SSLHostStateDelegate implementation: void AllowCert(const std::string &, const net::X509Certificate &cert, int error) override; - void Clear(const base::Callback& host_filter) override; - CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert, - int error, bool *expired_previous_decision) override; - void HostRanInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override; - bool DidHostRunInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override; + void Clear(const base::Callback &host_filter) override; + CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert, int error, + bool *expired_previous_decision) override; + void HostRanInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override; + bool DidHostRunInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override; void RevokeUserAllowExceptions(const std::string &host) override; bool HasAllowException(const std::string &host) override; diff --git a/src/core/net/url_request_context_getter_qt.h b/src/core/net/url_request_context_getter_qt.h index b6135cb16..a6ef6eae0 100644 --- a/src/core/net/url_request_context_getter_qt.h +++ b/src/core/net/url_request_context_getter_qt.h @@ -46,11 +46,13 @@ namespace QtWebEngineCore { class ProfileIODataQt; -class URLRequestContextGetterQt : public net::URLRequestContextGetter { +class URLRequestContextGetterQt : public net::URLRequestContextGetter +{ public: URLRequestContextGetterQt(ProfileIODataQt *data); net::URLRequestContext *GetURLRequestContext() override; scoped_refptr GetNetworkTaskRunner() const override; + private: virtual ~URLRequestContextGetterQt(); ProfileIODataQt *m_profileIOData; diff --git a/src/core/net/url_request_custom_job.cpp b/src/core/net/url_request_custom_job.cpp index 37f7de256..607e8d232 100644 --- a/src/core/net/url_request_custom_job.cpp +++ b/src/core/net/url_request_custom_job.cpp @@ -132,7 +132,7 @@ bool URLRequestCustomJob::GetMimeType(std::string *mimeType) const return false; } -bool URLRequestCustomJob::GetCharset(std::string* charset) +bool URLRequestCustomJob::GetCharset(std::string *charset) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (m_charset.size() > 0) { @@ -142,7 +142,7 @@ bool URLRequestCustomJob::GetCharset(std::string* charset) return false; } -void URLRequestCustomJob::GetResponseInfo(HttpResponseInfo* info) +void URLRequestCustomJob::GetResponseInfo(HttpResponseInfo *info) { // Based on net::URLRequestRedirectJob::StartAsync() @@ -173,7 +173,7 @@ void URLRequestCustomJob::GetResponseInfo(HttpResponseInfo* info) info->headers = new HttpResponseHeaders(HttpUtil::AssembleRawHeaders(headers)); } -bool URLRequestCustomJob::IsRedirectResponse(GURL* location, int* http_status_code, bool* /*insecure_scheme_was_upgraded*/) +bool URLRequestCustomJob::IsRedirectResponse(GURL *location, int *http_status_code, bool * /*insecure_scheme_was_upgraded*/) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (m_redirect.is_valid()) { diff --git a/src/core/net/url_request_custom_job.h b/src/core/net/url_request_custom_job.h index 19a1a5776..af5a6f8e0 100644 --- a/src/core/net/url_request_custom_job.h +++ b/src/core/net/url_request_custom_job.h @@ -53,7 +53,8 @@ class URLRequestCustomJobDelegate; class URLRequestCustomJobProxy; // A request job that handles reading custom URL schemes -class URLRequestCustomJob : public net::URLRequestJob { +class URLRequestCustomJob : public net::URLRequestJob +{ public: URLRequestCustomJob(net::URLRequest *request, net::NetworkDelegate *networkDelegate, @@ -61,11 +62,11 @@ public: QPointer profileAdapter); void Start() override; void Kill() override; - int ReadRawData(net::IOBuffer *buf, int buf_size) override; + int ReadRawData(net::IOBuffer *buf, int buf_size) override; bool GetMimeType(std::string *mimeType) const override; bool GetCharset(std::string *charset) override; - void GetResponseInfo(net::HttpResponseInfo* info) override; - bool IsRedirectResponse(GURL* location, int* http_status_code, bool* insecure_scheme_was_upgraded) override; + void GetResponseInfo(net::HttpResponseInfo *info) override; + bool IsRedirectResponse(GURL *location, int *http_status_code, bool *insecure_scheme_was_upgraded) override; protected: virtual ~URLRequestCustomJob(); diff --git a/src/core/net/url_request_custom_job_delegate.cpp b/src/core/net/url_request_custom_job_delegate.cpp index b5a7a55a7..f73296cf0 100644 --- a/src/core/net/url_request_custom_job_delegate.cpp +++ b/src/core/net/url_request_custom_job_delegate.cpp @@ -117,7 +117,7 @@ void URLRequestCustomJobDelegate::redirect(const QUrl &url) void URLRequestCustomJobDelegate::fail(Error error) { - int net_error = 0; + int net_error = 0; switch (error) { case NoError: break; diff --git a/src/core/net/url_request_custom_job_delegate.h b/src/core/net/url_request_custom_job_delegate.h index 0ab1a82c7..93ae39e84 100644 --- a/src/core/net/url_request_custom_job_delegate.h +++ b/src/core/net/url_request_custom_job_delegate.h @@ -64,7 +64,8 @@ namespace QtWebEngineCore { class URLRequestCustomJobProxy; -class Q_WEBENGINECORE_PRIVATE_EXPORT URLRequestCustomJobDelegate : public QObject { +class Q_WEBENGINECORE_PRIVATE_EXPORT URLRequestCustomJobDelegate : public QObject +{ Q_OBJECT public: ~URLRequestCustomJobDelegate(); @@ -84,7 +85,7 @@ public: QMap requestHeaders() const; void reply(const QByteArray &contentType, QIODevice *device); - void redirect(const QUrl& url); + void redirect(const QUrl &url); void abort(); void fail(Error); diff --git a/src/core/net/url_request_custom_job_proxy.h b/src/core/net/url_request_custom_job_proxy.h index aa55db07c..d4cd7e208 100644 --- a/src/core/net/url_request_custom_job_proxy.h +++ b/src/core/net/url_request_custom_job_proxy.h @@ -56,8 +56,8 @@ class ProfileAdapter; // Used to comunicate between URLRequestCustomJob living on the IO thread // and URLRequestCustomJobDelegate living on the UI thread. -class URLRequestCustomJobProxy - : public base::RefCountedThreadSafe { +class URLRequestCustomJobProxy : public base::RefCountedThreadSafe +{ public: URLRequestCustomJobProxy(URLRequestCustomJob *job, diff --git a/src/core/net/url_request_notification.cpp b/src/core/net/url_request_notification.cpp index 9d309e314..fa6d61f65 100644 --- a/src/core/net/url_request_notification.cpp +++ b/src/core/net/url_request_notification.cpp @@ -53,11 +53,13 @@ namespace QtWebEngineCore { // Calls cancel() when the URLRequest is destroyed. -class UserData : public base::SupportsUserData::Data { +class UserData : public base::SupportsUserData::Data +{ public: UserData(URLRequestNotification *ptr) : m_ptr(ptr) {} ~UserData() { m_ptr->cancel(); } static const char key[]; + private: URLRequestNotification *m_ptr; }; @@ -69,13 +71,10 @@ static content::ResourceType fromQt(QWebEngineUrlRequestInfo::ResourceType resou return static_cast(resourceType); } -URLRequestNotification::URLRequestNotification(net::URLRequest *request, - bool isMainFrameRequest, - GURL *newUrl, - QWebEngineUrlRequestInfo &&requestInfo, - content::ResourceRequestInfo::WebContentsGetter webContentsGetter, - net::CompletionOnceCallback callback, - QPointer adapter) +URLRequestNotification::URLRequestNotification(net::URLRequest *request, bool isMainFrameRequest, GURL *newUrl, + QWebEngineUrlRequestInfo &&requestInfo, + content::ResourceRequestInfo::WebContentsGetter webContentsGetter, + net::CompletionOnceCallback callback, QPointer adapter) : m_request(request) , m_isMainFrameRequest(isMainFrameRequest) , m_newUrl(newUrl) @@ -108,7 +107,7 @@ void URLRequestNotification::notify() if (webContents) { if (m_profileAdapter && m_profileAdapter->requestInterceptor()) { - QWebEngineUrlRequestInterceptor* interceptor = m_profileAdapter->requestInterceptor(); + QWebEngineUrlRequestInterceptor *interceptor = m_profileAdapter->requestInterceptor(); if (!interceptor->property("deprecated").toBool()) interceptor->interceptRequest(m_requestInfo); } @@ -152,7 +151,7 @@ void URLRequestNotification::notify() base::BindOnce(&URLRequestNotification::complete, base::Unretained(this), result)); } -void URLRequestNotification::cancel() +void URLRequestNotification::cancel() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); diff --git a/src/core/net/url_request_notification.h b/src/core/net/url_request_notification.h index 1d9acf12f..673e07bf0 100644 --- a/src/core/net/url_request_notification.h +++ b/src/core/net/url_request_notification.h @@ -57,7 +57,8 @@ class ProfileAdapter; class ProfileIoDataQt; // Notifies WebContentsAdapterClient of a new URLRequest. -class URLRequestNotification { +class URLRequestNotification +{ public: URLRequestNotification(net::URLRequest *request, bool isMainFrameRequest, diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp index 2bfd242e7..8c045bb7b 100644 --- a/src/core/net/webui_controller_factory_qt.cpp +++ b/src/core/net/webui_controller_factory_qt.cpp @@ -109,7 +109,7 @@ typedef std::unique_ptr (*WebUIFactoryFunction)(WebUI *web_ui, // Template for defining WebUIFactoryFunction. template -std::unique_ptr NewWebUI(WebUI *web_ui, const GURL &/*url*/) +std::unique_ptr NewWebUI(WebUI *web_ui, const GURL & /*url*/) { return std::unique_ptr(new T(web_ui)); } @@ -130,8 +130,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, co return &NewWebUI; if (url.SchemeIs(content::kChromeDevToolsScheme)) { -// if (!DevToolsUIBindings::IsValidFrontendURL(url)) -// return nullptr; + // if (!DevToolsUIBindings::IsValidFrontendURL(url)) + // return nullptr; return &NewWebUI; } if (url.host() == chrome::kChromeUIAccessibilityHost) diff --git a/src/core/net/webui_controller_factory_qt.h b/src/core/net/webui_controller_factory_qt.h index 20ea62193..1cc76349b 100644 --- a/src/core/net/webui_controller_factory_qt.h +++ b/src/core/net/webui_controller_factory_qt.h @@ -55,7 +55,8 @@ class RefCountedMemory; namespace QtWebEngineCore { -class WebUIControllerFactoryQt : public content::WebUIControllerFactory { +class WebUIControllerFactoryQt : public content::WebUIControllerFactory +{ public: content::WebUI::TypeID GetWebUIType(content::BrowserContext *browserContext, const GURL &url) override; bool UseWebUIForURL(content::BrowserContext *browserContext, const GURL &url) override; @@ -76,4 +77,4 @@ private: } // namespace QtWebEngineCore -#endif // WEB_UI_CONTROLLER_FACTORY_QT_H_ +#endif // WEB_UI_CONTROLLER_FACTORY_QT_H_ -- cgit v1.2.3