Reland 1: "mac: Add auto-close and share-read-only functionality to SharedMemory."

The original CL had a bug in the unit tests where an incorrect
parameter was passed to mach_vm_region.

> base::FileDescriptor has a property |auto_close| that is used to indicate that
> when the object is passed to an IPC message, the message takes ownership of the
> underlying OS handle. Since SharedMemoryHandle needs to be interchangeable with
> base::FileDescriptor, I added a property with similar functionality named
> |ownership_passes_to_ipc_|.
>
> The method ShareToProcess() is used to lower the current and maximum protection
> of the underlying OS handle before it is transferred to a different process. I
> implemented this functionality for Mach memory objects.
>
> BUG=535711
> Committed: https://crrev.com/033bbbcb63cab781552dfb435c035131c423de30
> Cr-Commit-Position: refs/heads/master@{#355880}

BUG=535711
TBR=tsepez@chromium.org, mark@chromium.org

Review URL: https://codereview.chromium.org/1422873002

Cr-Commit-Position: refs/heads/master@{#355941}


CrOS-Libchrome-Original-Commit: 328bf3f3a685d97426e9095b7b3d58836ef665b0
2 files changed
tree: 675907ae3b1d19c563dcb8644fc3c08b403b4f9b
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/