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

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

Issue 1425533011: Support "shared" histograms between processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: reorganized Factory class to be cleaner 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 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_
6 #define BASE_METRICS_HISTOGRAM_BASE_H_ 6 #define BASE_METRICS_HISTOGRAM_BASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/atomicops.h" 13 #include "base/atomicops.h"
14 #include "base/base_export.h" 14 #include "base/base_export.h"
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/strings/string_piece.h" 17 #include "base/strings/string_piece.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 19
20 namespace base { 20 namespace base {
21 21
22 class BucketRanges;
22 class DictionaryValue; 23 class DictionaryValue;
23 class HistogramBase; 24 class HistogramBase;
24 class HistogramSamples; 25 class HistogramSamples;
25 class ListValue; 26 class ListValue;
26 class Pickle; 27 class Pickle;
27 class PickleIterator; 28 class PickleIterator;
28 29
29 //////////////////////////////////////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////////////////////////
30 // These enums are used to facilitate deserialization of histograms from other 31 // These enums are used to facilitate deserialization of histograms from other
31 // processes into the browser. If you create another class that inherits from 32 // processes into the browser. If you create another class that inherits from
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // aggregation should not take place (as we would be aggregating back into 73 // aggregation should not take place (as we would be aggregating back into
73 // the source histogram!). 74 // the source histogram!).
74 kIPCSerializationSourceFlag = 0x10, 75 kIPCSerializationSourceFlag = 0x10,
75 76
76 // Indicates that a callback exists for when a new sample is recorded on 77 // Indicates that a callback exists for when a new sample is recorded on
77 // this histogram. We store this as a flag with the histogram since 78 // this histogram. We store this as a flag with the histogram since
78 // histograms can be in performance critical code, and this allows us 79 // histograms can be in performance critical code, and this allows us
79 // to shortcut looking up the callback if it doesn't exist. 80 // to shortcut looking up the callback if it doesn't exist.
80 kCallbackExists = 0x20, 81 kCallbackExists = 0x20,
81 82
83 // Indicates that the histogram is held in "persistent" memory and may
84 // be accessible between processes. This is only possible if such a
85 // memory segment has been created/attached, used to create a Persistent-
86 // MemoryAllocator, and that loaded into the Histogram module before this
87 // histogram is created.
88 kIsPersistent = 0x40,
89
82 // Only for Histogram and its sub classes: fancy bucket-naming support. 90 // Only for Histogram and its sub classes: fancy bucket-naming support.
83 kHexRangePrintingFlag = 0x8000, 91 kHexRangePrintingFlag = 0x8000,
84 }; 92 };
85 93
86 // Histogram data inconsistency types. 94 // Histogram data inconsistency types.
87 enum Inconsistency { 95 enum Inconsistency {
88 NO_INCONSISTENCIES = 0x0, 96 NO_INCONSISTENCIES = 0x0,
89 RANGE_CHECKSUM_ERROR = 0x1, 97 RANGE_CHECKSUM_ERROR = 0x1,
90 BUCKET_ORDER_ERROR = 0x2, 98 BUCKET_ORDER_ERROR = 0x2,
91 COUNT_HIGH_ERROR = 0x4, 99 COUNT_HIGH_ERROR = 0x4,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 private: 201 private:
194 const std::string histogram_name_; 202 const std::string histogram_name_;
195 AtomicCount flags_; 203 AtomicCount flags_;
196 204
197 DISALLOW_COPY_AND_ASSIGN(HistogramBase); 205 DISALLOW_COPY_AND_ASSIGN(HistogramBase);
198 }; 206 };
199 207
200 } // namespace base 208 } // namespace base
201 209
202 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ 210 #endif // BASE_METRICS_HISTOGRAM_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698