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