summaryrefslogtreecommitdiffstats
path: root/src/core/net
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 08:38:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-01-13 16:11:53 +0100
commitffb13e6927ae14a7185bb45ee0dfd03973e5ebb0 (patch)
tree1a00d0b9a36f2406056db01a228dd1ed00408361 /src/core/net
parent0970b75122c51bb621b9435aa558b2c74ff52e9f (diff)
Adaptations for Chromium 85
Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/net')
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp5
-rw-r--r--src/core/net/cookie_monster_delegate_qt.h2
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.cpp2
-rw-r--r--src/core/net/system_network_context_manager.cpp8
4 files changed, 6 insertions, 11 deletions
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index a55a9e8bb..3d3403a54 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -143,7 +143,7 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie
if (callbackId != CallbackDirectory::NoCallbackId)
callback = base::BindOnce(&CookieMonsterDelegateQt::SetCookieCallbackOnUIThread, this, callbackId);
- net::CanonicalCookie::CookieInclusionStatus inclusion;
+ net::CookieInclusionStatus inclusion;
auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), base::nullopt, &inclusion);
if (!inclusion.IsInclude()) {
LOG(WARNING) << "QWebEngineCookieStore::setCookie() - Tried to set invalid cookie";
@@ -151,6 +151,7 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie
}
net::CookieOptions options;
options.set_include_httponly();
+ options.set_same_site_cookie_context(net::CookieOptions::SameSiteCookieContext::MakeInclusiveForSet());
m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl, options, std::move(callback));
}
@@ -272,7 +273,7 @@ void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId,
m_client->d_func()->onGetAllCallbackResult(callbackId, rawCookies);
}
-void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status)
+void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieInclusionStatus status)
{
if (m_client)
m_client->d_func()->onSetCallbackResult(callbackId, status.IsInclude());
diff --git a/src/core/net/cookie_monster_delegate_qt.h b/src/core/net/cookie_monster_delegate_qt.h
index 748e92da9..6e9007443 100644
--- a/src/core/net/cookie_monster_delegate_qt.h
+++ b/src/core/net/cookie_monster_delegate_qt.h
@@ -120,7 +120,7 @@ public:
private:
void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies);
- void SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status);
+ void SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieInclusionStatus status);
void DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies);
};
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index b0b46c817..b0d3787de 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -126,7 +126,7 @@ void ProxyingRestrictedCookieManagerQt::GetAllForUrl(const GURL &url,
if (allowCookies(url, site_for_cookies)) {
underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options), std::move(callback));
} else {
- std::move(callback).Run(std::vector<net::CanonicalCookie>());
+ std::move(callback).Run(std::vector<net::CookieWithAccessResult>());
}
}
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index d4681bf7a..affc228cf 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -64,7 +64,6 @@
#include "components/network_session_configurator/common/network_switches.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/cors_exempt_headers.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
@@ -241,8 +240,7 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
network_service->SetUpHttpAuth(CreateHttpAuthStaticParams());
network_service->ConfigureHttpAuthPrefs(CreateHttpAuthDynamicParams());
- // The system NetworkContext must be created first, since it sets
- // |primary_network_context| to true.
+ // The system NetworkContext is created first
network_service_network_context_.reset();
network_service->CreateNetworkContext(
network_service_network_context_.BindNewPipeAndPassReceiver(),
@@ -265,8 +263,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams(network::mo
void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(network::mojom::NetworkContextParams *network_context_params)
{
- content::UpdateCorsExemptHeader(network_context_params);
-
network_context_params->enable_brotli = true;
// Disable referrers by default. Any consumer that enables referrers should
@@ -309,8 +305,6 @@ network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateNetwo
network_context_params->enable_ftp_url_support = true;
#endif
- network_context_params->primary_network_context = false;
-
proxy_config_monitor_.AddToNetworkContextParams(network_context_params.get());
return network_context_params;