OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_ | 5 #ifndef COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_ |
6 #define COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_ | 6 #define COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/debug/crash_logging.h" | 13 #include "base/debug/crash_logging.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class CommandLine; | 17 class CommandLine; |
18 } // namespace base | 18 } // namespace base |
19 | 19 |
20 namespace crash_keys { | 20 namespace crash_keys { |
21 | 21 |
| 22 |
22 // Sets the ID (which may either be a full GUID or a GUID that was already | 23 // Sets the ID (which may either be a full GUID or a GUID that was already |
23 // stripped from its dashes -- in either case this method will strip remaining | 24 // stripped from its dashes -- in either case this method will strip remaining |
24 // dashes before setting the crash key). | 25 // dashes before setting the crash key). |
25 void SetMetricsClientIdFromGUID(const std::string& metrics_client_guid); | 26 void SetMetricsClientIdFromGUID(const std::string& metrics_client_guid); |
26 void ClearMetricsClientId(); | 27 void ClearMetricsClientId(); |
27 | 28 |
28 // Sets the list of active experiment/variations info. | 29 // Sets the list of active experiment/variations info. |
29 void SetVariationsList(const std::vector<std::string>& variations); | 30 void SetVariationsList(const std::vector<std::string>& variations); |
30 | 31 |
31 // Adds a common set of crash keys for holding command-line switches to |keys|. | 32 // Adds a common set of crash keys for holding command-line switches to |keys|. |
32 void GetCrashKeysForCommandLineSwitches( | 33 void GetCrashKeysForCommandLineSwitches( |
33 std::vector<base::debug::CrashKey>* keys); | 34 std::vector<base::debug::CrashKey>* keys); |
34 | 35 |
| 36 // Appends crash keys used under //components/crash to |keys|. |
| 37 void AppendCrashCrashKeys(std::vector<base::debug::CrashKey>* keys); |
| 38 |
35 // A function returning true if |flag| is a switch that should be filtered out | 39 // A function returning true if |flag| is a switch that should be filtered out |
36 // of crash keys. | 40 // of crash keys. |
37 using SwitchFilterFunction = bool (*)(const std::string& flag); | 41 using SwitchFilterFunction = bool (*)(const std::string& flag); |
38 | 42 |
39 // Sets the kNumSwitches key and a set of keys named using kSwitchFormat based | 43 // Sets the kNumSwitches key and a set of keys named using kSwitchFormat based |
40 // on the given |command_line|. If |skip_filter| is not null, ignore any switch | 44 // on the given |command_line|. If |skip_filter| is not null, ignore any switch |
41 // for which it returns true. | 45 // for which it returns true. |
42 void SetSwitchesFromCommandLine(const base::CommandLine& command_line, | 46 void SetSwitchesFromCommandLine(const base::CommandLine& command_line, |
43 SwitchFilterFunction skip_filter); | 47 SwitchFilterFunction skip_filter); |
44 | 48 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // deliberate crash. | 118 // deliberate crash. |
115 extern const char kZombie[]; | 119 extern const char kZombie[]; |
116 extern const char kZombieTrace[]; | 120 extern const char kZombieTrace[]; |
117 | 121 |
118 } // namespace mac | 122 } // namespace mac |
119 #endif | 123 #endif |
120 | 124 |
121 } // namespace crash_keys | 125 } // namespace crash_keys |
122 | 126 |
123 #endif // COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_ | 127 #endif // COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_ |
OLD | NEW |