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

Side by Side Diff: chrome/browser/performance_monitor/metric.cc

Issue 10860017: Refactor Metrics (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed DCHECK Created 8 years, 4 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 unified diff | Download patch
OLDNEW
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_info.h" 5 #include "chrome/browser/performance_monitor/metric.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 9
10 namespace performance_monitor { 10 namespace performance_monitor {
11 11
12 MetricInfo::MetricInfo() { 12 Metric::Metric() {
13 value = 0.0; 13 value = 0.0;
14 } 14 }
15 15
16 MetricInfo::MetricInfo(const base::Time& metric_time, double metric_value) 16 Metric::Metric(const base::Time& metric_time, const double metric_value)
17 : time(metric_time), 17 : time(metric_time), value(metric_value) {
18 value(metric_value) {
19 } 18 }
20 19
21 MetricInfo::MetricInfo(const std::string& metric_time, 20 Metric::Metric(const std::string& metric_time,
22 const std::string& metric_value) { 21 const std::string& metric_value) {
23 int64 conversion = 0; 22 int64 conversion = 0;
24 base::StringToInt64(metric_time, &conversion); 23 base::StringToInt64(metric_time, &conversion);
25 time = base::Time::FromInternalValue(conversion); 24 time = base::Time::FromInternalValue(conversion);
26 CHECK(base::StringToDouble(metric_value, &value)); 25 CHECK(base::StringToDouble(metric_value, &value));
27 } 26 }
28 27
29 MetricInfo::~MetricInfo() { 28 Metric::~Metric() {
30 } 29 }
31 30
32 } // namespace performance_monitor 31 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/metric.h ('k') | chrome/browser/performance_monitor/metric_details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698