| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/performance_monitor/metric_details.h" | 5 #include "chrome/browser/performance_monitor/metric_details.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/performance_monitor/constants.h" |
| 9 |
| 7 namespace performance_monitor { | 10 namespace performance_monitor { |
| 11 namespace { |
| 12 |
| 13 // Keep this array synced with MetricTypes in the header file. |
| 14 // TODO(mtytel): i18n. |
| 15 const char* kMetricTypeNames[] = { |
| 16 kSampleMetricName |
| 17 }; |
| 18 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kMetricTypeNames) == METRIC_NUMBER_OF_METRICS, |
| 19 metric_names_incorrect_size); |
| 20 |
| 21 } // namespace |
| 22 |
| 23 const char* MetricTypeToString(MetricType metric_type) { |
| 24 DCHECK_GT(METRIC_NUMBER_OF_METRICS, metric_type); |
| 25 return kMetricTypeNames[metric_type]; |
| 26 } |
| 8 | 27 |
| 9 MetricDetails::MetricDetails() { | 28 MetricDetails::MetricDetails() { |
| 10 } | 29 } |
| 11 | 30 |
| 12 MetricDetails::MetricDetails(const std::string& metric_name, | 31 MetricDetails::MetricDetails(const std::string& metric_name, |
| 13 const std::string& metric_description) | 32 const std::string& metric_description) |
| 14 : name(metric_name), | 33 : name(metric_name), |
| 15 description(metric_description) { | 34 description(metric_description) { |
| 16 } | 35 } |
| 17 | 36 |
| 18 MetricDetails::~MetricDetails() { | 37 MetricDetails::~MetricDetails() { |
| 19 } | 38 } |
| 20 | 39 |
| 21 } // namespace performance_monitor | 40 } // namespace performance_monitor |
| OLD | NEW |