ResourceRequest.site_for_cookies defaults to an empty SiteForCookies.
When UCC launches, when users opt to restrict 3P cookies a request
with an empty SFC will have its cookies blocked by 3PC blocking.
This CL sets the SiteForCookies to the site of the request URL. This
will send cookies when 3PC blocking is enabled. It will also send
SameSite cookies.
If this request is meant to be cross-site or we do not want to send
cookies in this context, the change should be ignored. In that case,
we may want to change `credentials_mode` to `omit` to indicate that
the request explicitly does not intend to include cookies.
Bug: 324879760
Change-Id: I0272d9b8eee482a7be657959cc495afaeddbe222
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172901
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420069}