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

Unified Diff: third_party/WebKit/Source/platform/Histogram.h

Issue 1647883004: Support caching histograms so that a lookup isn't done in each iteration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add explicit to protected ctor as well Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/Histogram.h
diff --git a/third_party/WebKit/Source/platform/Histogram.h b/third_party/WebKit/Source/platform/Histogram.h
new file mode 100644
index 0000000000000000000000000000000000000000..a782a28bfbeb63f34610c33a781afcfa91ca976e
--- /dev/null
+++ b/third_party/WebKit/Source/platform/Histogram.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef Histogram_h
+#define Histogram_h
+
+#include "platform/PlatformExport.h"
+#include <stdint.h>
+
+namespace base {
+class HistogramBase;
+};
+
+namespace blink {
+
+class PLATFORM_EXPORT CustomCountHistogram {
bcwhite 2016/02/01 20:06:18 Why not have a HistogramBase equivalent rather tha
+public:
+ CustomCountHistogram(const char* name, int32_t min, int32_t max, int32_t bucketCount);
+ void count(int32_t sample);
+
+protected:
+ explicit CustomCountHistogram(base::HistogramBase*);
+
+private:
+ base::HistogramBase* m_histogram;
+};
+
+class PLATFORM_EXPORT EnumerationHistogram : public CustomCountHistogram {
+public:
+ EnumerationHistogram(const char* name, int32_t boundaryValue);
+};
+
+class PLATFORM_EXPORT SparseHistogram {
+public:
+ explicit SparseHistogram(const char* name);
+
+ void sample(int32_t sample);
+
+private:
+ base::HistogramBase* m_histogram;
+};
+
+} // namespace blink
+
+#endif // Histogram_h

Powered by Google App Engine
This is Rietveld 408576698