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

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

Issue 141393002: Return a NULL histogram pointer on construction error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add construction param to restore old CHECK for non-API calls Created 6 years, 11 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
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 enum Inconsistency { 72 enum Inconsistency {
73 NO_INCONSISTENCIES = 0x0, 73 NO_INCONSISTENCIES = 0x0,
74 RANGE_CHECKSUM_ERROR = 0x1, 74 RANGE_CHECKSUM_ERROR = 0x1,
75 BUCKET_ORDER_ERROR = 0x2, 75 BUCKET_ORDER_ERROR = 0x2,
76 COUNT_HIGH_ERROR = 0x4, 76 COUNT_HIGH_ERROR = 0x4,
77 COUNT_LOW_ERROR = 0x8, 77 COUNT_LOW_ERROR = 0x8,
78 78
79 NEVER_EXCEEDED_VALUE = 0x10 79 NEVER_EXCEEDED_VALUE = 0x10
80 }; 80 };
81 81
82 enum ConstructionBehavior {
83 kDoNotAllowBadConstruction = 0,
84 kAllowBadConstruction = 1
85 };
86
82 explicit HistogramBase(const std::string& name); 87 explicit HistogramBase(const std::string& name);
83 virtual ~HistogramBase(); 88 virtual ~HistogramBase();
84 89
85 std::string histogram_name() const { return histogram_name_; } 90 std::string histogram_name() const { return histogram_name_; }
86 91
87 // Operations with Flags enum. 92 // Operations with Flags enum.
88 int32 flags() const { return flags_; } 93 int32 flags() const { return flags_; }
89 void SetFlags(int32 flags); 94 void SetFlags(int32 flags);
90 void ClearFlags(int32 flags); 95 void ClearFlags(int32 flags);
91 96
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 private: 165 private:
161 const std::string histogram_name_; 166 const std::string histogram_name_;
162 int32 flags_; 167 int32 flags_;
163 168
164 DISALLOW_COPY_AND_ASSIGN(HistogramBase); 169 DISALLOW_COPY_AND_ASSIGN(HistogramBase);
165 }; 170 };
166 171
167 } // namespace base 172 } // namespace base
168 173
169 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ 174 #endif // BASE_METRICS_HISTOGRAM_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698