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

Side by Side Diff: chrome/browser/about_flags.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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
« no previous file with comments | « base/win/win_util.cc ('k') | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2815 2815
2816 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) { 2816 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2817 return static_cast<base::HistogramBase::Sample>( 2817 return static_cast<base::HistogramBase::Sample>(
2818 metrics::HashMetricName(switch_name)); 2818 metrics::HashMetricName(switch_name));
2819 } 2819 }
2820 2820
2821 void ReportCustomFlags(const std::string& uma_histogram_hame, 2821 void ReportCustomFlags(const std::string& uma_histogram_hame,
2822 const std::set<std::string>& command_line_difference) { 2822 const std::set<std::string>& command_line_difference) {
2823 for (const std::string& flag : command_line_difference) { 2823 for (const std::string& flag : command_line_difference) {
2824 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId; 2824 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2825 if (StartsWithASCII(flag, "--", true /* case_sensitive */)) { 2825 if (base::StartsWithASCII(flag, "--", true /* case_sensitive */)) {
2826 // Skip '--' before switch name. 2826 // Skip '--' before switch name.
2827 std::string switch_name(flag.substr(2)); 2827 std::string switch_name(flag.substr(2));
2828 2828
2829 // Kill value, if any. 2829 // Kill value, if any.
2830 const size_t value_pos = switch_name.find('='); 2830 const size_t value_pos = switch_name.find('=');
2831 if (value_pos != std::string::npos) 2831 if (value_pos != std::string::npos)
2832 switch_name.resize(value_pos); 2832 switch_name.resize(value_pos);
2833 2833
2834 uma_id = GetSwitchUMAId(switch_name); 2834 uma_id = GetSwitchUMAId(switch_name);
2835 } else { 2835 } else {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
3034 } 3034 }
3035 3035
3036 const Experiment* GetExperiments(size_t* count) { 3036 const Experiment* GetExperiments(size_t* count) {
3037 *count = num_experiments; 3037 *count = num_experiments;
3038 return experiments; 3038 return experiments;
3039 } 3039 }
3040 3040
3041 } // namespace testing 3041 } // namespace testing
3042 3042
3043 } // namespace about_flags 3043 } // namespace about_flags
OLDNEW
« no previous file with comments | « base/win/win_util.cc ('k') | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698