OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/prefs/json_pref_store.h" | 5 #include "base/prefs/json_pref_store.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 scoped_ptr<PrefFilter> pref_filter) | 171 scoped_ptr<PrefFilter> pref_filter) |
172 : path_(filename), | 172 : path_(filename), |
173 alternate_path_(alternate_filename), | 173 alternate_path_(alternate_filename), |
174 sequenced_task_runner_(sequenced_task_runner), | 174 sequenced_task_runner_(sequenced_task_runner), |
175 prefs_(new base::DictionaryValue()), | 175 prefs_(new base::DictionaryValue()), |
176 read_only_(false), | 176 read_only_(false), |
177 writer_(filename, sequenced_task_runner), | 177 writer_(filename, sequenced_task_runner), |
178 pref_filter_(pref_filter.Pass()), | 178 pref_filter_(pref_filter.Pass()), |
179 initialized_(false), | 179 initialized_(false), |
180 filtering_in_progress_(false), | 180 filtering_in_progress_(false), |
| 181 pending_lossy_write_(false), |
181 read_error_(PREF_READ_ERROR_NONE), | 182 read_error_(PREF_READ_ERROR_NONE), |
182 write_count_histogram_(writer_.commit_interval(), path_) { | 183 write_count_histogram_(writer_.commit_interval(), path_) { |
183 DCHECK(!path_.empty()); | 184 DCHECK(!path_.empty()); |
184 } | 185 } |
185 | 186 |
186 bool JsonPrefStore::GetValue(const std::string& key, | 187 bool JsonPrefStore::GetValue(const std::string& key, |
187 const base::Value** result) const { | 188 const base::Value** result) const { |
188 DCHECK(CalledOnValidThread()); | 189 DCHECK(CalledOnValidThread()); |
189 | 190 |
190 base::Value* tmp = NULL; | 191 base::Value* tmp = NULL; |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 DCHECK_EQ(31, num_buckets); | 541 DCHECK_EQ(31, num_buckets); |
541 | 542 |
542 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS | 543 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS |
543 // macro adapted to allow for a dynamically suffixed histogram name. | 544 // macro adapted to allow for a dynamically suffixed histogram name. |
544 // Note: The factory creates and owns the histogram. | 545 // Note: The factory creates and owns the histogram. |
545 base::HistogramBase* histogram = base::Histogram::FactoryGet( | 546 base::HistogramBase* histogram = base::Histogram::FactoryGet( |
546 histogram_name, min_value, max_value, num_buckets, | 547 histogram_name, min_value, max_value, num_buckets, |
547 base::HistogramBase::kUmaTargetedHistogramFlag); | 548 base::HistogramBase::kUmaTargetedHistogramFlag); |
548 return histogram; | 549 return histogram; |
549 } | 550 } |
OLD | NEW |