Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: base/metrics/histogram_snapshot_manager.h

Issue 2836993002: Add ThreadChecker to HistogramSnapshotManager. (Closed)
Patch Set: remove dead code (InspectLoggedSamplesInconsistency) Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_
6 #define BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ 6 #define BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/metrics/histogram_base.h" 16 #include "base/metrics/histogram_base.h"
17 #include "base/threading/thread_checker.h"
17 18
18 namespace base { 19 namespace base {
19 20
20 class HistogramSamples; 21 class HistogramSamples;
21 class HistogramFlattener; 22 class HistogramFlattener;
22 23
23 // HistogramSnapshotManager handles the logistics of gathering up available 24 // HistogramSnapshotManager handles the logistics of gathering up available
24 // histograms for recording either to disk or for transmission (such as from 25 // histograms for recording either to disk or for transmission (such as from
25 // renderer to browser, or from browser to UMA upload). Since histograms can sit 26 // renderer to browser, or from browser to UMA upload). Since histograms can sit
26 // in memory for an extended period of time, and are vulnerable to memory 27 // in memory for an extended period of time, and are vulnerable to memory
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 }; 72 };
72 73
73 // Capture and hold samples from a histogram. This does all the heavy 74 // Capture and hold samples from a histogram. This does all the heavy
74 // lifting for PrepareDelta() and PrepareAbsolute(). 75 // lifting for PrepareDelta() and PrepareAbsolute().
75 void PrepareSamples(const HistogramBase* histogram, 76 void PrepareSamples(const HistogramBase* histogram,
76 std::unique_ptr<HistogramSamples> samples); 77 std::unique_ptr<HistogramSamples> samples);
77 78
78 // Try to detect and fix count inconsistency of logged samples. 79 // Try to detect and fix count inconsistency of logged samples.
79 void InspectLoggedSamplesInconsistency( 80 void InspectLoggedSamplesInconsistency(
80 const HistogramSamples& new_snapshot, 81 const HistogramSamples& new_snapshot,
81 HistogramSamples* logged_samples); 82 HistogramSamples* logged_samples);
Alexei Svitkine (slow) 2017/04/24 19:29:07 Remove this too. :)
bcwhite 2017/04/24 19:43:05 Oops. Didn't save the file. :-)
82 83
83 // For histograms, track what has been previously seen, indexed 84 // For histograms, track what has been previously seen, indexed
84 // by the hash of the histogram name. 85 // by the hash of the histogram name.
85 std::map<uint64_t, SampleInfo> known_histograms_; 86 std::map<uint64_t, SampleInfo> known_histograms_;
86 87
87 // |histogram_flattener_| handles the logistics of recording the histogram 88 // |histogram_flattener_| handles the logistics of recording the histogram
88 // deltas. 89 // deltas.
89 HistogramFlattener* histogram_flattener_; // Weak. 90 HistogramFlattener* histogram_flattener_; // Weak.
90 91
92 ThreadChecker thread_checker_;
93
91 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager); 94 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager);
92 }; 95 };
93 96
94 } // namespace base 97 } // namespace base
95 98
96 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ 99 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698