summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkitclient_impl.cc
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 00:25:13 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 00:25:13 +0000
commit8879ffc78027077456320b6adfc6f8b3c9a1daae (patch)
treeb3b774e7e3f5912a57ee375eb657b4d3917d4845 /webkit/glue/webkitclient_impl.cc
parentbdde9f26ec7c21e7d1d5d8f56c35063b6846efe6 (diff)
downloadchromium_src-8879ffc78027077456320b6adfc6f8b3c9a1daae.zip
chromium_src-8879ffc78027077456320b6adfc6f8b3c9a1daae.tar.gz
chromium_src-8879ffc78027077456320b6adfc6f8b3c9a1daae.tar.bz2
histogram API of WebKitClient implemented in chromium/webkit/glue
BUG=62865 TEST=none Review URL: http://codereview.chromium.org/5406004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkitclient_impl.cc')
-rw-r--r--webkit/glue/webkitclient_impl.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index a992355..12d5702 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,30 @@ 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,
+ base::Histogram::kUmaTargetedHistogramFlag);
+ DCHECK_EQ(name, counter->histogram_name());
+ if (counter.get())
+ counter->Add(sample);
+}
+
+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 =
+ 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);
+}
+
void WebKitClientImpl::traceEventBegin(const char* name, void* id,
const char* extra) {
TRACE_EVENT_BEGIN(name, id, extra);