| 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 "components/prefs/json_pref_store.h" | 5 #include "components/prefs/json_pref_store.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 base::SequencedWorkerPool* worker_pool) { | 136 base::SequencedWorkerPool* worker_pool) { |
| 137 std::string token("json_pref_store-"); | 137 std::string token("json_pref_store-"); |
| 138 token.append(filename.AsUTF8Unsafe()); | 138 token.append(filename.AsUTF8Unsafe()); |
| 139 return worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( | 139 return worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( |
| 140 worker_pool->GetNamedSequenceToken(token), | 140 worker_pool->GetNamedSequenceToken(token), |
| 141 base::SequencedWorkerPool::BLOCK_SHUTDOWN); | 141 base::SequencedWorkerPool::BLOCK_SHUTDOWN); |
| 142 } | 142 } |
| 143 | 143 |
| 144 JsonPrefStore::JsonPrefStore( | 144 JsonPrefStore::JsonPrefStore( |
| 145 const base::FilePath& pref_filename, | 145 const base::FilePath& pref_filename, |
| 146 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner, | 146 const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner, |
| 147 std::unique_ptr<PrefFilter> pref_filter) | 147 std::unique_ptr<PrefFilter> pref_filter) |
| 148 : path_(pref_filename), | 148 : path_(pref_filename), |
| 149 sequenced_task_runner_(std::move(sequenced_task_runner)), | 149 sequenced_task_runner_(sequenced_task_runner), |
| 150 prefs_(new base::DictionaryValue()), | 150 prefs_(new base::DictionaryValue()), |
| 151 read_only_(false), | 151 read_only_(false), |
| 152 writer_(pref_filename, sequenced_task_runner_), | 152 writer_(pref_filename, sequenced_task_runner), |
| 153 pref_filter_(std::move(pref_filter)), | 153 pref_filter_(std::move(pref_filter)), |
| 154 initialized_(false), | 154 initialized_(false), |
| 155 filtering_in_progress_(false), | 155 filtering_in_progress_(false), |
| 156 pending_lossy_write_(false), | 156 pending_lossy_write_(false), |
| 157 read_error_(PREF_READ_ERROR_NONE), | 157 read_error_(PREF_READ_ERROR_NONE), |
| 158 has_pending_write_reply_(false), | 158 has_pending_write_reply_(false), |
| 159 write_count_histogram_(writer_.commit_interval(), path_) { | 159 write_count_histogram_(writer_.commit_interval(), path_) { |
| 160 DCHECK(!path_.empty()); | 160 DCHECK(!path_.empty()); |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 DCHECK_EQ(31, num_buckets); | 585 DCHECK_EQ(31, num_buckets); |
| 586 | 586 |
| 587 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS | 587 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS |
| 588 // macro adapted to allow for a dynamically suffixed histogram name. | 588 // macro adapted to allow for a dynamically suffixed histogram name. |
| 589 // Note: The factory creates and owns the histogram. | 589 // Note: The factory creates and owns the histogram. |
| 590 base::HistogramBase* histogram = base::Histogram::FactoryGet( | 590 base::HistogramBase* histogram = base::Histogram::FactoryGet( |
| 591 histogram_name, min_value, max_value, num_buckets, | 591 histogram_name, min_value, max_value, num_buckets, |
| 592 base::HistogramBase::kUmaTargetedHistogramFlag); | 592 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 593 return histogram; | 593 return histogram; |
| 594 } | 594 } |
| OLD | NEW |