OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_COMMON_CRASH_KEYS_H_ | 5 #ifndef CHROME_COMMON_CRASH_KEYS_H_ |
6 #define CHROME_COMMON_CRASH_KEYS_H_ | 6 #define CHROME_COMMON_CRASH_KEYS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/debug/crash_logging.h" | 12 #include "base/debug/crash_logging.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class CommandLine; | 15 class CommandLine; |
16 } | 16 } |
17 | 17 |
18 namespace crash_keys { | 18 namespace crash_keys { |
19 | 19 |
20 // Registers all of the potential crash keys that can be sent to the crash | 20 // Registers all of the potential crash keys that can be sent to the crash |
21 // reporting server. Returns the size of the union of all keys. | 21 // reporting server. Returns the size of the union of all keys. |
22 size_t RegisterChromeCrashKeys(); | 22 size_t RegisterChromeCrashKeys(); |
23 | 23 |
24 // Sets the ID (based on |client_guid| which may either be a full GUID or a | 24 // Sets the ID (which may either be a full GUID or a GUID that was already |
25 // GUID that was already stripped from its dashes -- in either cases this method | 25 // stripped from its dashes -- in either case this method will strip remaining |
26 // will strip remaining dashes before setting the crash key) by which this crash | 26 // dashes before setting the crash key). |
27 // reporting client can be identified. | 27 void SetMetricsClientIdFromGUID(const std::string& metrics_client_guid); |
28 void SetCrashClientIdFromGUID(const std::string& client_guid); | 28 void ClearMetricsClientId(); |
29 | 29 |
30 // Sets the kSwitch and kNumSwitches keys based on the given |command_line|. | 30 // Sets the kSwitch and kNumSwitches keys based on the given |command_line|. |
31 void SetSwitchesFromCommandLine(const base::CommandLine* command_line); | 31 void SetSwitchesFromCommandLine(const base::CommandLine* command_line); |
32 | 32 |
33 // Sets the list of active experiment/variations info. | 33 // Sets the list of active experiment/variations info. |
34 void SetVariationsList(const std::vector<std::string>& variations); | 34 void SetVariationsList(const std::vector<std::string>& variations); |
35 | 35 |
36 // Sets the list of "active" extensions in this process. We overload "active" to | 36 // Sets the list of "active" extensions in this process. We overload "active" to |
37 // mean different things depending on the process type: | 37 // mean different things depending on the process type: |
38 // - browser: all enabled extensions | 38 // - browser: all enabled extensions |
39 // - renderer: the unique set of extension ids from all content scripts | 39 // - renderer: the unique set of extension ids from all content scripts |
40 // - extension: the id of each extension running in this process (there can be | 40 // - extension: the id of each extension running in this process (there can be |
41 // multiple because of process collapsing). | 41 // multiple because of process collapsing). |
42 void SetActiveExtensions(const std::set<std::string>& extensions); | 42 void SetActiveExtensions(const std::set<std::string>& extensions); |
43 | 43 |
44 // Sets the printer info. Data should be separated by ';' up to | 44 // Sets the printer info. Data should be separated by ';' up to |
45 // kPrinterInfoCount substrings. Each substring will be truncated if necessary. | 45 // kPrinterInfoCount substrings. Each substring will be truncated if necessary. |
46 class ScopedPrinterInfo { | 46 class ScopedPrinterInfo { |
47 public: | 47 public: |
48 explicit ScopedPrinterInfo(const base::StringPiece& data); | 48 explicit ScopedPrinterInfo(const base::StringPiece& data); |
49 ~ScopedPrinterInfo(); | 49 ~ScopedPrinterInfo(); |
50 | 50 |
51 private: | 51 private: |
52 DISALLOW_COPY_AND_ASSIGN(ScopedPrinterInfo); | 52 DISALLOW_COPY_AND_ASSIGN(ScopedPrinterInfo); |
53 }; | 53 }; |
54 | 54 |
55 // Crash Key Name Constants //////////////////////////////////////////////////// | 55 // Crash Key Name Constants //////////////////////////////////////////////////// |
56 | 56 |
57 // The GUID used to identify this client to the crash system. | 57 // The GUID used to identify this client to the crash system. |
| 58 #if defined(OS_MACOSX) |
| 59 // On Mac OS X, the crash reporting client ID is the responsibility of Crashpad. |
| 60 // It is not set directly by Chrome. To make the metrics client ID available on |
| 61 // the server, it's stored in a distinct key. |
| 62 extern const char kMetricsClientID[]; |
| 63 #else |
| 64 // When using Breakpad instead of Crashpad, the crash reporting client ID is the |
| 65 // same as the metrics client ID. |
58 extern const char kClientID[]; | 66 extern const char kClientID[]; |
| 67 #endif |
59 | 68 |
60 // The product release/distribution channel. | 69 // The product release/distribution channel. |
61 extern const char kChannel[]; | 70 extern const char kChannel[]; |
62 | 71 |
63 // The URL of the active tab. | 72 // The URL of the active tab. |
64 extern const char kActiveURL[]; | 73 extern const char kActiveURL[]; |
65 | 74 |
66 // Process command line switches. |kSwitch| should be formatted with an integer, | 75 // Process command line switches. |kSwitch| should be formatted with an integer, |
67 // in the range [1, kSwitchesMaxCount]. | 76 // in the range [1, kSwitchesMaxCount]. |
68 const size_t kSwitchesMaxCount = 15; | 77 const size_t kSwitchesMaxCount = 15; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 153 |
145 #if defined(KASKO) | 154 #if defined(KASKO) |
146 // Used to correlate a report sent via Kasko with one sent via Breakpad. | 155 // Used to correlate a report sent via Kasko with one sent via Breakpad. |
147 extern const char kKaskoGuid[]; | 156 extern const char kKaskoGuid[]; |
148 extern const char kKaskoEquivalentGuid[]; | 157 extern const char kKaskoEquivalentGuid[]; |
149 #endif | 158 #endif |
150 | 159 |
151 } // namespace crash_keys | 160 } // namespace crash_keys |
152 | 161 |
153 #endif // CHROME_COMMON_CRASH_KEYS_H_ | 162 #endif // CHROME_COMMON_CRASH_KEYS_H_ |
OLD | NEW |