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/statistics_recorder.h" | 5 #include "base/metrics/statistics_recorder.h" |
6 | 6 |
7 #include "base/debug/leak_annotations.h" | 7 #include "base/debug/leak_annotations.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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ++number_of_vectors_saved_; | 125 ++number_of_vectors_saved_; |
126 saved_ranges_size_ += ranges->size(); | 126 saved_ranges_size_ += ranges->size(); |
127 ranges_deleter.reset(ranges); | 127 ranges_deleter.reset(ranges); |
128 return existing_ranges; | 128 return existing_ranges; |
129 } | 129 } |
130 } | 130 } |
131 } | 131 } |
132 // We haven't found a BucketRanges which has the same ranges. Register the | 132 // We haven't found a BucketRanges which has the same ranges. Register the |
133 // new BucketRanges. | 133 // new BucketRanges. |
134 checksum_matching_list->push_front(ranges); | 134 checksum_matching_list->push_front(ranges); |
135 ANNOTATE_LEAKING_OBJECT_PTR(ranges); | |
136 return ranges; | 135 return ranges; |
137 } | 136 } |
138 | 137 |
139 // static | 138 // static |
140 void StatisticsRecorder::CollectHistogramStats(const std::string& suffix) { | 139 void StatisticsRecorder::CollectHistogramStats(const std::string& suffix) { |
141 static int uma_upload_attempt = 0; | 140 static int uma_upload_attempt = 0; |
142 ++uma_upload_attempt; | 141 ++uma_upload_attempt; |
143 if (uma_upload_attempt == 1) { | 142 if (uma_upload_attempt == 1) { |
144 UMA_HISTOGRAM_COUNTS_10000( | 143 UMA_HISTOGRAM_COUNTS_10000( |
145 "Histogram.SharedRange.Count.FirstUpload." + suffix, | 144 "Histogram.SharedRange.Count.FirstUpload." + suffix, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // static | 331 // static |
333 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; | 332 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; |
334 // static | 333 // static |
335 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; | 334 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; |
336 // static | 335 // static |
337 base::Lock* StatisticsRecorder::lock_ = NULL; | 336 base::Lock* StatisticsRecorder::lock_ = NULL; |
338 // static | 337 // static |
339 bool StatisticsRecorder::dump_on_exit_ = false; | 338 bool StatisticsRecorder::dump_on_exit_ = false; |
340 | 339 |
341 } // namespace base | 340 } // namespace base |
OLD | NEW |