| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 read_only_ = true; | 347 read_only_ = true; |
| 348 break; | 348 break; |
| 349 case PREF_READ_ERROR_NONE: | 349 case PREF_READ_ERROR_NONE: |
| 350 DCHECK(read_result->value.get()); | 350 DCHECK(read_result->value.get()); |
| 351 unfiltered_prefs.reset( | 351 unfiltered_prefs.reset( |
| 352 static_cast<base::DictionaryValue*>(read_result->value.release())); | 352 static_cast<base::DictionaryValue*>(read_result->value.release())); |
| 353 break; | 353 break; |
| 354 case PREF_READ_ERROR_NO_FILE: | 354 case PREF_READ_ERROR_NO_FILE: |
| 355 // If the file just doesn't exist, maybe this is first run. In any case | 355 // If the file just doesn't exist, maybe this is first run. In any case |
| 356 // there's no harm in writing out default prefs in this case. | 356 // there's no harm in writing out default prefs in this case. |
| 357 break; | |
| 358 case PREF_READ_ERROR_JSON_PARSE: | 357 case PREF_READ_ERROR_JSON_PARSE: |
| 359 case PREF_READ_ERROR_JSON_REPEAT: | 358 case PREF_READ_ERROR_JSON_REPEAT: |
| 360 break; | 359 break; |
| 361 case PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE: | 360 case PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE: |
| 362 // This is a special error code to be returned by ReadPrefs when it | 361 // This is a special error code to be returned by ReadPrefs when it |
| 363 // can't complete synchronously, it should never be returned by the read | 362 // can't complete synchronously, it should never be returned by the read |
| 364 // operation itself. | 363 // operation itself. |
| 365 NOTREACHED(); | |
| 366 break; | |
| 367 case PREF_READ_ERROR_MAX_ENUM: | 364 case PREF_READ_ERROR_MAX_ENUM: |
| 368 NOTREACHED(); | 365 NOTREACHED(); |
| 369 break; | 366 break; |
| 370 } | 367 } |
| 371 } | 368 } |
| 372 | 369 |
| 373 if (pref_filter_) { | 370 if (pref_filter_) { |
| 374 filtering_in_progress_ = true; | 371 filtering_in_progress_ = true; |
| 375 const PrefFilter::PostFilterOnLoadCallback post_filter_on_load_callback( | 372 const PrefFilter::PostFilterOnLoadCallback post_filter_on_load_callback( |
| 376 base::Bind( | 373 base::Bind( |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 DCHECK_EQ(31, num_buckets); | 524 DCHECK_EQ(31, num_buckets); |
| 528 | 525 |
| 529 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS | 526 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS |
| 530 // macro adapted to allow for a dynamically suffixed histogram name. | 527 // macro adapted to allow for a dynamically suffixed histogram name. |
| 531 // Note: The factory creates and owns the histogram. | 528 // Note: The factory creates and owns the histogram. |
| 532 base::HistogramBase* histogram = base::Histogram::FactoryGet( | 529 base::HistogramBase* histogram = base::Histogram::FactoryGet( |
| 533 histogram_name, min_value, max_value, num_buckets, | 530 histogram_name, min_value, max_value, num_buckets, |
| 534 base::HistogramBase::kUmaTargetedHistogramFlag); | 531 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 535 return histogram; | 532 return histogram; |
| 536 } | 533 } |
| OLD | NEW |