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

Unified Diff: handler/main.cc

Issue 1409073013: mac: Make crashpad_handler get its receive right from its client (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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/exception_handler_server.cc ('k') | snapshot/win/exception_snapshot_win_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/main.cc
diff --git a/handler/main.cc b/handler/main.cc
index 64a49d563cc40e6be0330f228fcaf698598d9001..de3171ed15d6e8b3522a89ac8475f083d9242d40 100644
--- a/handler/main.cc
+++ b/handler/main.cc
@@ -34,6 +34,7 @@
#if defined(OS_MACOSX)
#include <libgen.h>
+#include "base/mac/scoped_mach_port.h"
#include "handler/mac/crash_report_exception_handler.h"
#include "handler/mac/exception_handler_server.h"
#include "util/mach/child_port_handshake.h"
@@ -211,21 +212,21 @@ int HandlerMain(int argc, char* argv[]) {
}
#if defined(OS_MACOSX)
+ CloseStdinAndStdout();
+
if (options.reset_own_crash_exception_port_to_system_default) {
CrashpadClient::UseSystemDefaultHandler();
}
-#endif
-#if defined(OS_MACOSX)
- ExceptionHandlerServer exception_handler_server;
-
- CloseStdinAndStdout();
- if (!ChildPortHandshake::RunClientForFD(
+ base::mac::ScopedMachReceiveRight receive_right(
+ ChildPortHandshake::RunServerForFD(
base::ScopedFD(options.handshake_fd),
- exception_handler_server.receive_port(),
- MACH_MSG_TYPE_MAKE_SEND)) {
+ ChildPortHandshake::PortRightType::kReceiveRight));
+ if (!receive_right.is_valid()) {
return EXIT_FAILURE;
}
+
+ ExceptionHandlerServer exception_handler_server(receive_right.Pass());
#elif defined(OS_WIN)
ExceptionHandlerServer exception_handler_server(options.pipe_name);
#endif // OS_MACOSX
« no previous file with comments | « handler/mac/exception_handler_server.cc ('k') | snapshot/win/exception_snapshot_win_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698