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 #include "components/crash/core/common/crash_keys.h" | 13 #include "components/crash/core/common/crash_keys.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class CommandLine; | 16 class CommandLine; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace crash_keys { | 19 namespace crash_keys { |
| 20 | 20 |
| 21 // Registers all of the potential crash keys that can be sent to the crash | 21 // Registers all of the potential crash keys that can be sent to the crash |
| 22 // reporting server. Returns the size of the union of all keys. | 22 // reporting server. Returns the size of the union of all keys. |
| 23 size_t RegisterChromeCrashKeys(); | 23 size_t RegisterChromeCrashKeys(); |
| 24 | 24 |
| 25 // Sets the kSwitch and kNumSwitches keys based on the given |command_line|. | 25 // Sets the kNumSwitches key and a set of keys named using kSwitchFormat based |
|
grt (UTC plus 2)
2015/11/28 02:04:30
comment nit to be addressed if you need to make ot
Joe Mason
2015/11/30 17:23:55
Done.
| |
| 26 void SetSwitchesFromCommandLine(const base::CommandLine* command_line); | 26 // on the given |command_line|. |
| 27 void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); | |
| 27 | 28 |
| 28 // Sets the list of "active" extensions in this process. We overload "active" to | 29 // Sets the list of "active" extensions in this process. We overload "active" to |
| 29 // mean different things depending on the process type: | 30 // mean different things depending on the process type: |
| 30 // - browser: all enabled extensions | 31 // - browser: all enabled extensions |
| 31 // - renderer: the unique set of extension ids from all content scripts | 32 // - renderer: the unique set of extension ids from all content scripts |
| 32 // - extension: the id of each extension running in this process (there can be | 33 // - extension: the id of each extension running in this process (there can be |
| 33 // multiple because of process collapsing). | 34 // multiple because of process collapsing). |
| 34 void SetActiveExtensions(const std::set<std::string>& extensions); | 35 void SetActiveExtensions(const std::set<std::string>& extensions); |
| 35 | 36 |
| 36 // Sets the printer info. Data should be separated by ';' up to | 37 // Sets the printer info. Data should be separated by ';' up to |
| 37 // kPrinterInfoCount substrings. Each substring will be truncated if necessary. | 38 // kPrinterInfoCount substrings. Each substring will be truncated if necessary. |
| 38 class ScopedPrinterInfo { | 39 class ScopedPrinterInfo { |
| 39 public: | 40 public: |
| 40 explicit ScopedPrinterInfo(const base::StringPiece& data); | 41 explicit ScopedPrinterInfo(const base::StringPiece& data); |
| 41 ~ScopedPrinterInfo(); | 42 ~ScopedPrinterInfo(); |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(ScopedPrinterInfo); | 45 DISALLOW_COPY_AND_ASSIGN(ScopedPrinterInfo); |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 // Crash Key Name Constants //////////////////////////////////////////////////// | 48 // Crash Key Name Constants //////////////////////////////////////////////////// |
| 48 | 49 |
| 49 // The URL of the active tab. | 50 // The URL of the active tab. |
| 50 extern const char kActiveURL[]; | 51 extern const char kActiveURL[]; |
| 51 | 52 |
| 52 // Process command line switches. |kSwitch| should be formatted with an integer, | |
| 53 // in the range [1, kSwitchesMaxCount]. | |
| 54 const size_t kSwitchesMaxCount = 15; | |
| 55 extern const char kSwitch[]; | |
| 56 // The total number of switches, used to report the total in case more than | |
| 57 // |kSwitchesMaxCount| are present. | |
| 58 extern const char kNumSwitches[]; | |
| 59 | |
| 60 // Installed extensions. |kExtensionID| should be formatted with an integer, | 53 // Installed extensions. |kExtensionID| should be formatted with an integer, |
| 61 // in the range [0, kExtensionIDMaxCount). | 54 // in the range [0, kExtensionIDMaxCount). |
| 62 const size_t kExtensionIDMaxCount = 10; | 55 const size_t kExtensionIDMaxCount = 10; |
| 63 extern const char kExtensionID[]; | 56 extern const char kExtensionID[]; |
| 64 // The total number of installed extensions, recorded in case it exceeds | 57 // The total number of installed extensions, recorded in case it exceeds |
| 65 // kExtensionIDMaxCount. Also used in chrome/app, but defined here to avoid | 58 // kExtensionIDMaxCount. Also used in chrome/app, but defined here to avoid |
| 66 // a common->app dependency. | 59 // a common->app dependency. |
| 67 extern const char kNumExtensionsCount[]; | 60 extern const char kNumExtensionsCount[]; |
| 68 | 61 |
| 69 // Type of shutdown. The value is one of "close" for WINDOW_CLOSE, | 62 // Type of shutdown. The value is one of "close" for WINDOW_CLOSE, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 // Numbers of active views. | 119 // Numbers of active views. |
| 127 extern const char kViewCount[]; | 120 extern const char kViewCount[]; |
| 128 | 121 |
| 129 // TEMPORARY: The encoder/frame details at the time a zero-length encoded frame | 122 // TEMPORARY: The encoder/frame details at the time a zero-length encoded frame |
| 130 // was encountered. http://crbug.com/519022 | 123 // was encountered. http://crbug.com/519022 |
| 131 extern const char kZeroEncodeDetails[]; | 124 extern const char kZeroEncodeDetails[]; |
| 132 | 125 |
| 133 } // namespace crash_keys | 126 } // namespace crash_keys |
| 134 | 127 |
| 135 #endif // CHROME_COMMON_CRASH_KEYS_H_ | 128 #endif // CHROME_COMMON_CRASH_KEYS_H_ |
| OLD | NEW |