Files
cef/patch/patches/net_cookie_flags.patch
Marshall Greenblatt a26ddfd279 Update to Chromium version 156.0.8078.0
win: dxil.dll is no longer distributed
mac: Xcode 27 (macOS 26.6+) is now required
2026-10-07 12:25:37 -04:00

51 lines
2.6 KiB
Diff

diff --git net/base/load_flags_list.h net/base/load_flags_list.h
index c10df92f30b1292a8243f376025e81afcefba78d..17abc3e15b985a13308014488728fcb0af188f18 100644
--- net/base/load_flags_list.h
+++ net/base/load_flags_list.h
@@ -123,4 +123,7 @@ LOAD_FLAG(SHOULD_BYPASS_HSTS, 1 << 18)
// compromised renderer concern is acceptable.
LOAD_FLAG(IS_MAIN_FRAME_ORIGIN_RECENTLY_ACCESSED, 1 << 19)
+// This load will not send any cookies. For CEF usage.
+LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 20)
+
// See note at top of file about why adding LoadFlags is often a bad idea.
diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc
index c909310d202002b724941bd4e2b4fede56b69d45..5f634313189a3a81e756431ca8e6b9cbe4038cf0 100644
--- net/url_request/url_request_http_job.cc
+++ net/url_request/url_request_http_job.cc
@@ -2115,7 +2115,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const {
// Read cookies whenever allow_credentials() is true, even if the PrivacyMode
// is being overridden by NetworkDelegate and will eventually block them, as
// blocked cookies still need to be logged in that case.
- return request_->context()->cookie_store() && request_->allow_credentials();
+ return request_->context()->cookie_store() && request_->allow_credentials() &&
+ !(request_info_.load_flags & LOAD_DO_NOT_SEND_COOKIES);
}
bool URLRequestHttpJob::ShouldRecordPartitionedCookieUsage() const {
diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc
index 8a8e9165fa604bca66ddbf48d569d277c4b6aa96..42d8c636ab7f0442d6f57ad512e83cb27e0197a7 100644
--- services/network/public/cpp/resource_request.cc
+++ services/network/public/cpp/resource_request.cc
@@ -394,7 +394,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {
}
bool ResourceRequest::SendsCookies() const {
- return credentials_mode == network::mojom::CredentialsMode::kInclude;
+ return credentials_mode == network::mojom::CredentialsMode::kInclude &&
+ !(load_flags & net::LOAD_DO_NOT_SEND_COOKIES);
}
bool ResourceRequest::SavesCookies() const {
@@ -448,7 +449,8 @@ int GetAllowedLoadFlagsForUntrustedRequests() {
net::LOAD_DISABLE_CACHE | net::LOAD_PREFETCH |
net::LOAD_IGNORE_LIMITS | net::LOAD_DO_NOT_USE_EMBEDDED_IDENTITY |
net::LOAD_SUPPORT_ASYNC_REVALIDATION |
- net::LOAD_RESTRICTED_PREFETCH_FOR_MAIN_FRAME;
+ net::LOAD_RESTRICTED_PREFETCH_FOR_MAIN_FRAME |
+ net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
}
namespace debug {