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

Unified Diff: util/mach/mach_extensions.cc

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 | « util/mach/mach_extensions.h ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_extensions.cc
diff --git a/util/mach/mach_extensions.cc b/util/mach/mach_extensions.cc
index a3e147cc3bee2b01d7f5c5fab6eb639f52dfa7f2..c2343c218085c5abe8b9d099c75c21cf698fb3ec 100644
--- a/util/mach/mach_extensions.cc
+++ b/util/mach/mach_extensions.cc
@@ -16,6 +16,7 @@
#include <AvailabilityMacros.h>
#include <pthread.h>
+#include <servers/bootstrap.h>
#include "base/mac/mach_logging.h"
#include "util/mac/mac_util.h"
@@ -96,4 +97,19 @@ exception_mask_t ExcMaskValid() {
return kExcMaskValid_10_11;
}
+base::mac::ScopedMachSendRight SystemCrashReporterHandler() {
+ const char kSystemCrashReporterServiceName[] = "com.apple.ReportCrash";
+ exception_handler_t system_crash_reporter_handler;
+ kern_return_t kr = bootstrap_look_up(bootstrap_port,
+ kSystemCrashReporterServiceName,
+ &system_crash_reporter_handler);
+ if (kr != BOOTSTRAP_SUCCESS) {
+ BOOTSTRAP_LOG(ERROR, kr) << "bootstrap_look_up "
+ << kSystemCrashReporterServiceName;
+ system_crash_reporter_handler = MACH_PORT_NULL;
+ }
+
+ return base::mac::ScopedMachSendRight(system_crash_reporter_handler);
+}
+
} // namespace crashpad
« no previous file with comments | « util/mach/mach_extensions.h ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698