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

Unified Diff: webkit/glue/webkitclient_impl.cc

Issue 5406004: histogram API of WebKitClient implemented in chromium/webkit/glue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698