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

Unified Diff: chrome/browser/about_flags.cc

Issue 2345033002: Log base::Features in Launch.FlagsAtStartup (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/flags_ui/flags_state.cc » ('j') | components/flags_ui/flags_state.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index b57dcedf7dc67ef5c5958274de5fb298a267abac..ed0bd9930f977e49175e2ed32888df3b36a6f366 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2239,22 +2239,16 @@ void ReportAboutFlagsHistogram(const std::string& uma_histogram_name,
const std::set<std::string>& flags) {
Alexei Svitkine (slow) 2016/09/15 19:59:18 This function is also called from a different plac
lawrencewu 2016/09/16 15:34:56 I needed only one extra parameter for all features
for (const std::string& flag : flags) {
int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
- if (base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) {
- // Skip '--' before switch name.
- std::string switch_name(flag.substr(2));
-
- // Kill value, if any.
- const size_t value_pos = switch_name.find('=');
- if (value_pos != std::string::npos)
- switch_name.resize(value_pos);
-
- uma_id = GetSwitchUMAId(switch_name);
- } else {
- NOTREACHED() << "ReportAboutFlagsHistogram(): flag '" << flag
- << "' has incorrect format.";
- }
+
+ std::string mutable_flag(flag);
+ // Kill value, if any.
+ const size_t value_pos = mutable_flag.find('=');
+ if (value_pos != std::string::npos)
+ mutable_flag.resize(value_pos);
+
+ uma_id = GetSwitchUMAId(mutable_flag);
DVLOG(1) << "ReportAboutFlagsHistogram(): histogram='" << uma_histogram_name
- << "' '" << flag << "', uma_id=" << uma_id;
+ << "' '" << mutable_flag << "', uma_id=" << uma_id;
// Sparse histogram macro does not cache the histogram, so it's safe
// to use macro with non-static histogram name here.
« no previous file with comments | « no previous file | components/flags_ui/flags_state.cc » ('j') | components/flags_ui/flags_state.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698