OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome_frame/chrome_frame_histograms.h" | 5 #include "chrome_frame/chrome_frame_histograms.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/pickle.h" | |
12 | 11 |
13 // Initialize histogram statistics gathering system. | 12 // Initialize histogram statistics gathering system. |
14 base::LazyInstance<StatisticsRecorder> | 13 base::LazyInstance<StatisticsRecorder> |
15 g_statistics_recorder_(base::LINKER_INITIALIZED); | 14 g_statistics_recorder_(base::LINKER_INITIALIZED); |
16 | 15 |
17 ChromeFrameHistogramSnapshots::ChromeFrameHistogramSnapshots() { | 16 ChromeFrameHistogramSnapshots::ChromeFrameHistogramSnapshots() { |
18 // Ensure that an instance of the StatisticsRecorder object is created. | 17 // Ensure that an instance of the StatisticsRecorder object is created. |
19 g_statistics_recorder_.Get(); | 18 g_statistics_recorder_.Get(); |
20 } | 19 } |
21 | 20 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const Histogram::SampleSet& snapshot, | 74 const Histogram::SampleSet& snapshot, |
76 HistogramPickledList* pickled_histograms) { | 75 HistogramPickledList* pickled_histograms) { |
77 | 76 |
78 DCHECK(0 != snapshot.TotalCount()); | 77 DCHECK(0 != snapshot.TotalCount()); |
79 snapshot.CheckSize(histogram); | 78 snapshot.CheckSize(histogram); |
80 | 79 |
81 std::string histogram_info = | 80 std::string histogram_info = |
82 Histogram::SerializeHistogramInfo(histogram, snapshot); | 81 Histogram::SerializeHistogramInfo(histogram, snapshot); |
83 pickled_histograms->push_back(histogram_info); | 82 pickled_histograms->push_back(histogram_info); |
84 } | 83 } |
OLD | NEW |