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

Unified Diff: base/mach_ipc_mac.mm

Issue 3443002: [Mac] Replace the existing browser-child mach ipc with a long-lived listener ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | « base/mach_ipc_mac.h ('k') | base/process_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mach_ipc_mac.mm
===================================================================
--- base/mach_ipc_mac.mm (revision 59759)
+++ base/mach_ipc_mac.mm (working copy)
@@ -198,7 +198,12 @@
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 @@
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_,
« no previous file with comments | « base/mach_ipc_mac.h ('k') | base/process_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698