Use schemeful variant of HostResolver::CreateRequest in //net/quic
Specifically, this CL changes callers of HostResolver::CreateRequest in
//net/quic to pass url::SchemeHostPort instead of HostPortPair.
Because I changed the signature of QuicStreamRequest::Request to use
url::SchemeHostPort, callers in //net/http needed to be updated as well.
In these QUIC-specific paths, I opted to synthesize a
url::SchemeHostPort from the existing HostPortPair.
Bug: 1206799
Change-Id: Ibd1e75d634bb395e22eef98a278d9bbadb602e63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2997443
Commit-Queue: Dan McArdle <[email protected]>
Reviewed-by: Eric Orth <[email protected]>
Cr-Commit-Position: refs/heads/master@{#900138}
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 98229ce..d1310ff 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -78,6 +78,8 @@
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "url/scheme_host_port.h"
+#include "url/url_constants.h"
using std::string;
using testing::_;
@@ -433,10 +435,12 @@
TestCompletionCallback callback;
session_->CryptoConnect(callback.callback());
stream_ = std::make_unique<QuicHttpStream>(
- session_->CreateHandle(HostPortPair("www.example.org", 443)),
+ session_->CreateHandle(
+ url::SchemeHostPort(url::kHttpsScheme, "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(
+ url::SchemeHostPort(url::kHttpsScheme, "www.example.org", 443)),
std::vector<std::string>() /* dns_aliases */);
push_promise_[":path"] = "/bar";
push_promise_[":authority"] = "www.example.org";
@@ -827,9 +831,9 @@
stream_->SendRequest(headers_, &response_, callback_.callback()));
// Start a second request.
- QuicHttpStream stream2(
- session_->CreateHandle(HostPortPair("www.example.org", 443)),
- {} /* dns_aliases */);
+ QuicHttpStream stream2(session_->CreateHandle(url::SchemeHostPort(
+ url::kHttpsScheme, "www.example.org", 443)),
+ {} /* dns_aliases */);
TestCompletionCallback callback2;
EXPECT_EQ(OK,
stream2.InitializeStream(&request_, true, DEFAULT_PRIORITY,
@@ -1040,7 +1044,8 @@
DEFAULT_PRIORITY, &spdy_request_header_frame_length));
auto stream = std::make_unique<QuicHttpStream>(
- session_->CreateHandle(HostPortPair("www.example.org/foo", 443)),
+ session_->CreateHandle(
+ url::SchemeHostPort(url::kHttpsScheme, "www.example.org/foo", 443)),
std::vector<std::string>() /* dns_aliases */);
EXPECT_THAT(stream->InitializeStream(&request_, true, DEFAULT_PRIORITY,
net_log_.bound(), callback_.callback()),