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

Side by Side 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 histogram object Created 4 years, 10 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef Histogram_h
6 #define Histogram_h
7
8 #include "platform/PlatformExport.h"
9 #include <stdint.h>
10
11 namespace base {
12 class HistogramBase;
13 };
14
15 namespace blink {
16
17 #define DEFINE_STATIC_LOCAL_HISTOGRAM(type, name, constructor) \
18 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.
19
20 class PLATFORM_EXPORT CustomCountHistogram {
21 public:
22 CustomCountHistogram(const char* name, int32_t min, int32_t max, int32_t buc ketCount);
23 void count(int32_t sample);
24
25 protected:
26 CustomCountHistogram(base::HistogramBase*);
27
28 private:
29 base::HistogramBase* m_histogram;
30 };
31
32 class PLATFORM_EXPORT EnumerationHistogram : public CustomCountHistogram {
33 public:
34 EnumerationHistogram(const char* name, int32_t boundaryValue);
35 };
36
37 class PLATFORM_EXPORT SparseHistogram {
38 public:
39 SparseHistogram(const char* name);
esprehn 2016/02/01 16:21:00 explicit
dtapuska 2016/02/01 16:28:51 Done.
40
41 void sample(int32_t sample);
42
43 private:
44 base::HistogramBase* m_histogram;
45 };
46
47 } // namespace blink
48
49 #endif // Histogram_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/DEPS ('k') | third_party/WebKit/Source/platform/Histogram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698