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/metrics/sparse_histogram.h" | 5 #include "base/metrics/sparse_histogram.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/metrics/metrics_hashes.h" | 10 #include "base/metrics/metrics_hashes.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (histogram_ref) { | 61 if (histogram_ref) { |
62 allocator->FinalizeHistogram(histogram_ref, | 62 allocator->FinalizeHistogram(histogram_ref, |
63 histogram == tentative_histogram_ptr); | 63 histogram == tentative_histogram_ptr); |
64 } | 64 } |
65 | 65 |
66 ReportHistogramActivity(*histogram, HISTOGRAM_CREATED); | 66 ReportHistogramActivity(*histogram, HISTOGRAM_CREATED); |
67 } else { | 67 } else { |
68 ReportHistogramActivity(*histogram, HISTOGRAM_LOOKUP); | 68 ReportHistogramActivity(*histogram, HISTOGRAM_LOOKUP); |
69 } | 69 } |
70 | 70 |
71 DCHECK_EQ(SPARSE_HISTOGRAM, histogram->GetHistogramType()); | 71 CHECK_EQ(SPARSE_HISTOGRAM, histogram->GetHistogramType()); |
72 return histogram; | 72 return histogram; |
73 } | 73 } |
74 | 74 |
75 // static | 75 // static |
76 std::unique_ptr<HistogramBase> SparseHistogram::PersistentCreate( | 76 std::unique_ptr<HistogramBase> SparseHistogram::PersistentCreate( |
77 PersistentHistogramAllocator* allocator, | 77 PersistentHistogramAllocator* allocator, |
78 const std::string& name, | 78 const std::string& name, |
79 HistogramSamples::Metadata* meta, | 79 HistogramSamples::Metadata* meta, |
80 HistogramSamples::Metadata* logged_meta) { | 80 HistogramSamples::Metadata* logged_meta) { |
81 return WrapUnique( | 81 return WrapUnique( |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 std::string* output) const { | 280 std::string* output) const { |
281 StringAppendF(output, | 281 StringAppendF(output, |
282 "Histogram: %s recorded %d samples", | 282 "Histogram: %s recorded %d samples", |
283 histogram_name().c_str(), | 283 histogram_name().c_str(), |
284 total_count); | 284 total_count); |
285 if (flags()) | 285 if (flags()) |
286 StringAppendF(output, " (flags = 0x%x)", flags()); | 286 StringAppendF(output, " (flags = 0x%x)", flags()); |
287 } | 287 } |
288 | 288 |
289 } // namespace base | 289 } // namespace base |
OLD | NEW |