| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_DEBUG_CRASH_LOGGING_H_ | 5 #ifndef BASE_DEBUG_CRASH_LOGGING_H_ |
| 6 #define BASE_DEBUG_CRASH_LOGGING_H_ | 6 #define BASE_DEBUG_CRASH_LOGGING_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 size_t max_length; | 103 size_t max_length; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 // Before the crash key logging mechanism can be used, all crash keys must be | 106 // Before the crash key logging mechanism can be used, all crash keys must be |
| 107 // registered with this function. The function returns the amount of space | 107 // registered with this function. The function returns the amount of space |
| 108 // the crash reporting implementation should allocate space for the registered | 108 // the crash reporting implementation should allocate space for the registered |
| 109 // crash keys. |chunk_max_length| is the maximum size that a value in a single | 109 // crash keys. |chunk_max_length| is the maximum size that a value in a single |
| 110 // chunk can be. | 110 // chunk can be. |
| 111 BASE_EXPORT size_t InitCrashKeys(const CrashKey* const keys, size_t count, | 111 BASE_EXPORT size_t InitCrashKeys(const CrashKey* const keys, size_t count, |
| 112 size_t chunk_max_length); | 112 size_t chunk_max_length); |
| 113 // Some clients need to log a sub-set of the crash-keys added by lower layers, |
| 114 // |ignore_unregistered_keys| allows clients to ignore any keys that haven't |
| 115 // been explicitly registered. |
| 116 BASE_EXPORT size_t InitCrashKeys(const CrashKey* const keys, |
| 117 size_t count, |
| 118 size_t chunk_max_length, |
| 119 bool ignore_unregistered_keys); |
| 113 | 120 |
| 114 // Returns the corresponding crash key object or NULL for a given key. | 121 // Returns the corresponding crash key object or NULL for a given key. |
| 115 BASE_EXPORT const CrashKey* LookupCrashKey(const base::StringPiece& key); | 122 BASE_EXPORT const CrashKey* LookupCrashKey(const base::StringPiece& key); |
| 116 | 123 |
| 117 // In the platform crash reporting implementation, these functions set and | 124 // In the platform crash reporting implementation, these functions set and |
| 118 // clear the NUL-terminated key-value pairs. | 125 // clear the NUL-terminated key-value pairs. |
| 119 typedef void (*SetCrashKeyValueFuncT)(const base::StringPiece&, | 126 typedef void (*SetCrashKeyValueFuncT)(const base::StringPiece&, |
| 120 const base::StringPiece&); | 127 const base::StringPiece&); |
| 121 typedef void (*ClearCrashKeyValueFuncT)(const base::StringPiece&); | 128 typedef void (*ClearCrashKeyValueFuncT)(const base::StringPiece&); |
| 122 | 129 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 133 const base::StringPiece& value, | 140 const base::StringPiece& value, |
| 134 size_t chunk_max_length); | 141 size_t chunk_max_length); |
| 135 | 142 |
| 136 // Resets the crash key system so it can be reinitialized. For testing only. | 143 // Resets the crash key system so it can be reinitialized. For testing only. |
| 137 BASE_EXPORT void ResetCrashLoggingForTesting(); | 144 BASE_EXPORT void ResetCrashLoggingForTesting(); |
| 138 | 145 |
| 139 } // namespace debug | 146 } // namespace debug |
| 140 } // namespace base | 147 } // namespace base |
| 141 | 148 |
| 142 #endif // BASE_DEBUG_CRASH_LOGGING_H_ | 149 #endif // BASE_DEBUG_CRASH_LOGGING_H_ |
| OLD | NEW |