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

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

Issue 1425533011: Support "shared" histograms between processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: extract common histogram FactoryGet code; extract histogram persistence into seperate files Created 5 years 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
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 // SampleVector implements HistogramSamples interface. It is used by all 5 // SampleVector implements HistogramSamples interface. It is used by all
6 // Histogram based classes to store samples. 6 // Histogram based classes to store samples.
7 7
8 #ifndef BASE_METRICS_SAMPLE_VECTOR_H_ 8 #ifndef BASE_METRICS_SAMPLE_VECTOR_H_
9 #define BASE_METRICS_SAMPLE_VECTOR_H_ 9 #define BASE_METRICS_SAMPLE_VECTOR_H_
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 protected: 45 protected:
46 bool AddSubtractImpl( 46 bool AddSubtractImpl(
47 SampleCountIterator* iter, 47 SampleCountIterator* iter,
48 HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT. 48 HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT.
49 49
50 virtual size_t GetBucketIndex(HistogramBase::Sample value) const; 50 virtual size_t GetBucketIndex(HistogramBase::Sample value) const;
51 51
52 private: 52 private:
53 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts); 53 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts);
54 FRIEND_TEST_ALL_PREFIXES(SharedHistogramTest, CorruptSampleCounts);
54 55
55 // In the case where this class manages the memory, here it is. 56 // In the case where this class manages the memory, here it is.
56 std::vector<HistogramBase::AtomicCount> local_counts_; 57 std::vector<HistogramBase::AtomicCount> local_counts_;
57 58
58 // These are raw pointers rather than objects for flexibility. The actual 59 // These are raw pointers rather than objects for flexibility. The actual
59 // memory is either managed by local_counts_ above or by an external object 60 // memory is either managed by local_counts_ above or by an external object
60 // and passed in directly. 61 // and passed in directly.
61 HistogramBase::AtomicCount* counts_; 62 HistogramBase::AtomicCount* counts_;
62 size_t counts_size_; 63 size_t counts_size_;
63 64
(...skipping 28 matching lines...) Expand all
92 const HistogramBase::AtomicCount* counts_; 93 const HistogramBase::AtomicCount* counts_;
93 size_t counts_size_; 94 size_t counts_size_;
94 const BucketRanges* bucket_ranges_; 95 const BucketRanges* bucket_ranges_;
95 96
96 size_t index_; 97 size_t index_;
97 }; 98 };
98 99
99 } // namespace base 100 } // namespace base
100 101
101 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ 102 #endif // BASE_METRICS_SAMPLE_VECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698