| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc
|
| index 1b28d5d7143431b346983af40e954d722b8eca85..93d23208247b5439f56862ef6c273b42c8a54a3b 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc
|
| @@ -33,8 +33,12 @@
|
| }
|
|
|
| DataReductionProxyStatisticsPrefs::~DataReductionProxyStatisticsPrefs() {
|
| + // This object is created on UI thread, but destroyed on IO thread. So no
|
| + // DCHECK on thread_checker_ here.
|
| +}
|
| +
|
| +void DataReductionProxyStatisticsPrefs::ShutdownOnUIThread() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - WritePrefs();
|
| pref_change_registrar_->RemoveAll();
|
| weak_factory_.InvalidateWeakPtrs();
|
| }
|
| @@ -73,7 +77,7 @@
|
| pref_change_registrar_->Init(pref_service_);
|
| pref_change_registrar_->Add(prefs::kUpdateDailyReceivedContentLengths,
|
| base::Bind(&DataReductionProxyStatisticsPrefs::OnUpdateContentLengths,
|
| - GetWeakPtr()));
|
| + weak_factory_.GetWeakPtr()));
|
| }
|
|
|
| void DataReductionProxyStatisticsPrefs::OnUpdateContentLengths() {
|
| @@ -151,7 +155,7 @@
|
| task_runner_->PostDelayedTask(
|
| FROM_HERE,
|
| base::Bind(&DataReductionProxyStatisticsPrefs::WritePrefs,
|
| - GetWeakPtr()),
|
| + weak_factory_.GetWeakPtr()),
|
| delay_);
|
|
|
| delayed_task_posted_ = true;
|
| @@ -182,9 +186,4 @@
|
| return value;
|
| }
|
|
|
| -base::WeakPtr<DataReductionProxyStatisticsPrefs>
|
| -DataReductionProxyStatisticsPrefs::GetWeakPtr() {
|
| - return weak_factory_.GetWeakPtr();
|
| -}
|
| -
|
| } // namespace data_reduction_proxy
|
|
|