gecko-dev/xpcom/build
Nicholas Nethercote 68124009fc Bug 1438678 - Pass early prefs via shared memory instead of the command line. r=bobowen,jld,glandium.
This patch replaces the large -intPrefs/-boolPrefs/-stringPrefs flags with
a short-lived, anonymous, shared memory segment that is used to pass the early
prefs.

Removing the bloat from the command line is nice, but more important is the
fact that this will let us pass more prefs at content process start-up, which
will allow us to remove the early/late prefs split (bug 1436911).

Although this mechanism is only used for prefs, it's conceivable that it could
be used for other data that must be received very early by children, and for
which the command line isn't ideal.

Notable details:

- Much of the patch deals with the various platform-specific ways of passing
  handles/fds to children.

  - Linux and Mac: we use a fixed fd (8) in combination with the new
    GeckoChildProcessHost::AddFdToRemap() function (which ensures the child
    won't close the fd).

  - Android: like Linux and Mac, but the handles get passed via "parcels" and
    we use the new SetPrefsFd() function instead of the fixed fd.

  - Windows: there is no need to duplicate the handle because Windows handles
    are system-wide. But we do use the new
    GeckoChildProcessHost::AddHandleToShare() function to add it to the list of
    inheritable handles. We also ensure that list is processed on all paths
    (MOZ_SANDBOX with sandbox, MOZ_SANDBOX without sandbox, non-MOZ_SANDBOX) so
    that the handles are marked as inheritable. The handle is passed via the
    -prefsHandle flag.

  The -prefsLen flag is used on all platforms to indicate the size of the
  shared memory segment.

- The patch also moves the serialization/deserialization of the prefs in/out of
  the shared memory into libpref, which is a better spot for it. (This means
  Preferences::MustSendToContentProcesses() can be removed.)

MozReview-Commit-ID: 8fREEBiYFvc

--HG--
extra : rebase_source : 7e4c8ebdbcd7d74d6bd2ab3c9e75a6a17dbd8dfe
2018-02-16 17:54:16 +11:00
..
BinaryPath.h Bug 1403366 - Stop requiring argv[0] for XRE_GetBinaryPath and the underlying BinaryPath::Get. r=froydnj 2017-09-28 10:37:27 +09:00
FileLocation.cpp Bug 870698 - Part 3: Replace Insert("") with InsertLiteral(""). r=erahm 2017-09-05 12:41:31 -07:00
FileLocation.h Bug 1363482: Part 2 - Allow pre-loading file and JAR entry contents off-thread during startup. r=erahm 2017-08-30 15:47:17 -07:00
IOInterposer.cpp
IOInterposer.h Bug 1407458 - Use nsString for Observation filenames. r=erahm. 2017-10-17 08:22:12 +11:00
IOInterposerPrivate.h
LateWriteChecks.cpp Bug 1428557 - Stop using GetNativePath in xpcom/. r=froydnj 2017-12-15 06:53:37 +09:00
LateWriteChecks.h
MainThreadIOLogger.cpp Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
MainThreadIOLogger.h
NSPRInterposer.cpp
NSPRInterposer.h
Omnijar.cpp
Omnijar.h
PoisonIOInterposer.h Bug 1441558 Do not compile the Poison IO Interposer on MinGW r=froydnj 2018-02-20 13:40:24 -06:00
PoisonIOInterposerBase.cpp Bug 1373525 - xpcom/build: Remove unused member function DebugFilesAutoLock::Clear(). r=froydnj 2017-06-07 00:56:55 -07:00
PoisonIOInterposerMac.cpp Bug 1407458 - Use nsString for Observation filenames. r=erahm. 2017-10-17 08:22:12 +11:00
PoisonIOInterposerStub.cpp
PoisonIOInterposerWin.cpp Bug 1407458 - Use nsString for Observation filenames. r=erahm. 2017-10-17 08:22:12 +11:00
Services.py Bug 1293362 - Part 6: Expose the cached XPCOM service getters to rust code, r=froydnj 2018-01-23 17:27:30 -05:00
XPCOM.h Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
XPCOMInit.cpp Bug 1437575 - Better shutdown hang reporting: all the notifications must be received, r=smaug 2018-02-13 11:55:16 +01:00
XPCOMModule.inc Bug 1412981 - Remove nsIStatusReporter as it is unused. r=froydnj 2017-10-30 18:49:05 +00:00
XREAppData.h Bug 1407838 - Replace UniquePtr<T, NSFreePolicy> with UniqueFreePtr. r=njn 2017-10-12 11:22:05 +09:00
XREChildData.h
XREShellData.h
mach_override.c Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
mach_override.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
moz.build Bug 1441558 Do not compile the Poison IO Interposer on MinGW r=froydnj 2018-02-20 13:40:24 -06:00
nsWindowsDllInterceptor.h Bug 1382251: Part 2 - Allow constructing nsWindowsDllInterceptor from module name; r=aklotz 2017-11-06 09:51:06 -08:00
nsXPCOM.h Bug 1407838 - Remove the remains of NS_Alloc/NS_Realloc/NS_Free. r=njn 2017-10-12 11:08:44 +09:00
nsXPCOMCID.h Bug 1412981 - Remove nsIStatusReporter as it is unused. r=froydnj 2017-10-30 18:49:05 +00:00
nsXPCOMCIDInternal.h
nsXPCOMPrivate.h
nsXULAppAPI.h Bug 1438678 - Pass early prefs via shared memory instead of the command line. r=bobowen,jld,glandium. 2018-02-16 17:54:16 +11:00
perfprobe.cpp
perfprobe.h
xpcom_alpha.def
xrecore.h