Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1940)

Unified Diff: base/mac/crash_logging.h

Issue 7849011: Refactor Mac crash key reporting - move to base/mac/crash_logging.{h,mm} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/mac/crash_logging.h
diff --git a/base/mac/crash_logging.h b/base/mac/crash_logging.h
new file mode 100644
index 0000000000000000000000000000000000000000..006c847e32db558512a244dfed92dbf2b5199c79
--- /dev/null
+++ b/base/mac/crash_logging.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_MAC_CRASH_LOGGING_H_
+#define BASE_MAC_CRASH_LOGGING_H_
+
+#if __OBJC__
Scott Hess - ex-Googler 2011/09/08 19:46:46 I think this stuff was in the breakpad_mac.h becau
+#import "base/memory/scoped_nsobject.h"
+
+@class NSString;
+#else
+class NSString;
+#endif
+
+namespace base {
+namespace mac {
+
+typedef void (*SetCrashKeyValueFuncPtr)(NSString*, NSString*);
+typedef void (*ClearCrashKeyValueFuncPtr)(NSString*);
+
+// Set the low level functions used to supply crash keys to Breakpad.
+void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func,
+ ClearCrashKeyValueFuncPtr clear_key_func);
+
+// Set and clear meta information for Minidump.
+// IMPORTANT: On OS X, the key/value pairs are sent to the crash server
+// out of bounds and not recorded on disk in the minidump, this means
+// that if you look at the minidump file locally you won't see them!
+void SetCrashKeyValue(NSString* key, NSString* val);
+void ClearCrashKey(NSString* key);
+
+#if __OBJC__
+
+class ScopedCrashKey {
+ public:
+ ScopedCrashKey(NSString* key, NSString* value);
+ ~ScopedCrashKey();
+ private:
+ scoped_nsobject<NSString> crash_key_;
+ DISALLOW_COPY_AND_ASSIGN(ScopedCrashKey);
+};
+
+#endif // __OBJC__
+
+} // namespace mac
+} // namespace base
+
+#endif // BASE_MAC_CRASH_LOGGING_H_
« no previous file with comments | « base/base.gypi ('k') | base/mac/crash_logging.mm » ('j') | chrome/app/breakpad_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698