| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/metrics/histogram_persistence.h" | 5 #include "base/metrics/histogram_persistence.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 NOTREACHED(); | 281 NOTREACHED(); |
| 282 return nullptr; | 282 return nullptr; |
| 283 } | 283 } |
| 284 | 284 |
| 285 // After the main "counts" array is a second array using for storing what | 285 // After the main "counts" array is a second array using for storing what |
| 286 // was previously logged. This is used to calculate the "delta" during | 286 // was previously logged. This is used to calculate the "delta" during |
| 287 // snapshot operations. | 287 // snapshot operations. |
| 288 HistogramBase::AtomicCount* logged_data = | 288 HistogramBase::AtomicCount* logged_data = |
| 289 counts_data + histogram_data.bucket_count; | 289 counts_data + histogram_data.bucket_count; |
| 290 | 290 |
| 291 CHECK_LT(0, histogram_data.minimum); | |
| 292 CHECK_LT(0, histogram_data.maximum); | |
| 293 std::string name(histogram_data_ptr->name); | 291 std::string name(histogram_data_ptr->name); |
| 294 HistogramBase* histogram = nullptr; | 292 HistogramBase* histogram = nullptr; |
| 295 switch (histogram_data.histogram_type) { | 293 switch (histogram_data.histogram_type) { |
| 296 case HISTOGRAM: | 294 case HISTOGRAM: |
| 297 histogram = Histogram::PersistentGet( | 295 histogram = Histogram::PersistentGet( |
| 298 name, | 296 name, |
| 299 histogram_data.minimum, | 297 histogram_data.minimum, |
| 300 histogram_data.maximum, | 298 histogram_data.maximum, |
| 301 ranges, | 299 ranges, |
| 302 counts_data, | 300 counts_data, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 while (true) { | 507 while (true) { |
| 510 HistogramBase* histogram = GetNextPersistentHistogram(g_allocator, &iter); | 508 HistogramBase* histogram = GetNextPersistentHistogram(g_allocator, &iter); |
| 511 if (!histogram) | 509 if (!histogram) |
| 512 break; | 510 break; |
| 513 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram); | 511 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram); |
| 514 } | 512 } |
| 515 } | 513 } |
| 516 } | 514 } |
| 517 | 515 |
| 518 } // namespace base | 516 } // namespace base |
| OLD | NEW |