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

Unified Diff: chrome/browser/performance_monitor/metric_details.cc

Issue 10702117: Chrome Performance Monitor: Metric API Functions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Docs and other review fixes. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/performance_monitor/metric_details.cc
diff --git a/chrome/browser/performance_monitor/metric_details.cc b/chrome/browser/performance_monitor/metric_details.cc
index e16e1deef3361fef3ef0ee02b60073236291c76a..b8754ed6530e13af90aeadc144ebfc03496eacb0 100644
--- a/chrome/browser/performance_monitor/metric_details.cc
+++ b/chrome/browser/performance_monitor/metric_details.cc
@@ -4,7 +4,26 @@
#include "chrome/browser/performance_monitor/metric_details.h"
+#include "base/logging.h"
+#include "chrome/browser/performance_monitor/constants.h"
+
namespace performance_monitor {
+namespace {
+
+// Keep this array synced with MetricTypes in the header file.
+// TODO(mtytel): i18n.
+const char* kMetricTypeNames[] = {
+ kSampleMetricName
+};
+COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricTypeNames) == METRIC_NUMBER_OF_METRICS,
+ metric_names_incorrect_size);
+
+} // namespace
+
+const char* MetricTypeToString(MetricType metric_type) {
+ DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type);
+ return kMetricTypeNames[metric_type];
+}
MetricDetails::MetricDetails() {
}

Powered by Google App Engine
This is Rietveld 408576698