diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-11 14:27:28 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-11 14:27:28 +0000 |
commit | 3c2119d7a7f185dcb88b08df914f9889519ada8b (patch) | |
tree | 070e81ea465bca6b66487d8cb81d667e619e5365 /base/mac | |
parent | 20d983c5eacef34d6a0e729aaa887475eb2b0861 (diff) | |
download | chromium_src-3c2119d7a7f185dcb88b08df914f9889519ada8b.zip chromium_src-3c2119d7a7f185dcb88b08df914f9889519ada8b.tar.gz chromium_src-3c2119d7a7f185dcb88b08df914f9889519ada8b.tar.bz2 |
[Mac] Remove base::LaunchSynchronize and rewrite content::MachBroker.
This restructures the way MachBroker parent-child communication happens. Now,
the MachBroker lock will be held for the duration of LaunchProcess until the
PID is returned and inserted into the MachMap. Since the lock must also be
acquired on the broker thread to insert the received task port into the
MachMap, this ensures that the placeholder is always inserted before the task
port.
MachBroker has also been rewritten to use Mach IPC directly, rather than the C++
wrappers in base/mach_ipc_mac.h. The wrappers are not flexible enough to allow
the use of an audit trailer. This trailer is used to verify the PID of the
sender of the check in message in the parent. Previously, this was done by
another kernel trap, pid_for_task.
BUG=179923
Originally Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193486
Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=193511
Review URL: https://codereview.chromium.org/13845008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac')
-rw-r--r-- | base/mac/scoped_mach_port.cc | 5 | ||||
-rw-r--r-- | base/mac/scoped_mach_port.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/base/mac/scoped_mach_port.cc b/base/mac/scoped_mach_port.cc index 652e3f4..9e45a85 100644 --- a/base/mac/scoped_mach_port.cc +++ b/base/mac/scoped_mach_port.cc @@ -11,9 +11,14 @@ ScopedMachPort::ScopedMachPort(mach_port_t port) : port_(port) { } ScopedMachPort::~ScopedMachPort() { + reset(); +} + +void ScopedMachPort::reset(mach_port_t port) { if (port_ != MACH_PORT_NULL) { mach_port_deallocate(mach_task_self(), port_); } + port_ = port; } } // namespace mac diff --git a/base/mac/scoped_mach_port.h b/base/mac/scoped_mach_port.h index d2aa2f7..cc2ef20 100644 --- a/base/mac/scoped_mach_port.h +++ b/base/mac/scoped_mach_port.h @@ -22,6 +22,8 @@ class BASE_EXPORT ScopedMachPort { ~ScopedMachPort(); + void reset(mach_port_t port = MACH_PORT_NULL); + operator mach_port_t() const { return port_; } |