Commit abd9da88 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove Net.BlockedTunnelResponse histograms.

They aren't in histograms.xml, and that has been the case for multiple
years, so they're presumably safe to remove.

Bug: 643569
Change-Id: I262be8f7b4c97a6e85b1f58ddb54fe56dd67772b
Reviewed-on: https://chromium-review.googlesource.com/1053872Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557610}
parent c2caed08
...@@ -223,7 +223,6 @@ int HttpProxyClientSocket::Read(IOBuffer* buf, ...@@ -223,7 +223,6 @@ int HttpProxyClientSocket::Read(IOBuffer* buf,
// We reach this case when the user cancels a 407 proxy auth prompt. // We reach this case when the user cancels a 407 proxy auth prompt.
// See http://crbug.com/8473. // See http://crbug.com/8473.
DCHECK_EQ(407, response_.headers->response_code()); DCHECK_EQ(407, response_.headers->response_code());
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
} }
...@@ -301,12 +300,6 @@ int HttpProxyClientSocket::DidDrainBodyForAuthRestart() { ...@@ -301,12 +300,6 @@ int HttpProxyClientSocket::DidDrainBodyForAuthRestart() {
return OK; return OK;
} }
void HttpProxyClientSocket::LogBlockedTunnelResponse() const {
ProxyClientSocket::LogBlockedTunnelResponse(
response_.headers->response_code(),
is_https_proxy_);
}
void HttpProxyClientSocket::DoCallback(int result) { void HttpProxyClientSocket::DoCallback(int result) {
DCHECK_NE(ERR_IO_PENDING, result); DCHECK_NE(ERR_IO_PENDING, result);
DCHECK(!user_callback_.is_null()); DCHECK(!user_callback_.is_null());
...@@ -470,10 +463,8 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) { ...@@ -470,10 +463,8 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) {
// sanitize the response. This still allows a rogue HTTPS proxy to // sanitize the response. This still allows a rogue HTTPS proxy to
// redirect an HTTPS site load to a similar-looking site, but no longer // redirect an HTTPS site load to a similar-looking site, but no longer
// allows it to impersonate the site the user requested. // allows it to impersonate the site the user requested.
if (!is_https_proxy_ || !SanitizeProxyRedirect(&response_)) { if (!is_https_proxy_ || !SanitizeProxyRedirect(&response_))
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
}
redirect_has_load_timing_info_ = transport_->GetLoadTimingInfo( redirect_has_load_timing_info_ = transport_->GetLoadTimingInfo(
http_stream_parser_->IsConnectionReused(), http_stream_parser_->IsConnectionReused(),
...@@ -487,10 +478,8 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) { ...@@ -487,10 +478,8 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) {
// authentication code is smart enough to avoid being tricked by an // authentication code is smart enough to avoid being tricked by an
// active network attacker. // active network attacker.
// The next state is intentionally not set as it should be STATE_NONE; // The next state is intentionally not set as it should be STATE_NONE;
if (!SanitizeProxyAuth(&response_)) { if (!SanitizeProxyAuth(&response_))
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
}
return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_); return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_);
default: default:
...@@ -500,7 +489,6 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) { ...@@ -500,7 +489,6 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) {
// 501 response bodies that contain a useful error message. For // 501 response bodies that contain a useful error message. For
// example, Squid uses a 404 response to report the DNS error: "The // example, Squid uses a 404 response to report the DNS error: "The
// domain name does not exist." // domain name does not exist."
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
} }
} }
......
...@@ -114,8 +114,6 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocket : public ProxyClientSocket { ...@@ -114,8 +114,6 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocket : public ProxyClientSocket {
int PrepareForAuthRestart(); int PrepareForAuthRestart();
int DidDrainBodyForAuthRestart(); int DidDrainBodyForAuthRestart();
void LogBlockedTunnelResponse() const;
void DoCallback(int result); void DoCallback(int result);
void OnIOComplete(int result); void OnIOComplete(int result);
......
...@@ -56,22 +56,6 @@ int ProxyClientSocket::HandleProxyAuthChallenge( ...@@ -56,22 +56,6 @@ int ProxyClientSocket::HandleProxyAuthChallenge(
return rv; return rv;
} }
// static
void ProxyClientSocket::LogBlockedTunnelResponse(int http_status_code,
bool is_https_proxy) {
if (is_https_proxy) {
UMA_HISTOGRAM_CUSTOM_ENUMERATION(
"Net.BlockedTunnelResponse.HttpsProxy",
HttpUtil::MapStatusCodeForHistogram(http_status_code),
HttpUtil::GetStatusCodesForHistogram());
} else {
UMA_HISTOGRAM_CUSTOM_ENUMERATION(
"Net.BlockedTunnelResponse.HttpProxy",
HttpUtil::MapStatusCodeForHistogram(http_status_code),
HttpUtil::GetStatusCodesForHistogram());
}
}
// static // static
bool ProxyClientSocket::SanitizeProxyAuth(HttpResponseInfo* response) { bool ProxyClientSocket::SanitizeProxyAuth(HttpResponseInfo* response) {
DCHECK(response && response->headers.get()); DCHECK(response && response->headers.get());
......
...@@ -74,10 +74,6 @@ class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket { ...@@ -74,10 +74,6 @@ class NET_EXPORT_PRIVATE ProxyClientSocket : public StreamSocket {
HttpResponseInfo* response, HttpResponseInfo* response,
const NetLogWithSource& net_log); const NetLogWithSource& net_log);
// Logs (to the log and in a histogram) a blocked CONNECT response.
static void LogBlockedTunnelResponse(int http_response_code,
bool is_https_proxy);
// When a proxy authentication response is received during tunnel // When a proxy authentication response is received during tunnel
// construction, this method should be called to strip everything // construction, this method should be called to strip everything
// but the auth header from the redirect response. If it returns // but the auth header from the redirect response. If it returns
......
...@@ -270,12 +270,6 @@ int QuicProxyClientSocket::GetLocalAddress(IPEndPoint* address) const { ...@@ -270,12 +270,6 @@ int QuicProxyClientSocket::GetLocalAddress(IPEndPoint* address) const {
: ERR_SOCKET_NOT_CONNECTED; : ERR_SOCKET_NOT_CONNECTED;
} }
void QuicProxyClientSocket::LogBlockedTunnelResponse() const {
ProxyClientSocket::LogBlockedTunnelResponse(
response_.headers->response_code(),
/* is_https_proxy = */ true);
}
void QuicProxyClientSocket::OnIOComplete(int result) { void QuicProxyClientSocket::OnIOComplete(int result) {
DCHECK_NE(STATE_DISCONNECTED, next_state_); DCHECK_NE(STATE_DISCONNECTED, next_state_);
int rv = DoLoop(result); int rv = DoLoop(result);
...@@ -419,10 +413,8 @@ int QuicProxyClientSocket::DoReadReplyComplete(int result) { ...@@ -419,10 +413,8 @@ int QuicProxyClientSocket::DoReadReplyComplete(int result) {
case 302: // Found / Moved Temporarily case 302: // Found / Moved Temporarily
// Try to return a sanitized response so we can follow auth redirects. // Try to return a sanitized response so we can follow auth redirects.
// If we can't, fail the tunnel connection. // If we can't, fail the tunnel connection.
if (!SanitizeProxyRedirect(&response_)) { if (!SanitizeProxyRedirect(&response_))
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
}
redirect_has_load_timing_info_ = redirect_has_load_timing_info_ =
GetLoadTimingInfo(&redirect_load_timing_info_); GetLoadTimingInfo(&redirect_load_timing_info_);
next_state_ = STATE_DISCONNECTED; next_state_ = STATE_DISCONNECTED;
...@@ -430,16 +422,13 @@ int QuicProxyClientSocket::DoReadReplyComplete(int result) { ...@@ -430,16 +422,13 @@ int QuicProxyClientSocket::DoReadReplyComplete(int result) {
case 407: // Proxy Authentication Required case 407: // Proxy Authentication Required
next_state_ = STATE_CONNECT_COMPLETE; next_state_ = STATE_CONNECT_COMPLETE;
if (!SanitizeProxyAuth(&response_)) { if (!SanitizeProxyAuth(&response_))
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
}
return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_); return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_);
default: default:
// Ignore response to avoid letting the proxy impersonate the target // Ignore response to avoid letting the proxy impersonate the target
// server. (See http://crbug.com/137891.) // server. (See http://crbug.com/137891.)
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
} }
} }
......
...@@ -91,8 +91,6 @@ class NET_EXPORT_PRIVATE QuicProxyClientSocket : public ProxyClientSocket { ...@@ -91,8 +91,6 @@ class NET_EXPORT_PRIVATE QuicProxyClientSocket : public ProxyClientSocket {
STATE_CONNECT_COMPLETE STATE_CONNECT_COMPLETE
}; };
void LogBlockedTunnelResponse() const;
void OnIOComplete(int result); // Callback used during connecting void OnIOComplete(int result); // Callback used during connecting
void OnReadComplete(int rv); void OnReadComplete(int rv);
void OnWriteComplete(int rv); void OnWriteComplete(int rv);
......
...@@ -268,12 +268,6 @@ int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const { ...@@ -268,12 +268,6 @@ int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const {
return spdy_stream_->GetLocalAddress(address); return spdy_stream_->GetLocalAddress(address);
} }
void SpdyProxyClientSocket::LogBlockedTunnelResponse() const {
ProxyClientSocket::LogBlockedTunnelResponse(
response_.headers->response_code(),
/* is_https_proxy = */ true);
}
void SpdyProxyClientSocket::RunCallback(CompletionOnceCallback callback, void SpdyProxyClientSocket::RunCallback(CompletionOnceCallback callback,
int result) const { int result) const {
std::move(callback).Run(result); std::move(callback).Run(result);
...@@ -406,10 +400,8 @@ int SpdyProxyClientSocket::DoReadReplyComplete(int result) { ...@@ -406,10 +400,8 @@ int SpdyProxyClientSocket::DoReadReplyComplete(int result) {
case 302: // Found / Moved Temporarily case 302: // Found / Moved Temporarily
// Try to return a sanitized response so we can follow auth redirects. // Try to return a sanitized response so we can follow auth redirects.
// If we can't, fail the tunnel connection. // If we can't, fail the tunnel connection.
if (!SanitizeProxyRedirect(&response_)) { if (!SanitizeProxyRedirect(&response_))
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
}
redirect_has_load_timing_info_ = redirect_has_load_timing_info_ =
spdy_stream_->GetLoadTimingInfo(&redirect_load_timing_info_); spdy_stream_->GetLoadTimingInfo(&redirect_load_timing_info_);
...@@ -420,16 +412,13 @@ int SpdyProxyClientSocket::DoReadReplyComplete(int result) { ...@@ -420,16 +412,13 @@ int SpdyProxyClientSocket::DoReadReplyComplete(int result) {
case 407: // Proxy Authentication Required case 407: // Proxy Authentication Required
next_state_ = STATE_OPEN; next_state_ = STATE_OPEN;
if (!SanitizeProxyAuth(&response_)) { if (!SanitizeProxyAuth(&response_))
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
}
return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_); return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_);
default: default:
// Ignore response to avoid letting the proxy impersonate the target // Ignore response to avoid letting the proxy impersonate the target
// server. (See http://crbug.com/137891.) // server. (See http://crbug.com/137891.)
LogBlockedTunnelResponse();
return ERR_TUNNEL_CONNECTION_FAILED; return ERR_TUNNEL_CONNECTION_FAILED;
} }
} }
......
...@@ -116,8 +116,6 @@ class NET_EXPORT_PRIVATE SpdyProxyClientSocket : public ProxyClientSocket, ...@@ -116,8 +116,6 @@ class NET_EXPORT_PRIVATE SpdyProxyClientSocket : public ProxyClientSocket,
STATE_CLOSED STATE_CLOSED
}; };
void LogBlockedTunnelResponse() const;
// Calls |callback.Run(result)|. Used to run a callback posted to the // Calls |callback.Run(result)|. Used to run a callback posted to the
// message loop. // message loop.
void RunCallback(CompletionOnceCallback callback, int result) const; void RunCallback(CompletionOnceCallback callback, int result) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment