Index: components/crash/core/common/crash_keys.h |
diff --git a/components/crash/core/common/crash_keys.h b/components/crash/core/common/crash_keys.h |
index 70b77ae1165a3ddb3209300e7fc6cf52d8b56dc9..dfa4b27ef74d6d12b6ec40ab40b7a097daa24a9c 100644 |
--- a/components/crash/core/common/crash_keys.h |
+++ b/components/crash/core/common/crash_keys.h |
@@ -8,8 +8,14 @@ |
#include <string> |
#include <vector> |
+#include "base/callback_forward.h" |
+#include "base/debug/crash_logging.h" |
#include "build/build_config.h" |
+namespace base { |
+class CommandLine; |
+} // namespace base |
+ |
namespace crash_keys { |
// Sets the ID (which may either be a full GUID or a GUID that was already |
@@ -21,6 +27,18 @@ void ClearMetricsClientId(); |
// Sets the list of active experiment/variations info. |
void SetVariationsList(const std::vector<std::string>& variations); |
+// Adds a common set of crash keys for holding command-line switches to |keys|. |
+void GetCrashKeysForCommandLineSwitches( |
+ std::vector<base::debug::CrashKey>* keys); |
+ |
+// Sets the kSwitch and kNumSwitches keys based on the given |command_line|. |
+void SetSwitchesFromCommandLine(const base::CommandLine& command_line); |
grt (UTC plus 2)
2015/11/27 18:51:21
rather than overloading the function, i think it's
Joe Mason
2015/11/27 21:16:47
Done.
|
+ |
+// Sets the kSwitch and kNumSwitches keys based on the given |command_line|. |
+// Ignore any switch for which |skip_filter| returns true. |
+void SetSwitchesFromCommandLine(const base::CommandLine& command_line, |
+ const base::Callback<bool(const std::string &)>& skip_filter); |
grt (UTC plus 2)
2015/11/27 18:51:21
callback seems like overkill. how about starting w
Joe Mason
2015/11/27 21:16:47
Done.
|
+ |
// Crash Key Constants ///////////////////////////////////////////////////////// |
// kChunkMaxLength is the platform-specific maximum size that a value in a |
@@ -68,6 +86,14 @@ extern const char kNumVariations[]; |
// typically set by SetExperimentList. |
extern const char kVariations[]; |
+// Process command line switches. |kSwitch| should be formatted with an integer, |
+// in the range [1, kSwitchesMaxCount]. |
+const size_t kSwitchesMaxCount = 15; |
+extern const char kSwitch[]; |
grt (UTC plus 2)
2015/11/27 18:51:21
may as well document this for what it is:
// A pri
Joe Mason
2015/11/27 21:16:47
Done.
|
+// The total number of switches, used to report the total in case more than |
grt (UTC plus 2)
2015/11/27 18:51:21
nit: blank line before comment
Joe Mason
2015/11/27 21:16:47
Done.
|
+// |kSwitchesMaxCount| are present. |
+extern const char kNumSwitches[]; |
+ |
// Used to help investigate bug 464926. |
extern const char kBug464926CrashKey[]; |