diff options
author | bengr@chromium.org <bengr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-10 01:21:39 +0000 |
---|---|---|
committer | bengr@chromium.org <bengr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-10 01:23:02 +0000 |
commit | f09f968f9f0ba892cadca8574a382c41d4a979f9 (patch) | |
tree | 83ad7bc619bf6128199068d6b87776e58a6bfcef /net/proxy/proxy_service.cc | |
parent | 7a6ecef5cd867b2232c7ab9a0f00310ddd271160 (diff) | |
download | chromium_src-f09f968f9f0ba892cadca8574a382c41d4a979f9.zip chromium_src-f09f968f9f0ba892cadca8574a382c41d4a979f9.tar.gz chromium_src-f09f968f9f0ba892cadca8574a382c41d4a979f9.tar.bz2 |
Removed data compression UMA from ProxyService
This change removes logic specific to the data reduction proxy
from net::ProxyService and net::ProxyServer. To do so, it introduces
a new method, net::NetworkDelegate::OnProxyFallback.
BUG=396699
Review URL: https://codereview.chromium.org/425163004
Cr-Commit-Position: refs/heads/master@{#288603}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service.cc')
-rw-r--r-- | net/proxy/proxy_service.cc | 69 |
1 files changed, 7 insertions, 62 deletions
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index a1d634a7..4006110 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -13,8 +13,6 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" -#include "base/metrics/histogram.h" -#include "base/metrics/sparse_histogram.h" #include "base/strings/string_util.h" #include "base/thread_task_runner_handle.h" #include "base/values.h" @@ -1197,6 +1195,7 @@ int ProxyService::ReconsiderProxyAfterError(const GURL& url, // want to re-run ResolveProxy in two cases: 1) we have a new config, or 2) a // direct connection failed and we never tried the current config. + DCHECK(result); bool re_resolve = result->config_id_ != config_.id(); if (re_resolve) { @@ -1207,24 +1206,17 @@ int ProxyService::ReconsiderProxyAfterError(const GURL& url, network_delegate, net_log); } -#if defined(SPDY_PROXY_AUTH_ORIGIN) - if (result->proxy_server().isDataReductionProxy()) { - RecordDataReductionProxyBypassInfo( - true, false, result->proxy_server(), NETWORK_ERROR); - RecordDataReductionProxyBypassOnNetworkError( - true, result->proxy_server(), net_error); - } else if (result->proxy_server().isDataReductionProxyFallback()) { - RecordDataReductionProxyBypassInfo( - false, false, result->proxy_server(), NETWORK_ERROR); - RecordDataReductionProxyBypassOnNetworkError( - false, result->proxy_server(), net_error); - } -#endif + DCHECK(!result->is_empty()); + ProxyServer bad_proxy = result->proxy_server(); // We don't have new proxy settings to try, try to fallback to the next proxy // in the list. bool did_fallback = result->Fallback(net_log); + if (network_delegate) { + network_delegate->NotifyProxyFallback(bad_proxy, net_error, did_fallback); + } + // Return synchronous failure if there is nothing left to fall-back to. // TODO(eroman): This is a yucky API, clean it up. return did_fallback ? OK : ERR_FAILED; @@ -1459,53 +1451,6 @@ scoped_ptr<ProxyService::PacPollPolicy> return scoped_ptr<PacPollPolicy>(new DefaultPollPolicy()); } -void ProxyService::RecordDataReductionProxyBypassInfo( - bool is_primary, - bool bypass_all, - const ProxyServer& proxy_server, - DataReductionProxyBypassType bypass_type) const { - // Only record UMA if the proxy isn't already on the retry list. - if (proxy_retry_info_.find(proxy_server.ToURI()) != proxy_retry_info_.end()) - return; - - if (bypass_all) { - if (is_primary) { - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.BlockTypePrimary", - bypass_type, BYPASS_EVENT_TYPE_MAX); - } else { - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.BlockTypeFallback", - bypass_type, BYPASS_EVENT_TYPE_MAX); - } - } else { - if (is_primary) { - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.BypassTypePrimary", - bypass_type, BYPASS_EVENT_TYPE_MAX); - } else { - UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.BypassTypeFallback", - bypass_type, BYPASS_EVENT_TYPE_MAX); - } - } -} - -void ProxyService::RecordDataReductionProxyBypassOnNetworkError( - bool is_primary, - const ProxyServer& proxy_server, - int net_error) { - // Only record UMA if the proxy isn't already on the retry list. - if (proxy_retry_info_.find(proxy_server.ToURI()) != proxy_retry_info_.end()) - return; - - if (is_primary) { - UMA_HISTOGRAM_SPARSE_SLOWLY( - "DataReductionProxy.BypassOnNetworkErrorPrimary", - std::abs(net_error)); - return; - } - UMA_HISTOGRAM_SPARSE_SLOWLY( - "DataReductionProxy.BypassOnNetworkErrorFallback", - std::abs(net_error)); -} - void ProxyService::OnProxyConfigChanged( const ProxyConfig& config, ProxyConfigService::ConfigAvailability availability) { |