Embed net::AlternateProtocolUsage on HttpStreamRequest at HttpStreamFactory::JobController::OnStreamReady.

This is a sub-CL of https://crrev.com/c/3890050 which propagates  alternate_protocol_usage, the property this CL introduces,
to the devtools in order to show why Chrome uses a specific
transport protocol for HTTP semantics.

Bug: 1345536
Change-Id: Ie7150f8be01b7c479688351032d3c7f1ea29ab3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3897695
Reviewed-by: Yutaka Hirano <[email protected]>
Commit-Queue: Yoichiro Hibara <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1047939}
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index c6e4b2d..a86ae2f 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -553,6 +553,8 @@
   response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated();
   response_.alpn_negotiated_protocol =
       NextProtoToString(stream_request_->negotiated_protocol());
+  response_.alternate_protocol_usage =
+      stream_request_->alternate_protocol_usage();
   response_.was_fetched_via_spdy = stream_request_->using_spdy();
   response_.dns_aliases = stream_->GetDnsAliases();
   SetProxyInfoInReponse(used_proxy_info, &response_);