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

Unified Diff: chrome/browser/about_flags.h

Issue 344883002: Collect UMA statistics on which chrome://flags lead to chrome restart on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 6 years, 4 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 | chrome/browser/about_flags.cc » ('j') | chrome/browser/about_flags.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.h
diff --git a/chrome/browser/about_flags.h b/chrome/browser/about_flags.h
index 55859db985106a932db1ab706f74d13f416c2512..7a229a7e140326c481505d797361c76725ede75d 100644
--- a/chrome/browser/about_flags.h
+++ b/chrome/browser/about_flags.h
@@ -5,7 +5,10 @@
#ifndef CHROME_BROWSER_ABOUT_FLAGS_H_
#define CHROME_BROWSER_ABOUT_FLAGS_H_
+#include <stdint.h>
+
#include <map>
+#include <set>
#include <string>
#include "base/command_line.h"
@@ -21,6 +24,10 @@ namespace about_flags {
class FlagsStorage;
+// This value is reported as switch histogram ID if switch name has unknown
+// format.
+extern const uint32_t kBadSwitchFormatHistogramId;
+
// Enumeration of OSs.
// This is exposed only for testing.
enum { kOsMac = 1 << 0, kOsWin = 1 << 1, kOsLinux = 1 << 2 , kOsCrOS = 1 << 3,
@@ -117,9 +124,12 @@ void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
// Compares a set of switches of the two provided command line objects and
// returns true if they are the same and false otherwise.
+// If |out_difference| is not NULL, it's filled with set_symmetric_difference
+// between sets.
bool AreSwitchesIdenticalToCurrentCommandLine(
const base::CommandLine& new_cmdline,
- const base::CommandLine& active_cmdline);
+ const base::CommandLine& active_cmdline,
+ std::set<CommandLine::StringType>* out_difference);
// Differentiate between generic flags available on a per session base and flags
// that influence the whole machine and can be said by the admin only. This flag
@@ -160,6 +170,16 @@ int GetCurrentPlatform();
// startup.
void RecordUMAStatistics(FlagsStorage* flags_storage);
+// Returns the UMA id for the specified switch name.
+uint32_t GetSwitchUMAId(const std::string& switch_name);
+
+// Sends stats (as UMA histogram) about command_line_difference.
+// This is used on ChromeOS to report flags that lead to browser restart.
+// |command_line_difference| is the result of
+// AreSwitchesIdenticalToCurrentCommandLine().
+void ReportCustomFlags(const std::string& uma_histogram_hame,
+ const std::set<std::string>& command_line_difference);
+
namespace testing {
// Clears internal global state, for unit tests.
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | chrome/browser/about_flags.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698