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

Unified Diff: test/mac/mach_multiprocess.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.cc ('k') | tools/mac/catch_exception_tool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mac/mach_multiprocess.cc
diff --git a/test/mac/mach_multiprocess.cc b/test/mac/mach_multiprocess.cc
index 6d410d38cee5eb00a3c269e4891f6df2bf6cf59d..65ea46df74bc1d9601b2d111074599d674427670 100644
--- a/test/mac/mach_multiprocess.cc
+++ b/test/mac/mach_multiprocess.cc
@@ -98,22 +98,22 @@ void MachMultiprocess::PreFork() {
}
info_->local_port = BootstrapCheckIn(info_->service_name);
- ASSERT_NE(kMachPortNull, info_->local_port);
+ ASSERT_TRUE(info_->local_port.is_valid());
}
mach_port_t MachMultiprocess::LocalPort() const {
- EXPECT_NE(kMachPortNull, info_->local_port);
- return info_->local_port;
+ EXPECT_TRUE(info_->local_port.is_valid());
+ return info_->local_port.get();
}
mach_port_t MachMultiprocess::RemotePort() const {
- EXPECT_NE(kMachPortNull, info_->remote_port);
- return info_->remote_port;
+ EXPECT_TRUE(info_->remote_port.is_valid());
+ return info_->remote_port.get();
}
task_t MachMultiprocess::ChildTask() const {
- EXPECT_NE(TASK_NULL, info_->child_task);
- return info_->child_task;
+ EXPECT_TRUE(info_->child_task.is_valid());
+ return info_->child_task.get();
}
void MachMultiprocess::MultiprocessParent() {
@@ -123,7 +123,7 @@ void MachMultiprocess::MultiprocessParent() {
MACH_RCV_MSG | kMachMessageReceiveAuditTrailer,
0,
sizeof(message),
- info_->local_port,
+ info_->local_port.get(),
MACH_MSG_TIMEOUT_NONE,
MACH_PORT_NULL);
ASSERT_EQ(MACH_MSG_SUCCESS, kr) << MachErrorMessage(kr, "mach_msg");
@@ -198,7 +198,7 @@ void MachMultiprocess::MultiprocessParent() {
// Verify that the child’s task port is what it purports to be.
int mach_pid;
- kr = pid_for_task(info_->child_task, &mach_pid);
+ kr = pid_for_task(info_->child_task.get(), &mach_pid);
ASSERT_EQ(KERN_SUCCESS, kr) << MachErrorMessage(kr, "pid_for_task");
ASSERT_EQ(ChildPID(), mach_pid);
@@ -229,8 +229,8 @@ void MachMultiprocess::MultiprocessChild() {
MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, MACH_MSG_TYPE_MAKE_SEND) |
MACH_MSGH_BITS_COMPLEX;
message.header.msgh_size = sizeof(message);
- message.header.msgh_remote_port = info_->remote_port;
- message.header.msgh_local_port = info_->local_port;
+ message.header.msgh_remote_port = info_->remote_port.get();
+ message.header.msgh_local_port = info_->local_port.get();
message.body.msgh_descriptor_count = 1;
message.port_descriptor.name = mach_task_self();
message.port_descriptor.disposition = MACH_MSG_TYPE_COPY_SEND;
« no previous file with comments | « handler/mac/exception_handler_server.cc ('k') | tools/mac/catch_exception_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698