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

Unified Diff: util/mach/mach_message_server.cc

Issue 777993002: MachMessageServer: eliminate argument redundancy (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Rebase Created 6 years 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_message_server.h ('k') | util/mach/mach_message_server_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_message_server.cc
diff --git a/util/mach/mach_message_server.cc b/util/mach/mach_message_server.cc
index fea0b5d477644df29fc69374016a06fb9a6b5825..0af190184309fe7eca814ddc4fbc34adbfb4c774 100644
--- a/util/mach/mach_message_server.cc
+++ b/util/mach/mach_message_server.cc
@@ -116,28 +116,20 @@ mach_msg_return_t MachMessageAllocateReceive(MachMessageBuffer* request,
// xnu-2422.110.17/libsyscall/mach/mach_msg.c mach_msg_server_once(). The server
// callback function and |max_size| parameter have been replaced with a C++
// interface. The |persistent| parameter has been added, allowing this method to
-// serve as a stand-in for mach_msg_server(). The |nonblocking| parameter has
-// been added, allowing blocking to be controlled directly. The |timeout_ms|
-// parameter has been added, allowing this function to not block indefinitely.
+// serve as a stand-in for mach_msg_server(). The |timeout_ms| parameter has
+// been added, allowing this function to not block indefinitely.
//
// static
mach_msg_return_t MachMessageServer::Run(Interface* interface,
mach_port_t receive_port,
mach_msg_options_t options,
Persistent persistent,
- Nonblocking nonblocking,
ReceiveLarge receive_large,
mach_msg_timeout_t timeout_ms) {
options &= ~(MACH_RCV_MSG | MACH_SEND_MSG);
- MachMessageDeadline deadline;
- if (nonblocking == kNonblocking) {
- deadline = kMachMessageNonblocking;
- } else if (timeout_ms == MACH_MSG_TIMEOUT_NONE) {
- deadline = kMachMessageWaitIndefinitely;
- } else {
- deadline = MachMessageDeadlineFromTimeout(timeout_ms);
- }
+ const MachMessageDeadline deadline =
+ MachMessageDeadlineFromTimeout(timeout_ms);
if (receive_large == kReceiveLargeResize) {
options |= MACH_RCV_LARGE;
@@ -259,8 +251,9 @@ mach_msg_return_t MachMessageServer::Run(Interface* interface,
// without considering the user-specified timeout. See 10.9.5
// xnu-2422.115.4/osfmk/ipc/ipc_mqueue.c ipc_mqueue_send().
const MachMessageDeadline send_deadline =
- deadline == kMachMessageWaitIndefinitely ? kMachMessageNonblocking
- : deadline;
+ deadline == kMachMessageDeadlineWaitIndefinitely
+ ? kMachMessageDeadlineNonblocking
+ : deadline;
kr = MachMessageWithDeadline(reply_header,
options | MACH_SEND_MSG,
« no previous file with comments | « util/mach/mach_message_server.h ('k') | util/mach/mach_message_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698