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

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

Issue 1463013002: Use ThreadChecker in HistogramDeltaSerialization class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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_delta_serialization.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_DELTA_SERIALIZATION_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_
6 #define BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ 6 #define BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/base_export.h" 11 #include "base/base_export.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/metrics/histogram_flattener.h" 14 #include "base/metrics/histogram_flattener.h"
15 #include "base/metrics/histogram_snapshot_manager.h" 15 #include "base/metrics/histogram_snapshot_manager.h"
16 #include "base/threading/thread_checker.h"
16 17
17 namespace base { 18 namespace base {
18 19
19 class HistogramBase; 20 class HistogramBase;
20 21
21 // Serializes and restores histograms deltas. 22 // Serializes and restores histograms deltas.
22 class BASE_EXPORT HistogramDeltaSerialization : public HistogramFlattener { 23 class BASE_EXPORT HistogramDeltaSerialization : public HistogramFlattener {
23 public: 24 public:
24 // |caller_name| is string used in histograms for counting inconsistencies. 25 // |caller_name| is string used in histograms for counting inconsistencies.
25 explicit HistogramDeltaSerialization(const std::string& caller_name); 26 explicit HistogramDeltaSerialization(const std::string& caller_name);
(...skipping 12 matching lines...) Expand all
38 39
39 private: 40 private:
40 // HistogramFlattener implementation. 41 // HistogramFlattener implementation.
41 void RecordDelta(const HistogramBase& histogram, 42 void RecordDelta(const HistogramBase& histogram,
42 const HistogramSamples& snapshot) override; 43 const HistogramSamples& snapshot) override;
43 void InconsistencyDetected(HistogramBase::Inconsistency problem) override; 44 void InconsistencyDetected(HistogramBase::Inconsistency problem) override;
44 void UniqueInconsistencyDetected( 45 void UniqueInconsistencyDetected(
45 HistogramBase::Inconsistency problem) override; 46 HistogramBase::Inconsistency problem) override;
46 void InconsistencyDetectedInLoggedCount(int amount) override; 47 void InconsistencyDetectedInLoggedCount(int amount) override;
47 48
49 ThreadChecker thread_checker_;
50
48 // Calculates deltas in histogram counters. 51 // Calculates deltas in histogram counters.
49 HistogramSnapshotManager histogram_snapshot_manager_; 52 HistogramSnapshotManager histogram_snapshot_manager_;
50 53
51 // Output buffer for serialized deltas. 54 // Output buffer for serialized deltas.
52 std::vector<std::string>* serialized_deltas_; 55 std::vector<std::string>* serialized_deltas_;
53 56
54 // Histograms to count inconsistencies in snapshots. 57 // Histograms to count inconsistencies in snapshots.
55 HistogramBase* inconsistencies_histogram_; 58 HistogramBase* inconsistencies_histogram_;
56 HistogramBase* inconsistencies_unique_histogram_; 59 HistogramBase* inconsistencies_unique_histogram_;
57 HistogramBase* inconsistent_snapshot_histogram_; 60 HistogramBase* inconsistent_snapshot_histogram_;
58 61
59 DISALLOW_COPY_AND_ASSIGN(HistogramDeltaSerialization); 62 DISALLOW_COPY_AND_ASSIGN(HistogramDeltaSerialization);
60 }; 63 };
61 64
62 } // namespace base 65 } // namespace base
63 66
64 #endif // BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ 67 #endif // BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/histogram_delta_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698