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

Unified Diff: handler/mac/exception_handler_server.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 | « handler/mac/exception_handler_server.h ('k') | test/mac/mach_multiprocess.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/mac/exception_handler_server.cc
diff --git a/handler/mac/exception_handler_server.cc b/handler/mac/exception_handler_server.cc
index 39348ec4953b128003c36d6674510353a62502a2..52da8faac9429fed9b53aa55d8ddbea2dc114994 100644
--- a/handler/mac/exception_handler_server.cc
+++ b/handler/mac/exception_handler_server.cc
@@ -41,7 +41,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
exception_port_(exception_port),
notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)),
running_(true) {
- CHECK_NE(notify_port_, kMachPortNull);
+ CHECK(notify_port_.is_valid());
composite_mach_message_server_.AddHandler(&mach_exc_server_);
composite_mach_message_server_.AddHandler(&notify_server_);
@@ -61,7 +61,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
exception_port_,
MACH_NOTIFY_NO_SENDERS,
0,
- notify_port_,
+ notify_port_.get(),
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&previous);
MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_request_notification";
@@ -83,11 +83,11 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
NewMachPort(MACH_PORT_RIGHT_PORT_SET));
kr = mach_port_insert_member(
- mach_task_self(), exception_port_, server_port_set);
+ mach_task_self(), exception_port_, server_port_set.get());
MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_insert_member";
kr = mach_port_insert_member(
- mach_task_self(), notify_port_, server_port_set);
+ mach_task_self(), notify_port_.get(), server_port_set.get());
MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_insert_member";
// Run the server in kOneShot mode so that running_ can be reevaluated after
@@ -98,7 +98,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
// DoMachNotifyNoSenders() as appropriate.
mach_msg_return_t mr =
MachMessageServer::Run(&composite_mach_message_server_,
- server_port_set,
+ server_port_set.get(),
kMachMessageReceiveAuditTrailer,
MachMessageServer::kOneShot,
MachMessageServer::kReceiveLargeIgnore,
@@ -221,7 +221,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
ExceptionHandlerServer::ExceptionHandlerServer()
: receive_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)) {
- CHECK_NE(receive_port_, kMachPortNull);
+ CHECK(receive_port_.is_valid());
}
ExceptionHandlerServer::~ExceptionHandlerServer() {
@@ -229,7 +229,7 @@ ExceptionHandlerServer::~ExceptionHandlerServer() {
void ExceptionHandlerServer::Run(
UniversalMachExcServer::Interface* exception_interface) {
- ExceptionHandlerServerRun run(receive_port_, exception_interface);
+ ExceptionHandlerServerRun run(receive_port_.get(), exception_interface);
run.Run();
}
« no previous file with comments | « handler/mac/exception_handler_server.h ('k') | test/mac/mach_multiprocess.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698