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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_statistics_prefs.cc

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove incorrect DCHECK from drp_statistics_prefs.cc Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 if (delay_ == base::TimeDelta()) 98 if (delay_ == base::TimeDelta())
99 return ListPrefUpdate(pref_service_, pref_path).Get(); 99 return ListPrefUpdate(pref_service_, pref_path).Get();
100 100
101 DelayedWritePrefs(); 101 DelayedWritePrefs();
102 return list_pref_map_.get(pref_path); 102 return list_pref_map_.get(pref_path);
103 } 103 }
104 104
105 void DataReductionProxyStatisticsPrefs::WritePrefs() { 105 void DataReductionProxyStatisticsPrefs::WritePrefs() {
106 if (delay_ == base::TimeDelta()) 106 if (delay_ == base::TimeDelta())
107 return; 107 return;
108 DCHECK(delayed_task_posted_);
109 108
110 for (DataReductionProxyPrefMap::iterator iter = pref_map_.begin(); 109 for (DataReductionProxyPrefMap::iterator iter = pref_map_.begin();
111 iter != pref_map_.end(); ++iter) { 110 iter != pref_map_.end(); ++iter) {
112 pref_service_->SetInt64(iter->first, iter->second); 111 pref_service_->SetInt64(iter->first, iter->second);
113 } 112 }
114 113
115 for (DataReductionProxyListPrefMap::iterator iter = list_pref_map_.begin(); 114 for (DataReductionProxyListPrefMap::iterator iter = list_pref_map_.begin();
116 iter != list_pref_map_.end(); ++iter) { 115 iter != list_pref_map_.end(); ++iter) {
117 TransferList(*(iter->second), 116 TransferList(*(iter->second),
118 ListPrefUpdate(pref_service_, iter->first).Get()); 117 ListPrefUpdate(pref_service_, iter->first).Get());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return 0; 153 return 0;
155 } 154 }
156 155
157 int64 value = 0; 156 int64 value = 0;
158 bool rv = base::StringToInt64(string_value, &value); 157 bool rv = base::StringToInt64(string_value, &value);
159 DCHECK(rv); 158 DCHECK(rv);
160 return value; 159 return value;
161 } 160 }
162 161
163 } // namespace data_reduction_proxy 162 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698