summaryrefslogtreecommitdiffstats
path: root/base/mach_ipc_mac.mm
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
committerIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
commit3345a6884c488ff3a535c2c9acdd33d74b37e311 (patch)
tree7784b988ef1698cb6967ea1bdf07616237716c6c /base/mach_ipc_mac.mm
parentefc8475837ec58186051f23bb03542620424f6ce (diff)
downloadexternal_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.zip
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.gz
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.bz2
Merge Chromium at 7.0.540.0 : Initial merge by git
Not including third_party/icu as it contains huge data files that break Gerrit, and aren't actually used. Change-Id: I428a386e70f3b58cacd28677b8cfda282e891e15
Diffstat (limited to 'base/mach_ipc_mac.mm')
-rw-r--r--base/mach_ipc_mac.mm13
1 files changed, 11 insertions, 2 deletions
diff --git a/base/mach_ipc_mac.mm b/base/mach_ipc_mac.mm
index 973b66a..a0bfdc8 100644
--- a/base/mach_ipc_mac.mm
+++ b/base/mach_ipc_mac.mm
@@ -198,7 +198,12 @@ ReceivePort::ReceivePort(const char *receive_port_name) {
if (init_result_ != KERN_SUCCESS)
return;
- NSPort *ns_port = [NSMachPort portWithMachPort:port_];
+ // Without |NSMachPortDeallocateNone|, the NSMachPort seems to deallocate
+ // receive rights on port when it is eventually released. It is not necessary
+ // to deallocate any rights here as |port_| is fully deallocated in the
+ // ReceivePort destructor.
+ NSPort *ns_port = [NSMachPort portWithMachPort:port_
+ options:NSMachPortDeallocateNone];
NSString *port_name = [NSString stringWithUTF8String:receive_port_name];
[[NSMachBootstrapServer sharedInstance] registerPort:ns_port name:port_name];
}
@@ -252,8 +257,12 @@ kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message,
out_message->Head()->msgh_reserved = 0;
out_message->Head()->msgh_id = 0;
+ mach_msg_option_t rcv_options = MACH_RCV_MSG;
+ if (timeout != MACH_MSG_TIMEOUT_NONE)
+ rcv_options |= MACH_RCV_TIMEOUT;
+
kern_return_t result = mach_msg(out_message->Head(),
- MACH_RCV_MSG | MACH_RCV_TIMEOUT,
+ rcv_options,
0,
out_message->MaxSize(),
port_,