| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/performance_monitor/metric_info.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/string_number_conversions.h" | |
| 9 | |
| 10 namespace performance_monitor { | |
| 11 | |
| 12 MetricInfo::MetricInfo() { | |
| 13 value = 0.0; | |
| 14 } | |
| 15 | |
| 16 MetricInfo::MetricInfo(const base::Time& metric_time, double metric_value) | |
| 17 : time(metric_time), | |
| 18 value(metric_value) { | |
| 19 } | |
| 20 | |
| 21 MetricInfo::MetricInfo(const std::string& metric_time, | |
| 22 const std::string& metric_value) { | |
| 23 int64 conversion = 0; | |
| 24 base::StringToInt64(metric_time, &conversion); | |
| 25 time = base::Time::FromInternalValue(conversion); | |
| 26 CHECK(base::StringToDouble(metric_value, &value)); | |
| 27 } | |
| 28 | |
| 29 MetricInfo::~MetricInfo() { | |
| 30 } | |
| 31 | |
| 32 } // namespace performance_monitor | |
| OLD | NEW |