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