Refactor SharedMemory::Create and fix a rare file leak.

I moved some of the logic in SharedMemory::Create() into a new method
CreateAnonymousSharedMemory(). I also fixed a bug in the logic that would cause
temporary files to be leaked if a readonly_fd could not be obtained for the
file.

The refactor is in preparation for an A/B test that batch-opens files for
SharedMemory.

BUG=492803

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

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


CrOS-Libchrome-Original-Commit: ac65f08b51fc5898d6a8cc86da6334da81e1e245
1 file changed
tree: f2a7d14928e12da7ec5cb556a90caa20137ba451
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/