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_MAC_CRASH_LOGGING_H_ | 5 #ifndef BASE_MAC_CRASH_LOGGING_H_ |
6 #define BASE_MAC_CRASH_LOGGING_H_ | 6 #define BASE_MAC_CRASH_LOGGING_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 | 9 |
10 #if __OBJC__ | 10 #if __OBJC__ |
(...skipping 14 matching lines...) Expand all Loading... |
25 BASE_EXPORT void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func, | 25 BASE_EXPORT void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func, |
26 ClearCrashKeyValueFuncPtr clear_key_func); | 26 ClearCrashKeyValueFuncPtr clear_key_func); |
27 | 27 |
28 // Set and clear meta information for Minidump. | 28 // Set and clear meta information for Minidump. |
29 // IMPORTANT: On OS X, the key/value pairs are sent to the crash server | 29 // IMPORTANT: On OS X, the key/value pairs are sent to the crash server |
30 // out of bounds and not recorded on disk in the minidump, this means | 30 // out of bounds and not recorded on disk in the minidump, this means |
31 // that if you look at the minidump file locally you won't see them! | 31 // that if you look at the minidump file locally you won't see them! |
32 BASE_EXPORT void SetCrashKeyValue(NSString* key, NSString* val); | 32 BASE_EXPORT void SetCrashKeyValue(NSString* key, NSString* val); |
33 BASE_EXPORT void ClearCrashKey(NSString* key); | 33 BASE_EXPORT void ClearCrashKey(NSString* key); |
34 | 34 |
| 35 // Format |count| items from |addresses| using %p, and set the |
| 36 // resulting string as value for crash key |key|. A maximum of 23 |
| 37 // items will be encoded, since breakpad limits values to 255 bytes. |
| 38 BASE_EXPORT void SetCrashKeyFromAddresses(NSString* key, |
| 39 const void* const* addresses, |
| 40 size_t count); |
| 41 |
35 #if __OBJC__ | 42 #if __OBJC__ |
36 | 43 |
37 class BASE_EXPORT ScopedCrashKey { | 44 class BASE_EXPORT ScopedCrashKey { |
38 public: | 45 public: |
39 ScopedCrashKey(NSString* key, NSString* value); | 46 ScopedCrashKey(NSString* key, NSString* value); |
40 ~ScopedCrashKey(); | 47 ~ScopedCrashKey(); |
41 private: | 48 private: |
42 scoped_nsobject<NSString> crash_key_; | 49 scoped_nsobject<NSString> crash_key_; |
43 DISALLOW_COPY_AND_ASSIGN(ScopedCrashKey); | 50 DISALLOW_COPY_AND_ASSIGN(ScopedCrashKey); |
44 }; | 51 }; |
45 | 52 |
46 #endif // __OBJC__ | 53 #endif // __OBJC__ |
47 | 54 |
48 } // namespace mac | 55 } // namespace mac |
49 } // namespace base | 56 } // namespace base |
50 | 57 |
51 #endif // BASE_MAC_CRASH_LOGGING_H_ | 58 #endif // BASE_MAC_CRASH_LOGGING_H_ |
OLD | NEW |