Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc

Issue 893003002: Data Reduction Proxy class ownership updates and Settings cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sgurun CR comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
index ebc3f13feb22270c864dab0e3dadf69f99c8db1d..081c49f51c26d0f8f7b01d37b1d9fdd17739d8b7 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
@@ -6,66 +6,24 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
-#include "base/metrics/sparse_histogram.h"
#include "base/prefs/pref_member.h"
#include "base/prefs/pref_service.h"
-#include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
-#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.h"
-#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
-#include "net/base/host_port_pair.h"
-#include "net/base/load_flags.h"
-#include "net/base/net_errors.h"
-#include "net/base/net_util.h"
-#include "net/http/http_network_session.h"
-#include "net/http/http_response_headers.h"
-#include "net/proxy/proxy_server.h"
-#include "net/url_request/url_fetcher.h"
-#include "net/url_request/url_fetcher_delegate.h"
-#include "net/url_request/url_request_context_getter.h"
-#include "net/url_request/url_request_status.h"
-#include "url/gurl.h"
-
-
-using base::StringPrintf;
namespace {
-// Values of the UMA DataReductionProxy.NetworkChangeEvents histograms.
-// This enum must remain synchronized with the enum of the same
-// name in metrics/histograms/histograms.xml.
-enum DataReductionProxyNetworkChangeEvent {
- IP_CHANGED = 0, // The client IP address changed.
- DISABLED_ON_VPN = 1, // The proxy is disabled because a VPN is running.
- CHANGE_EVENT_COUNT = 2 // This must always be last.
-};
-
// Key of the UMA DataReductionProxy.StartupState histogram.
const char kUMAProxyStartupStateHistogram[] =
"DataReductionProxy.StartupState";
-// Key of the UMA DataReductionProxy.ProbeURL histogram.
-const char kUMAProxyProbeURL[] = "DataReductionProxy.ProbeURL";
-
-// Key of the UMA DataReductionProxy.ProbeURLNetError histogram.
-const char kUMAProxyProbeURLNetError[] = "DataReductionProxy.ProbeURLNetError";
-
-// Record a network change event.
-void RecordNetworkChangeEvent(DataReductionProxyNetworkChangeEvent event) {
- UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.NetworkChangeEvents",
- event,
- CHANGE_EVENT_COUNT);
-}
-
int64 GetInt64PrefValue(const base::ListValue& list_value, size_t index) {
int64 val = 0;
std::string pref_value;
@@ -89,25 +47,19 @@ bool IsEnabledOnCommandLine() {
namespace data_reduction_proxy {
-DataReductionProxySettings::DataReductionProxySettings(
- scoped_ptr<DataReductionProxyParams> params)
- : restricted_by_carrier_(false),
- enabled_by_user_(false),
- disabled_on_vpn_(false),
- unreachable_(false),
+DataReductionProxySettings::DataReductionProxySettings()
+ : unreachable_(false),
+ allowed_(false),
+ alternative_allowed_(false),
+ promo_allowed_(false),
prefs_(NULL),
- url_request_context_getter_(NULL),
- net_log_(NULL),
event_store_(NULL),
- configurator_(NULL) {
- DCHECK(params.get());
- config_.reset(new DataReductionProxyConfig(params.Pass()));
+ config_(nullptr) {
}
DataReductionProxySettings::~DataReductionProxySettings() {
- if (params()->allowed())
+ if (allowed_)
spdy_proxy_auth_enabled_.Destroy();
- net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
}
void DataReductionProxySettings::InitPrefMembers() {
@@ -125,56 +77,31 @@ void DataReductionProxySettings::InitPrefMembers() {
base::Unretained(this)));
}
+void DataReductionProxySettings::UpdateConfigValues() {
+ DCHECK(config_);
+ allowed_ = config_->params()->allowed();
+ alternative_allowed_ = config_->params()->alternative_allowed();
+ promo_allowed_ = config_->params()->promo_allowed();
+ primary_origin_ = config_->params()->origin().ToURI();
+}
+
void DataReductionProxySettings::InitDataReductionProxySettings(
PrefService* prefs,
- scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs,
- net::URLRequestContextGetter* url_request_context_getter,
- net::NetLog* net_log,
- DataReductionProxyEventStore* event_store,
- bool enable_quic) {
+ DataReductionProxyIOData* io_data,
+ scoped_ptr<DataReductionProxyService> data_reduction_proxy_service) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(prefs);
- DCHECK(!statistics_prefs_);
- DCHECK(url_request_context_getter);
- DCHECK(event_store);
+ DCHECK(io_data);
+ DCHECK(io_data->config());
+ DCHECK(io_data->event_store());
+ DCHECK(data_reduction_proxy_service.get());
prefs_ = prefs;
- statistics_prefs_ = statistics_prefs.Pass();
- url_request_context_getter_ = url_request_context_getter;
- net_log_ = net_log;
- event_store_ = event_store;
+ config_ = io_data->config();
+ event_store_ = io_data->event_store();
+ data_reduction_proxy_service_ = data_reduction_proxy_service.Pass();
InitPrefMembers();
+ UpdateConfigValues();
RecordDataReductionInit();
-
- // Disable the proxy if it is not allowed to be used.
- if (!params()->allowed())
- return;
-
- params()->EnableQuic(enable_quic);
-
- AddDefaultProxyBypassRules();
- net::NetworkChangeNotifier::AddIPAddressObserver(this);
-}
-
-void DataReductionProxySettings::SetDataReductionProxyStatisticsPrefs(
- scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs) {
- statistics_prefs_ = statistics_prefs.Pass();
-}
-
-void DataReductionProxySettings::EnableCompressionStatisticsLogging(
- PrefService* prefs,
- scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
- const base::TimeDelta& commit_delay) {
- DCHECK(!statistics_prefs_);
- statistics_prefs_.reset(
- new DataReductionProxyStatisticsPrefs(
- prefs, ui_task_runner, commit_delay));
-}
-
-base::WeakPtr<DataReductionProxyStatisticsPrefs>
-DataReductionProxySettings::statistics_prefs() {
- if (statistics_prefs_)
- return statistics_prefs_->GetWeakPtr();
- return base::WeakPtr<DataReductionProxyStatisticsPrefs>();
}
void DataReductionProxySettings::SetOnDataReductionEnabledCallback(
@@ -183,12 +110,6 @@ void DataReductionProxySettings::SetOnDataReductionEnabledCallback(
on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled());
}
-void DataReductionProxySettings::SetProxyConfigurator(
- DataReductionProxyConfigurator* configurator) {
- DCHECK(configurator);
- configurator_ = configurator;
-}
-
bool DataReductionProxySettings::IsDataReductionProxyEnabled() {
return spdy_proxy_auth_enabled_.GetValue() || IsEnabledOnCommandLine();
}
@@ -205,7 +126,7 @@ bool DataReductionProxySettings::IsDataReductionProxyManaged() {
void DataReductionProxySettings::SetDataReductionProxyEnabled(bool enabled) {
DCHECK(thread_checker_.CalledOnValidThread());
// Prevent configuring the proxy when it is not allowed to be used.
- if (!params()->allowed())
+ if (!allowed_)
return;
if (spdy_proxy_auth_enabled_.GetValue() != enabled) {
@@ -218,7 +139,7 @@ void DataReductionProxySettings::SetDataReductionProxyAlternativeEnabled(
bool enabled) {
DCHECK(thread_checker_.CalledOnValidThread());
// Prevent configuring the proxy when it is not allowed to be used.
- if (!params()->alternative_allowed())
+ if (!alternative_allowed_)
return;
if (data_reduction_proxy_alternative_enabled_.GetValue() != enabled) {
data_reduction_proxy_alternative_enabled_.SetValue(enabled);
@@ -228,9 +149,10 @@ void DataReductionProxySettings::SetDataReductionProxyAlternativeEnabled(
int64 DataReductionProxySettings::GetDataReductionLastUpdateTime() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(statistics_prefs_);
+ DCHECK(data_reduction_proxy_service_->statistics_prefs());
int64 last_update_internal =
- statistics_prefs_->GetInt64(prefs::kDailyHttpContentLengthLastUpdateDate);
+ data_reduction_proxy_service_->statistics_prefs()->GetInt64(
+ prefs::kDailyHttpContentLengthLastUpdateDate);
base::Time last_update = base::Time::FromInternalValue(last_update_internal);
return static_cast<int64>(last_update.ToJsTime());
}
@@ -256,157 +178,36 @@ DataReductionProxySettings::GetDailyReceivedContentLengths() {
return GetDailyContentLengths(prefs::kDailyHttpReceivedContentLength);
}
-void DataReductionProxySettings::OnURLFetchComplete(
- const net::URLFetcher* source) {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- DCHECK(source == fetcher_.get());
- net::URLRequestStatus status = source->GetStatus();
-
- if (event_store_) {
- event_store_->EndCanaryRequest(bound_net_log_, status.error());
- }
-
- if (status.status() == net::URLRequestStatus::FAILED) {
- if (status.error() == net::ERR_INTERNET_DISCONNECTED) {
- RecordProbeURLFetchResult(INTERNET_DISCONNECTED);
- return;
- }
- // TODO(bengr): Remove once we understand the reasons probes are failing.
- // Probe errors are either due to fetcher-level errors or modified
- // responses. This only tracks the former.
- UMA_HISTOGRAM_SPARSE_SLOWLY(
- kUMAProxyProbeURLNetError, std::abs(status.error()));
- }
-
- std::string response;
- source->GetResponseAsString(&response);
-
- if ("OK" == response.substr(0, 2)) {
- DVLOG(1) << "The data reduction proxy is unrestricted.";
-
- if (enabled_by_user_) {
- if (restricted_by_carrier_) {
- // The user enabled the proxy, but sometime previously in the session,
- // the network operator had blocked the canary and restricted the user.
- // The current network doesn't block the canary, so don't restrict the
- // proxy configurations.
- SetProxyConfigs(true /* enabled */,
- IsDataReductionProxyAlternativeEnabled(),
- false /* restricted */,
- false /* at_startup */);
- RecordProbeURLFetchResult(SUCCEEDED_PROXY_ENABLED);
- } else {
- RecordProbeURLFetchResult(SUCCEEDED_PROXY_ALREADY_ENABLED);
- }
- }
- restricted_by_carrier_ = false;
- return;
- }
- DVLOG(1) << "The data reduction proxy is restricted to the configured "
- << "fallback proxy.";
- if (enabled_by_user_) {
- if (!restricted_by_carrier_) {
- // Restrict the proxy.
- SetProxyConfigs(true /* enabled */,
- IsDataReductionProxyAlternativeEnabled(),
- true /* restricted */,
- false /* at_startup */);
- RecordProbeURLFetchResult(FAILED_PROXY_DISABLED);
- } else {
- RecordProbeURLFetchResult(FAILED_PROXY_ALREADY_DISABLED);
- }
- }
- restricted_by_carrier_ = true;
-}
-
PrefService* DataReductionProxySettings::GetOriginalProfilePrefs() {
DCHECK(thread_checker_.CalledOnValidThread());
return prefs_;
}
-void DataReductionProxySettings::AddDefaultProxyBypassRules() {
- // localhost
- DCHECK(configurator_);
- configurator_->AddHostPatternToBypass("<local>");
- // RFC6890 loopback addresses.
- // TODO(tbansal): Remove this once crbug/446705 is fixed.
- configurator_->AddHostPatternToBypass("127.0.0.0/8");
-
- // RFC6890 current network (only valid as source address).
- configurator_->AddHostPatternToBypass("0.0.0.0/8");
-
- // RFC1918 private addresses.
- configurator_->AddHostPatternToBypass("10.0.0.0/8");
- configurator_->AddHostPatternToBypass("172.16.0.0/12");
- configurator_->AddHostPatternToBypass("192.168.0.0/16");
-
- // RFC3513 unspecified address.
- configurator_->AddHostPatternToBypass("::/128");
-
- // RFC4193 private addresses.
- configurator_->AddHostPatternToBypass("fc00::/7");
- // IPV6 probe addresses.
- configurator_->AddHostPatternToBypass("*-ds.metric.gstatic.com");
- configurator_->AddHostPatternToBypass("*-v4.metric.gstatic.com");
-}
-
-void DataReductionProxySettings::LogProxyState(
- bool enabled, bool restricted, bool at_startup) {
- // This must stay a LOG(WARNING); the output is used in processing customer
- // feedback.
- const char kAtStartup[] = "at startup";
- const char kByUser[] = "by user action";
- const char kOn[] = "ON";
- const char kOff[] = "OFF";
- const char kRestricted[] = "(Restricted)";
- const char kUnrestricted[] = "(Unrestricted)";
-
- std::string annotated_on =
- kOn + std::string(" ") + (restricted ? kRestricted : kUnrestricted);
-
- LOG(WARNING) << "SPDY proxy " << (enabled ? annotated_on : kOff)
- << " " << (at_startup ? kAtStartup : kByUser);
-}
-
-void DataReductionProxySettings::OnIPAddressChanged() {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (enabled_by_user_) {
- DCHECK(params()->allowed());
- RecordNetworkChangeEvent(IP_CHANGED);
- if (DisableIfVPN())
- return;
- if (IsDataReductionProxyAlternativeEnabled() &&
- !params()->alternative_fallback_allowed()) {
- return;
- }
- ProbeWhetherDataReductionProxyIsAvailable();
- }
-}
-
void DataReductionProxySettings::OnProxyEnabledPrefChange() {
DCHECK(thread_checker_.CalledOnValidThread());
if (!on_data_reduction_proxy_enabled_.is_null())
on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled());
- if (!params()->allowed())
+ if (!allowed_)
return;
MaybeActivateDataReductionProxy(false);
}
void DataReductionProxySettings::OnProxyAlternativeEnabledPrefChange() {
DCHECK(thread_checker_.CalledOnValidThread());
- if (!params()->alternative_allowed())
+ if (!alternative_allowed_)
return;
MaybeActivateDataReductionProxy(false);
}
void DataReductionProxySettings::ResetDataReductionStatistics() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(statistics_prefs_);
+ DCHECK(data_reduction_proxy_service_->statistics_prefs());
base::ListValue* original_update =
- statistics_prefs_->GetList(prefs::kDailyHttpOriginalContentLength);
+ data_reduction_proxy_service_->statistics_prefs()->GetList(
+ prefs::kDailyHttpOriginalContentLength);
base::ListValue* received_update =
- statistics_prefs_->GetList(prefs::kDailyHttpReceivedContentLength);
+ data_reduction_proxy_service_->statistics_prefs()->GetList(
+ prefs::kDailyHttpReceivedContentLength);
original_update->Clear();
received_update->Clear();
for (size_t i = 0; i < kNumDaysInHistory; ++i) {
@@ -432,54 +233,15 @@ void DataReductionProxySettings::MaybeActivateDataReductionProxy(
ResetDataReductionStatistics();
}
// Configure use of the data reduction proxy if it is enabled.
- enabled_by_user_= IsDataReductionProxyEnabled();
- SetProxyConfigs(enabled_by_user_ && !disabled_on_vpn_,
- IsDataReductionProxyAlternativeEnabled(),
- restricted_by_carrier_,
- at_startup);
-
- // Check if the proxy has been restricted explicitly by the carrier.
- if (enabled_by_user_ && !disabled_on_vpn_ &&
- !(IsDataReductionProxyAlternativeEnabled() &&
- !params()->alternative_fallback_allowed())) {
- ProbeWhetherDataReductionProxyIsAvailable();
- }
-}
-
-void DataReductionProxySettings::SetProxyConfigs(bool enabled,
- bool alternative_enabled,
- bool restricted,
- bool at_startup) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(configurator_);
-
- LogProxyState(enabled, restricted, at_startup);
- // The alternative is only configured if the standard configuration is
- // is enabled.
- if (enabled & !params()->holdback()) {
- if (alternative_enabled) {
- configurator_->Enable(restricted,
- !params()->alternative_fallback_allowed(),
- params()->alt_origin().ToURI(),
- std::string(),
- params()->ssl_origin().ToURI());
- } else {
- configurator_->Enable(restricted,
- !params()->fallback_allowed(),
- params()->origin().ToURI(),
- params()->fallback_origin().ToURI(),
- std::string());
- }
- } else {
- configurator_->Disable();
- }
+ config_->SetProxyPrefs(IsDataReductionProxyEnabled(),
+ IsDataReductionProxyAlternativeEnabled(), at_startup);
}
// Metrics methods
void DataReductionProxySettings::RecordDataReductionInit() {
DCHECK(thread_checker_.CalledOnValidThread());
ProxyStartupState state = PROXY_NOT_AVAILABLE;
- if (params()->allowed()) {
+ if (allowed_) {
if (IsDataReductionProxyEnabled())
state = PROXY_ENABLED;
else
@@ -489,31 +251,19 @@ void DataReductionProxySettings::RecordDataReductionInit() {
RecordStartupState(state);
}
-void DataReductionProxySettings::RecordProbeURLFetchResult(
- ProbeURLFetchResult result) {
- UMA_HISTOGRAM_ENUMERATION(kUMAProxyProbeURL,
- result,
- PROBE_URL_FETCH_RESULT_COUNT);
-}
-
void DataReductionProxySettings::RecordStartupState(ProxyStartupState state) {
UMA_HISTOGRAM_ENUMERATION(kUMAProxyStartupStateHistogram,
state,
PROXY_STARTUP_STATE_COUNT);
}
-void DataReductionProxySettings::GetNetworkList(
- net::NetworkInterfaceList* interfaces,
- int policy) {
- net::GetNetworkList(interfaces, policy);
-}
-
DataReductionProxySettings::ContentLengthList
DataReductionProxySettings::GetDailyContentLengths(const char* pref_name) {
DCHECK(thread_checker_.CalledOnValidThread());
DataReductionProxySettings::ContentLengthList content_lengths;
- DCHECK(statistics_prefs_);
- const base::ListValue* list_value = statistics_prefs_->GetList(pref_name);
+ DCHECK(data_reduction_proxy_service_->statistics_prefs());
+ const base::ListValue* list_value =
+ data_reduction_proxy_service_->statistics_prefs()->GetList(pref_name);
if (list_value->GetSize() == kNumDaysInHistory) {
for (size_t i = 0; i < kNumDaysInHistory; ++i) {
content_lengths.push_back(GetInt64PrefValue(*list_value, i));
@@ -529,12 +279,14 @@ void DataReductionProxySettings::GetContentLengths(
int64* last_update_time) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_LE(days, kNumDaysInHistory);
- DCHECK(statistics_prefs_);
+ DCHECK(data_reduction_proxy_service_->statistics_prefs());
const base::ListValue* original_list =
- statistics_prefs_->GetList(prefs::kDailyHttpOriginalContentLength);
+ data_reduction_proxy_service_->statistics_prefs()->GetList(
+ prefs::kDailyHttpOriginalContentLength);
const base::ListValue* received_list =
- statistics_prefs_->GetList(prefs::kDailyHttpReceivedContentLength);
+ data_reduction_proxy_service_->statistics_prefs()->GetList(
+ prefs::kDailyHttpReceivedContentLength);
if (original_list->GetSize() != kNumDaysInHistory ||
received_list->GetSize() != kNumDaysInHistory) {
@@ -555,80 +307,8 @@ void DataReductionProxySettings::GetContentLengths(
*original_content_length = orig;
*received_content_length = recv;
*last_update_time =
- statistics_prefs_->GetInt64(prefs::kDailyHttpContentLengthLastUpdateDate);
-}
-
-net::URLFetcher* DataReductionProxySettings::GetBaseURLFetcher(
- const GURL& gurl,
- int load_flags) {
-
- net::URLFetcher* fetcher = net::URLFetcher::Create(gurl,
- net::URLFetcher::GET,
- this);
- fetcher->SetLoadFlags(load_flags);
- DCHECK(url_request_context_getter_);
- fetcher->SetRequestContext(url_request_context_getter_);
- // Configure max retries to be at most kMaxRetries times for 5xx errors.
- static const int kMaxRetries = 5;
- fetcher->SetMaxRetriesOn5xx(kMaxRetries);
- fetcher->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries);
- return fetcher;
-}
-
-
-net::URLFetcher*
-DataReductionProxySettings::GetURLFetcherForAvailabilityCheck() {
- return GetBaseURLFetcher(params()->probe_url(),
- net::LOAD_DISABLE_CACHE | net::LOAD_BYPASS_PROXY);
-}
-
-
-void DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() {
- net::URLFetcher* fetcher = GetURLFetcherForAvailabilityCheck();
- if (!fetcher)
- return;
- fetcher_.reset(fetcher);
-
- bound_net_log_ = net::BoundNetLog::Make(
- net_log_, net::NetLog::SOURCE_DATA_REDUCTION_PROXY);
- if (event_store_) {
- event_store_->BeginCanaryRequest(bound_net_log_,
- fetcher_->GetOriginalURL());
- }
-
- fetcher_->Start();
-}
-
-bool DataReductionProxySettings::DisableIfVPN() {
- net::NetworkInterfaceList network_interfaces;
- GetNetworkList(&network_interfaces, 0);
- // VPNs use a "tun" interface, so the presence of a "tun" interface indicates
- // a VPN is in use.
- // TODO(kundaji): Verify this works on Windows.
- const std::string vpn_interface_name_prefix = "tun";
- for (size_t i = 0; i < network_interfaces.size(); ++i) {
- std::string interface_name = network_interfaces[i].name;
- if (LowerCaseEqualsASCII(
- interface_name.begin(),
- interface_name.begin() + vpn_interface_name_prefix.size(),
- vpn_interface_name_prefix.c_str())) {
- SetProxyConfigs(false,
- IsDataReductionProxyAlternativeEnabled(),
- false,
- false);
- disabled_on_vpn_ = true;
- RecordNetworkChangeEvent(DISABLED_ON_VPN);
- return true;
- }
- }
- if (disabled_on_vpn_) {
- SetProxyConfigs(enabled_by_user_,
- IsDataReductionProxyAlternativeEnabled(),
- restricted_by_carrier_,
- false);
- }
- disabled_on_vpn_ = false;
- return false;
+ data_reduction_proxy_service_->statistics_prefs()->GetInt64(
+ prefs::kDailyHttpContentLengthLastUpdateDate);
}
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698