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

Unified Diff: client/crashpad_client_mac.cc

Issue 1405273002: Mach port scopers should use get() instead of type conversion operators (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: More is_valid() 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 | « no previous file | client/simulate_crash_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/crashpad_client_mac.cc
diff --git a/client/crashpad_client_mac.cc b/client/crashpad_client_mac.cc
index a180fd193e40a8384751a61a1ecda19ca8d2906f..5797fba8ba297574efe50e75932659a684431366 100644
--- a/client/crashpad_client_mac.cc
+++ b/client/crashpad_client_mac.cc
@@ -92,7 +92,7 @@ bool CrashpadClient::StartHandler(
const std::string& url,
const std::map<std::string, std::string>& annotations,
const std::vector<std::string>& arguments) {
- DCHECK_EQ(exception_port_, kMachPortNull);
+ DCHECK(!exception_port_.is_valid());
// Set up the arguments for execve() first. These aren’t needed until execve()
// is called, but it’s dangerous to do this in a child process after fork().
@@ -211,13 +211,13 @@ bool CrashpadClient::StartHandler(
// Rendezvous with the handler running in the grandchild process.
exception_port_.reset(child_port_handshake.RunServer());
- return exception_port_ ? true : false;
+ return exception_port_.is_valid();
}
bool CrashpadClient::UseHandler() {
- DCHECK_NE(exception_port_, kMachPortNull);
+ DCHECK(exception_port_.is_valid());
- return SetCrashExceptionPorts(exception_port_);
+ return SetCrashExceptionPorts(exception_port_.get());
}
// static
@@ -227,7 +227,7 @@ void CrashpadClient::UseSystemDefaultHandler() {
// Proceed even if SystemCrashReporterHandler() failed, setting MACH_PORT_NULL
// to clear the current exception ports.
- if (!SetCrashExceptionPorts(system_crash_reporter_handler)) {
+ if (!SetCrashExceptionPorts(system_crash_reporter_handler.get())) {
SetCrashExceptionPorts(MACH_PORT_NULL);
}
}
« no previous file with comments | « no previous file | client/simulate_crash_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698