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

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

Issue 2298223002: Fix logging of Launch.FlagsAtStartup histogram. (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 unified diff | Download patch
« no previous file with comments | « no previous file | components/flags_ui/flags_state.h » ('j') | components/flags_ui/flags_state.h » ('J')
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 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 void RemoveFlagsSwitches( 2177 void RemoveFlagsSwitches(
2178 std::map<std::string, base::CommandLine::StringType>* switch_list) { 2178 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2179 FlagsStateSingleton::GetFlagsState()->RemoveFlagsSwitches(switch_list); 2179 FlagsStateSingleton::GetFlagsState()->RemoveFlagsSwitches(switch_list);
2180 } 2180 }
2181 2181
2182 void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) { 2182 void ResetAllFlags(flags_ui::FlagsStorage* flags_storage) {
2183 FlagsStateSingleton::GetFlagsState()->ResetAllFlags(flags_storage); 2183 FlagsStateSingleton::GetFlagsState()->ResetAllFlags(flags_storage);
2184 } 2184 }
2185 2185
2186 void RecordUMAStatistics(flags_ui::FlagsStorage* flags_storage) { 2186 void RecordUMAStatistics(flags_ui::FlagsStorage* flags_storage) {
2187 std::set<std::string> flags = flags_storage->GetFlags(); 2187 std::set<std::string> switches;
2188 ReportAboutFlagsHistogram("Launch.FlagsAtStartup", flags); 2188 FlagsStateSingleton::GetFlagsState()->GetSwitchesFromFlags(flags_storage,
2189 &switches);
2190 ReportAboutFlagsHistogram("Launch.FlagsAtStartup", switches);
2189 } 2191 }
2190 2192
2191 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) { 2193 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2192 return static_cast<base::HistogramBase::Sample>( 2194 return static_cast<base::HistogramBase::Sample>(
2193 base::HashMetricName(switch_name)); 2195 base::HashMetricName(switch_name));
2194 } 2196 }
2195 2197
2196 void ReportAboutFlagsHistogram(const std::string& uma_histogram_name, 2198 void ReportAboutFlagsHistogram(const std::string& uma_histogram_name,
2197 const std::set<std::string>& flags) { 2199 const std::set<std::string>& flags) {
2198 for (const std::string& flag : flags) { 2200 for (const std::string& flag : flags) {
(...skipping 26 matching lines...) Expand all
2225 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2227 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2226 2228
2227 const FeatureEntry* GetFeatureEntries(size_t* count) { 2229 const FeatureEntry* GetFeatureEntries(size_t* count) {
2228 *count = arraysize(kFeatureEntries); 2230 *count = arraysize(kFeatureEntries);
2229 return kFeatureEntries; 2231 return kFeatureEntries;
2230 } 2232 }
2231 2233
2232 } // namespace testing 2234 } // namespace testing
2233 2235
2234 } // namespace about_flags 2236 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | components/flags_ui/flags_state.h » ('j') | components/flags_ui/flags_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698