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

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

Issue 888713002: DataReductionProxyStatisticsPrefs should support WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DRPSettings owns DRPStatisticsPrefs Created 5 years, 11 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_test_utils.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc
index 18f87408f5b7e4ea6ac209e9a8d4c85ee4485a0c..e5ed5f2b77ee2d298123885838585cdd841c4dcd 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc
@@ -99,11 +99,6 @@ void DataReductionProxySettingsTestBase::SetUp() {
registry->RegisterBooleanPref(prefs::kDataReductionProxyWasEnabledBefore,
false);
- statistics_prefs_.reset(new DataReductionProxyStatisticsPrefs(
- &pref_service_,
- scoped_refptr<base::TestSimpleTaskRunner>(
- new base::TestSimpleTaskRunner()),
- base::TimeDelta()));
event_store_.reset(new DataReductionProxyEventStore(
scoped_refptr<base::TestSimpleTaskRunner>(
new base::TestSimpleTaskRunner())));
@@ -121,9 +116,17 @@ void DataReductionProxySettingsTestBase::SetUp() {
received_update->Insert(0, new base::StringValue(base::Int64ToString(i)));
}
last_update_time_ = base::Time::Now().LocalMidnight();
- statistics_prefs_->SetInt64(
+ scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs(
+ new DataReductionProxyStatisticsPrefs(
+ &pref_service_,
+ scoped_refptr<base::TestSimpleTaskRunner>(
+ new base::TestSimpleTaskRunner()),
+ base::TimeDelta()));
+ statistics_prefs->SetInt64(
prefs::kDailyHttpContentLengthLastUpdateDate,
last_update_time_.ToInternalValue());
+ settings_->SetDataReductionProxyStatisticsPrefs(
+ statistics_prefs.Pass());
expected_params_.reset(new TestDataReductionProxyParams(
DataReductionProxyParams::kAllowed |
DataReductionProxyParams::kFallbackAllowed |
@@ -165,7 +168,6 @@ void DataReductionProxySettingsTestBase::ResetSettings(bool allowed,
scoped_refptr<base::TestSimpleTaskRunner>(
new base::TestSimpleTaskRunner()), &net_log_, event_store_.get()));
settings_->configurator_ = configurator_.get();
- settings_->SetDataReductionProxyStatisticsPrefs(statistics_prefs_.get());
}
// Explicitly generate required instantiations.

Powered by Google App Engine
This is Rietveld 408576698