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/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 | 2411 |
2412 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) { | 2412 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) { |
2413 return static_cast<base::HistogramBase::Sample>( | 2413 return static_cast<base::HistogramBase::Sample>( |
2414 metrics::HashMetricName(switch_name)); | 2414 metrics::HashMetricName(switch_name)); |
2415 } | 2415 } |
2416 | 2416 |
2417 void ReportCustomFlags(const std::string& uma_histogram_hame, | 2417 void ReportCustomFlags(const std::string& uma_histogram_hame, |
2418 const std::set<std::string>& command_line_difference) { | 2418 const std::set<std::string>& command_line_difference) { |
2419 for (const std::string& flag : command_line_difference) { | 2419 for (const std::string& flag : command_line_difference) { |
2420 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId; | 2420 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId; |
2421 if (base::StartsWithASCII(flag, "--", true /* case_sensitive */)) { | 2421 if (base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) { |
2422 // Skip '--' before switch name. | 2422 // Skip '--' before switch name. |
2423 std::string switch_name(flag.substr(2)); | 2423 std::string switch_name(flag.substr(2)); |
2424 | 2424 |
2425 // Kill value, if any. | 2425 // Kill value, if any. |
2426 const size_t value_pos = switch_name.find('='); | 2426 const size_t value_pos = switch_name.find('='); |
2427 if (value_pos != std::string::npos) | 2427 if (value_pos != std::string::npos) |
2428 switch_name.resize(value_pos); | 2428 switch_name.resize(value_pos); |
2429 | 2429 |
2430 uma_id = GetSwitchUMAId(switch_name); | 2430 uma_id = GetSwitchUMAId(switch_name); |
2431 } else { | 2431 } else { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 } | 2636 } |
2637 | 2637 |
2638 const Experiment* GetExperiments(size_t* count) { | 2638 const Experiment* GetExperiments(size_t* count) { |
2639 *count = num_experiments; | 2639 *count = num_experiments; |
2640 return experiments; | 2640 return experiments; |
2641 } | 2641 } |
2642 | 2642 |
2643 } // namespace testing | 2643 } // namespace testing |
2644 | 2644 |
2645 } // namespace about_flags | 2645 } // namespace about_flags |
OLD | NEW |