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

Unified Diff: util/mach/mach_extensions.h

Issue 1375573005: mac: Add CrashpadClient::UseSystemDefaultHandler() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 2 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
« no previous file with comments | « handler/mac/crash_report_exception_handler.cc ('k') | util/mach/mach_extensions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_extensions.h
diff --git a/util/mach/mach_extensions.h b/util/mach/mach_extensions.h
index 4f2861bf6446e2be186e3c6bc31956e970aa1c3b..c8753035dcf22873f02328cc20b300960fa241b8 100644
--- a/util/mach/mach_extensions.h
+++ b/util/mach/mach_extensions.h
@@ -17,6 +17,8 @@
#include <mach/mach.h>
+#include "base/mac/scoped_mach_port.h"
+
namespace crashpad {
//! \brief `MACH_PORT_NULL` with the correct type for a Mach port,
@@ -115,6 +117,20 @@ exception_mask_t ExcMaskAll();
//! support is present.
exception_mask_t ExcMaskValid();
+//! \brief Obtains the system’s default Mach exception handler for crash-type
+//! exceptions.
+//!
+//! This is obtained by looking up `"com.apple.ReportCrash"` with the bootstrap
+//! server. The service name comes from the first launch agent loaded by
+//! `launchd` with a `MachServices` entry having `ExceptionServer` set. This
+//! launch agent is normally loaded from
+//! `/System/Library/LaunchAgents/com.apple.ReportCrash.plist`.
+//!
+//! \return On success, a send right to an `exception_handler_t` corresponding
+//! to the system’s default crash reporter. On failure, `MACH_PORT_NULL`,
+//! with a message logged.
+base::mac::ScopedMachSendRight SystemCrashReporterHandler();
+
} // namespace crashpad
#endif // CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_
« no previous file with comments | « handler/mac/crash_report_exception_handler.cc ('k') | util/mach/mach_extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698