Use IPEndPoint instead of HostPortPair
Currently HostPortPair is used to keep the server IP address and port in
many places:
ExtraRequestCompleteInfo
CommonNetworkInfo
FtpResponseInfo
HttpResponseInfo
WebSocketHandshakeResponseInfo
ResourceResponseInfo
WebSocketHandshakeResponse
ClientSideDetectionHost::ShouldClassifyUrlRequest
NavigationHandleImpl
RenderViewHostTestWebContentsObserver
NavigationSimulatorImpl
URLFetcherCore
But this value is generated from IPEndPoint using
HostPortPair::FromIPEndPoint() in the following places:
HttpStreamParser::SendRequest()
QuicHttpStream::ProcessResponseHeaders()
SpdyHttpStream::SendRequest()
ChromeResourceDispatcherHostDelegate::RequestComplete()
FtpNetworkTransaction::DoCtrlConnectComplete()
WebSocketHttp2HandshakeStream::SendRequest()
These HostPortPair's host value is always IP address.
So this CL change them to use IPEndPoint.
Bug: 910516
Change-Id: Ieb698560c77232db0c019617a4863a8a103e783d
Reviewed-on: https://chromium-review.googlesource.com/c/1473094
Commit-Queue: Tsuyoshi Horo <[email protected]>
Reviewed-by: Eric Orth <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Adam Rice <[email protected]>
Cr-Commit-Position: refs/heads/master@{#633908}
diff --git a/net/websockets/websocket_http2_handshake_stream.cc b/net/websockets/websocket_http2_handshake_stream.cc
index f5e0ab8..343b4cd 100644
--- a/net/websockets/websocket_http2_handshake_stream.cc
+++ b/net/websockets/websocket_http2_handshake_stream.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
+#include "net/base/ip_endpoint.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
@@ -102,7 +103,7 @@
OnFailure("Error getting IP address.");
return result;
}
- http_response_info_->socket_address = HostPortPair::FromIPEndPoint(address);
+ http_response_info_->remote_endpoint = address;
auto request = std::make_unique<WebSocketHandshakeRequestInfo>(
request_info_->url, base::Time::Now());
@@ -378,7 +379,7 @@
DCHECK(http_response_info_);
WebSocketDispatchOnFinishOpeningHandshake(
connect_delegate_, request_info_->url, http_response_info_->headers,
- http_response_info_->socket_address, http_response_info_->response_time);
+ http_response_info_->remote_endpoint, http_response_info_->response_time);
}
void WebSocketHttp2HandshakeStream::OnFailure(const std::string& message) {