gecko-dev/ipc/chromium
Jed Davis 6f2db7351f Bug 1447867 - Replace base::SharedMemory POSIX backend with shm_open and ashmem. r=froydnj
This replaces using file_util to open and unlink temporary files
(/dev/shm on Linux, $TMPDIR or /tmp otherwise) with the POSIX shm_open
API, or ashmem on Android (which doesn't implement shm_open).

glibc maps shm_open/shm_unlink to open and unlink in /dev/shm (as does
musl libc), so the Linux situation is mostly unchanged except we aren't
duplicating code from system libraries.  Other OSes may (and some do)
use more efficient implementations than temporary files.

FreeBSD's SHM_ANON extension is used if available.  Sadly, it's not
standard; it would make this patch much simpler if it were.

This patch changes the shm file names; they now start with "org.mozilla"
instead of "org.chromium" because the original Chromium code is mostly
gone at this point.  When running as a Snap package, the required
filename prefix is added; other container/sandbox environments using
AppArmor to restrict the allowed filenames may need to be adjusted.

The shm names now include the creating process's pid, to allow
using sandboxing to prevent interfering with shm belonging to other
applications or other processes within the same browser instance.

MozReview-Commit-ID: 7PirIlcblh4

--HG--
extra : rebase_source : 550a0ab013429c29a57bde5c0e4593d9b426da8e
2018-04-12 21:37:38 -06:00
..
atomics Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
src Bug 1447867 - Replace base::SharedMemory POSIX backend with shm_open and ashmem. r=froydnj 2018-04-12 21:37:38 -06:00
chromium-config.mozbuild Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r=glandium 2017-12-08 13:46:13 +01:00
moz.build Bug 1426513, part 3 - Remove CPU and TimeTicks::HighResNow. r=jld 2017-12-20 14:06:44 -08:00