cef/patch/patches/net_cookie_flags.patch

41 lines
1.9 KiB
Diff

diff --git net/base/load_flags_list.h net/base/load_flags_list.h
index 6466deac2671e..053ca5c7e55ae 100644
--- net/base/load_flags_list.h
+++ net/base/load_flags_list.h
@@ -110,3 +110,6 @@ LOAD_FLAG(CAN_USE_RESTRICTED_PREFETCH, 1 << 16)
//
// Cannot be used together with BYPASS_CACHE, ONLY_FROM_CACHE, or DISABLE_CACHE.
LOAD_FLAG(USE_SINGLE_KEYED_CACHE, 1 << 17)
+
+// This load will not send any cookies. For CEF usage.
+LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 18)
\ No newline at end of file
diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc
index 1975492c29ae0..0ec7ddefe932b 100644
--- net/url_request/url_request_http_job.cc
+++ net/url_request/url_request_http_job.cc
@@ -1770,7 +1770,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::IsPartitionedCookiesEnabled() const {
diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc
index a15e3c4bed344..c665e98a1befc 100644
--- services/network/public/cpp/resource_request.cc
+++ services/network/public/cpp/resource_request.cc
@@ -264,7 +264,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 {