Chromium Code Reviews| Index: webkit/glue/webkitclient_impl.cc |
| diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc |
| index a9923551a3f922fe53252f038a914744bb84999c..15407bd1e745b00d615a1857ce69157ed3a456d3 100644 |
| --- a/webkit/glue/webkitclient_impl.cc |
| +++ b/webkit/glue/webkitclient_impl.cc |
| @@ -16,6 +16,7 @@ |
| #include "base/lock.h" |
| #include "base/message_loop.h" |
| #include "base/metrics/stats_counters.h" |
| +#include "base/metrics/histogram.h" |
| #include "base/process_util.h" |
| #include "base/platform_file.h" |
| #include "base/singleton.h" |
| @@ -254,6 +255,28 @@ void WebKitClientImpl::incrementStatsCounter(const char* name) { |
| base::StatsCounter(name).Increment(); |
| } |
| +void WebKitClientImpl::histogramCustomCounts( |
| + const char* name, int sample, int min, int max, int bucket_count) { |
| + // Copied from histogram macro, but without the static variable caching |
| + // the histogram because name is dynamic. |
| + scoped_refptr<base::Histogram> counter = |
| + base::Histogram::FactoryGet(name, min, max, bucket_count, |
|
darin (slow to review)
2010/12/01 22:59:04
nit: when breaking a line of code, we usually inde
scheib
2010/12/01 23:28:59
Done.
|
| + base::Histogram::kUmaTargetedHistogramFlag); |
| + DCHECK_EQ(name, counter->histogram_name()); |
| + if (counter.get()) counter->Add(sample); |
|
darin (slow to review)
2010/12/01 22:59:04
nit: please insert a new line so that it is possib
scheib
2010/12/01 23:28:59
Done.
|
| +} |
| + |
| +void WebKitClientImpl::histogramEnumeration( |
| + const char* name, int sample, int boundary_value) { |
| + // Copied from histogram macro, but without the static variable caching |
| + // the histogram because name is dynamic. |
| + scoped_refptr<base::Histogram> counter = |
|
darin (slow to review)
2010/12/01 22:59:04
ditto
scheib
2010/12/01 23:28:59
Done.
|
| + base::LinearHistogram::FactoryGet(name, 1, boundary_value, |
| + boundary_value + 1, base::Histogram::kUmaTargetedHistogramFlag); |
| + DCHECK_EQ(name, counter->histogram_name()); |
| + if (counter.get()) counter->Add(sample); |
|
darin (slow to review)
2010/12/01 22:59:04
ditto
scheib
2010/12/01 23:28:59
Done.
|
| +} |
| + |
| void WebKitClientImpl::traceEventBegin(const char* name, void* id, |
| const char* extra) { |
| TRACE_EVENT_BEGIN(name, id, extra); |