Set SiteForCookies in bruschetta::SimpleURLLoaderDownload::Download

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: I5131955112f29afd04a28aa9a187e7dcb5535c17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172865
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406356}
diff --git a/chrome/browser/ash/bruschetta/bruschetta_download.cc b/chrome/browser/ash/bruschetta/bruschetta_download.cc
index 3f3abc4..6d02ef4f 100644
--- a/chrome/browser/ash/bruschetta/bruschetta_download.cc
+++ b/chrome/browser/ash/bruschetta/bruschetta_download.cc
@@ -133,6 +133,7 @@
   auto path = scoped_temp_dir_->GetPath().Append("download");
   auto req = std::make_unique<network::ResourceRequest>();
   req->url = url_;
+  req->site_for_cookies = net::SiteForCookies::FromUrl(url_);
   loader_ = network::SimpleURLLoader::Create(std::move(req),
                                              kBruschettaTrafficAnnotation);
   network_context_ = std::make_unique<BruschettaNetworkContext>(profile);