Chromium Code Reviews| 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..3bc20125bb7f42fffef5a559bcfb67b282075b52 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/Histogram.h |
| @@ -0,0 +1,49 @@ |
| +// 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 { |
| + |
| +#define DEFINE_STATIC_LOCAL_HISTOGRAM(type, name, constructor) \ |
| + static type name constructor; |
|
esprehn
2016/02/01 16:21:00
please use DEFINE_STATIC_LOCAL, don't invent new m
dtapuska
2016/02/01 16:28:51
Sorry didn't know that actually existed.
|
| + |
| +class PLATFORM_EXPORT CustomCountHistogram { |
| +public: |
| + CustomCountHistogram(const char* name, int32_t min, int32_t max, int32_t bucketCount); |
| + void count(int32_t sample); |
| + |
| +protected: |
| + 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: |
| + SparseHistogram(const char* name); |
|
esprehn
2016/02/01 16:21:00
explicit
dtapuska
2016/02/01 16:28:51
Done.
|
| + |
| + void sample(int32_t sample); |
| + |
| +private: |
| + base::HistogramBase* m_histogram; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // Histogram_h |