Index: chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h |
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h |
index 7178da6cafeedc4a5f47d31ecbe9dbd5277904f3..f44f56e54a16936bbffc00091bee6568fd881a94 100644 |
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h |
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h |
@@ -37,6 +37,42 @@ const unsigned int kNumDaysInHistorySummary = 30; |
COMPILE_ASSERT(kNumDaysInHistorySummary <= kNumDaysInHistory, |
DataReductionProxySettings_summary_too_long); |
+ // Values of the UMA DataReductionProxy.StartupState histogram. |
+ // This enum must remain synchronized with DataReductionProxyStartupState |
+ // in metrics/histograms/histograms.xml. |
+ enum ProxyStartupState { |
+ PROXY_NOT_AVAILABLE = 0, |
+ PROXY_DISABLED, |
+ PROXY_ENABLED, |
+ PROXY_STARTUP_STATE_COUNT, |
+ }; |
+ |
+ // Values of the UMA DataReductionProxy.ProbeURL histogram. |
+ // This enum must remain synchronized with |
+ // DataReductionProxyProbeURLFetchResult in metrics/histograms/histograms.xml. |
+ // TODO(marq): Rename these histogram buckets with s/DISABLED/RESTRICTED/, so |
+ // their names match the behavior they track. |
+ enum ProbeURLFetchResult { |
+ // The probe failed because the internet was disconnected. |
+ INTERNET_DISCONNECTED = 0, |
+ |
+ // The probe failed for any other reason, and as a result, the proxy was |
+ // disabled. |
+ FAILED_PROXY_DISABLED, |
+ |
+ // The probe failed, but the proxy was already restricted. |
+ FAILED_PROXY_ALREADY_DISABLED, |
+ |
+ // THe probe succeeded, and as a result the proxy was restricted. |
+ SUCCEEDED_PROXY_ENABLED, |
+ |
+ // The probe succeeded, but the proxy was already restricted. |
+ SUCCEEDED_PROXY_ALREADY_ENABLED, |
+ |
+ // This must always be last. |
+ PROBE_URL_FETCH_RESULT_COUNT |
+ }; |
+ |
} // namespace spdyproxy |
// Central point for configuring the data reduction proxy. |
@@ -172,6 +208,10 @@ class DataReductionProxySettings |
// Accessor for unit tests. |
std::vector<std::string> BypassRules() { return bypass_rules_;} |
+ // Virtualized for mocking |
+ virtual void RecordProbeURLFetchResult(spdyproxy::ProbeURLFetchResult result); |
+ virtual void RecordStartupState(spdyproxy::ProxyStartupState state); |
+ |
private: |
friend class DataReductionProxySettingsTestBase; |
friend class DataReductionProxySettingsTest; |