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/key_builder.h" | 5 #include "chrome/browser/performance_monitor/key_builder.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_split.h" | |
10 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
11 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/string_split.h" |
12 | 12 |
13 namespace performance_monitor { | 13 namespace performance_monitor { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const char kDelimiter = '!'; | 17 const char kDelimiter = '!'; |
18 | 18 |
19 // These values are used as the portion of the generated key which represents | 19 // These values are used as the portion of the generated key which represents |
20 // the event/metric type when inserting values in the database. We use an ASCII | 20 // the event/metric type when inserting values in the database. We use an ASCII |
21 // character as a mapping, rather than the enum of the metric or event itself, | 21 // character as a mapping, rather than the enum of the metric or event itself, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 std::vector<std::string> split; | 238 std::vector<std::string> split; |
239 base::SplitString(key, kDelimiter, &split); | 239 base::SplitString(key, kDelimiter, &split); |
240 DCHECK(split[METRIC_TYPE].size() == 1); | 240 DCHECK(split[METRIC_TYPE].size() == 1); |
241 return MetricKey(split[METRIC_TIME], | 241 return MetricKey(split[METRIC_TIME], |
242 metric_key_char_to_metric_type_[ | 242 metric_key_char_to_metric_type_[ |
243 static_cast<int>(split[METRIC_TYPE].at(0))], | 243 static_cast<int>(split[METRIC_TYPE].at(0))], |
244 split[METRIC_ACTIVITY]); | 244 split[METRIC_ACTIVITY]); |
245 } | 245 } |
246 | 246 |
247 } // namespace performance_monitor | 247 } // namespace performance_monitor |
OLD | NEW |