Net: Support plumbing of CNAME aliases for QUIC with aim of ad-tag use.

This change adds support for plumbing CNAME aliases through from
net::AddressList to net::QuicHttpStream.

The overall project aims to expose aliases read from DNS CNAME records
to the SubresourceFilter for the purposes of ad-tagging and
ad-blocking.

Previous network CLs have plumbed the aliases from their extraction at
DNS resolution all the way through to network::mojom::URLResponseHead,
but the pathway to net::HttpStream was fully implemented only for
HTTP/1.1 and SPDY.

This CL also adds DNS alias support for IP pooling of QUIC sessions,
along with the necessary accessors and tests.

Relevant tests:
net:net_unittests
out/Default/net_unittests -gtest_filter=*Quic*Dns*Alias*

Bug: 1151047
Change-Id: I5375ad591f71547acca870935b0077d0ac69d2a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2588889
Commit-Queue: Cammie Smith Barnes <[email protected]>
Reviewed-by: Bence Béky <[email protected]>
Reviewed-by: Matt Menke <[email protected]>
Cr-Commit-Position: refs/heads/master@{#859167}
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index ee217833..86da050f 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -434,9 +434,11 @@
     TestCompletionCallback callback;
     session_->CryptoConnect(callback.callback());
     stream_ = std::make_unique<QuicHttpStream>(
-        session_->CreateHandle(HostPortPair("www.example.org", 443)));
+        session_->CreateHandle(HostPortPair("www.example.org", 443)),
+        std::vector<std::string>() /* dns_aliases */);
     promised_stream_ = std::make_unique<QuicHttpStream>(
-        session_->CreateHandle(HostPortPair("www.example.org", 443)));
+        session_->CreateHandle(HostPortPair("www.example.org", 443)),
+        std::vector<std::string>() /* dns_aliases */);
     push_promise_[":path"] = "/bar";
     push_promise_[":authority"] = "www.example.org";
     push_promise_[":version"] = "HTTP/1.1";
@@ -828,7 +830,8 @@
 
   // Start a second request.
   QuicHttpStream stream2(
-      session_->CreateHandle(HostPortPair("www.example.org", 443)));
+      session_->CreateHandle(HostPortPair("www.example.org", 443)),
+      {} /* dns_aliases */);
   TestCompletionCallback callback2;
   EXPECT_EQ(OK,
             stream2.InitializeStream(&request_, true, DEFAULT_PRIORITY,
@@ -1039,7 +1042,8 @@
       DEFAULT_PRIORITY, &spdy_request_header_frame_length));
 
   auto stream = std::make_unique<QuicHttpStream>(
-      session_->CreateHandle(HostPortPair("www.example.org/foo", 443)));
+      session_->CreateHandle(HostPortPair("www.example.org/foo", 443)),
+      std::vector<std::string>() /* dns_aliases */);
   EXPECT_THAT(stream->InitializeStream(&request_, true, DEFAULT_PRIORITY,
                                        net_log_.bound(), callback_.callback()),
               IsOk());