gecko-dev/ipc/glue
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
..
BackgroundChild.h Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 20 - main part, r=asuth 2017-10-24 12:02:41 +02:00
BackgroundChildImpl.cpp Bug 1201590 - WebMIDI Content implementation; r=baku,padenot 2017-11-15 11:18:58 -08:00
BackgroundChildImpl.h Bug 1201590 - WebMIDI Content implementation; r=baku,padenot 2017-11-15 11:18:58 -08:00
BackgroundImpl.cpp Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 20 - main part, r=asuth 2017-10-24 12:02:41 +02:00
BackgroundParent.h Bug 1350637 - Part 8: Implement BackgroundParent::GetLiveActorArray; r=billm 2017-08-08 23:02:16 +02:00
BackgroundParentImpl.cpp Bug 1201590 - WebMIDI Parent/PBackground implementation; r=baku,padenot 2017-11-15 11:19:59 -08:00
BackgroundParentImpl.h Bug 1201590 - WebMIDI Parent/PBackground implementation; r=baku,padenot 2017-11-15 11:19:59 -08:00
BackgroundUtils.cpp Bug 1438935 - Serialize selected LoadInfo properties from HTTPChannelParent to HTTPChannelChild through OnStartRequest and Redirect1Begin, r=asuth 2018-03-06 08:07:00 +02:00
BackgroundUtils.h Bug 1438935 - Serialize selected LoadInfo properties from HTTPChannelParent to HTTPChannelChild through OnStartRequest and Redirect1Begin, r=asuth 2018-03-06 08:07:00 +02:00
BrowserProcessSubThread.cpp Bug 1357451 - Add OS_SOLARIS ifdefs to various IPC code. r=kchen 2017-04-18 08:53:59 -07:00
BrowserProcessSubThread.h Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
ByteBuf.h Bug 1379680. Add an ipc ByteBuf type. r=billm 2017-11-29 10:11:15 -05:00
CrashReporterClient.cpp Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
CrashReporterClient.h Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
CrashReporterHost.cpp Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
CrashReporterHost.h Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
CrashReporterMetadataShmem.cpp Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
CrashReporterMetadataShmem.h Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
CrossProcessMutex_posix.cpp Bug 1356289 - Part 1. Make SharedMemory::SetHandle accept an access rights parameter. r=billm 2017-04-18 12:24:58 -04:00
CrossProcessMutex_unimplemented.cpp
CrossProcessMutex_windows.cpp
CrossProcessMutex.h
CrossProcessSemaphore_posix.cpp Allocate TextureReadLock at TextureClient creation and drop file handles immediately after. (bug 1416726, r=aosmond) 2018-03-12 08:10:13 -05:00
CrossProcessSemaphore_unimplemented.cpp Allocate TextureReadLock at TextureClient creation and drop file handles immediately after. (bug 1416726, r=aosmond) 2018-03-12 08:10:13 -05:00
CrossProcessSemaphore_windows.cpp Allocate TextureReadLock at TextureClient creation and drop file handles immediately after. (bug 1416726, r=aosmond) 2018-03-12 08:10:13 -05:00
CrossProcessSemaphore.h Allocate TextureReadLock at TextureClient creation and drop file handles immediately after. (bug 1416726, r=aosmond) 2018-03-12 08:10:13 -05:00
EnvironmentMap.h Bug 1297740. r=jld 2018-01-08 10:07:16 +01:00
Faulty.cpp Bug 1365321 - remove warnings from faulty r=billm 2017-05-23 08:54:46 -07:00
Faulty.h
FileDescriptor.cpp Bug 1440511 - Part 4: Add an IPDLParamTraits implementation for FileDescriptor, r=froydnj 2018-03-05 16:00:02 -05:00
FileDescriptor.h Bug 1440511 - Part 4: Add an IPDLParamTraits implementation for FileDescriptor, r=froydnj 2018-03-05 16:00:02 -05:00
FileDescriptorSetChild.cpp
FileDescriptorSetChild.h
FileDescriptorSetParent.cpp
FileDescriptorSetParent.h
FileDescriptorUtils.cpp
FileDescriptorUtils.h
GeckoChildProcessHost.cpp 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
GeckoChildProcessHost.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
InputStreamParams.ipdlh Bug 1403706 - Remove race conditions in temporary blob - part 8 - Remove nsTemporaryFileInputStream, r=smaug 2017-10-05 07:41:43 +02:00
InputStreamUtils.cpp Bug 1414767 - Moving SlicedInputStream under mozilla namespace, r=froydnj 2017-11-07 01:04:06 +01:00
InputStreamUtils.h
IOThreadChild.h
IPCMessageUtils.cpp
IPCMessageUtils.h Bug 1431867 - Part 1: Remove some unnecessary complexity from generated IPDL structs, r=mccr8 2018-02-01 11:30:49 -05:00
IPCStream.ipdlh Bug 1353475 - Implement AutoIPCStream with delayed start - part 2 - delayed start, r=smaug 2017-04-24 12:09:39 +02:00
IPCStreamAlloc.h
IPCStreamChild.cpp Bug 1351488 - Simplify IPCStreamSource::DoRead() and remove reallocation of the buffer (r=asuth) 2017-08-29 10:42:33 -05:00
IPCStreamDestination.cpp Bug 1351488 - Simplify IPCStreamSource::DoRead() and remove reallocation of the buffer (r=asuth) 2017-08-29 10:42:33 -05:00
IPCStreamDestination.h Bug 1351488 - Simplify IPCStreamSource::DoRead() and remove reallocation of the buffer (r=asuth) 2017-08-29 10:42:33 -05:00
IPCStreamParent.cpp Bug 1351488 - Simplify IPCStreamSource::DoRead() and remove reallocation of the buffer (r=asuth) 2017-08-29 10:42:33 -05:00
IPCStreamSource.cpp Bug 1435174 - Remove the renaming 'using namespace workers', r=bkelly 2018-02-05 19:55:07 +01:00
IPCStreamSource.h Bug 1432963 - Fixing workers headers - part 14 - WorkerPrivate without workers namespace, r=smaug 2018-01-31 08:24:08 +01:00
IPCStreamUtils.cpp Bug 1440771 - Part 1: Add a ParamTraits impl for nsCOMPtr<nsIInputStream>, r=baku 2018-03-05 16:00:05 -05:00
IPCStreamUtils.h Bug 1440771 - Part 1: Add a ParamTraits impl for nsCOMPtr<nsIInputStream>, r=baku 2018-03-05 16:00:05 -05:00
IPDLParamTraits.h Bug 1440511 - Part 3: Add IPDLParamTraits which supports passing in an actor when {un,}pickling, r=froydnj 2018-03-05 16:00:01 -05:00
MessageChannel.cpp Bug 1423261: Submit IPC protocol names in shutdown crash reports in a way that Socorro is able to display. r=jimm 2018-03-12 11:11:44 -04:00
MessageChannel.h Bug 1418048 - Part 2: Pass callbacks by rvalue reference when possible, a=bustage 2017-11-20 18:12:21 -05:00
MessageLink.cpp Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
MessageLink.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
MessagePump.cpp Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn 2017-09-24 19:57:48 -07:00
MessagePump.h Bug 1391848 - Use nsIEventTarget instead of nsIThread for MessageLoop/Pump (r=kanru) 2017-08-25 10:28:23 -07:00
moz.build Bug 1440511 - Part 3: Add IPDLParamTraits which supports passing in an actor when {un,}pickling, r=froydnj 2018-03-05 16:00:01 -05:00
Neutering.h
nsIIPCSerializableInputStream.h
nsIIPCSerializableURI.h Bug 1441688 - Remove nsIIPCSerializableURI.Deserialize r=mayhemer 2018-03-05 04:14:44 +01:00
PBackground.ipdl Bug 1201590 - WebMIDI IPDL files; r=baku 2017-11-14 22:16:18 -08:00
PBackgroundSharedTypes.ipdlh Bug 1414755 - Get rid of ContentPrincipalInfoOriginNoSuffix, r=bz, r=bkelly 2017-11-15 11:19:26 +01:00
PBackgroundTest.ipdl
PChildToParentStream.ipdl Bug 1351488 - Simplify IPCStreamSource::DoRead() and remove reallocation of the buffer (r=asuth) 2017-08-29 10:42:33 -05:00
PFileDescriptorSet.ipdl
PParentToChildStream.ipdl Bug 1351488 - Simplify IPCStreamSource::DoRead() and remove reallocation of the buffer (r=asuth) 2017-08-29 10:42:33 -05:00
ProcessChild.cpp
ProcessChild.h
ProcessUtils_bsd.cpp
ProcessUtils_linux.cpp
ProcessUtils_mac.mm
ProcessUtils_none.cpp
ProcessUtils.h
ProtocolTypes.ipdlh
ProtocolUtils.cpp Bug 1420922: Remove orphaned TARGET_SANDBOX_EXPORTS defines. r=dmajor 2017-11-27 16:07:15 +00:00
ProtocolUtils.h Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
ScopedXREEmbed.cpp Backed out changeset 582d112281f9 (bug 1403366) 2017-10-04 01:27:07 +02:00
ScopedXREEmbed.h
SharedMemory_posix.cpp
SharedMemory_windows.cpp
SharedMemory.cpp
SharedMemory.h Bug 1356289 - Part 1. Make SharedMemory::SetHandle accept an access rights parameter. r=billm 2017-04-18 12:24:58 -04:00
SharedMemoryBasic_android.cpp Bug 1356289 - Part 1. Make SharedMemory::SetHandle accept an access rights parameter. r=billm 2017-04-18 12:24:58 -04:00
SharedMemoryBasic_android.h Bug 1232119 - Add fuzzer for SharedMemory. r=billm 2017-05-23 22:36:28 +02:00
SharedMemoryBasic_chromium.h Bug 1232119 - Add fuzzer for SharedMemory. r=billm 2017-05-23 22:36:28 +02:00
SharedMemoryBasic_mach.h Bug 1232119 - Add fuzzer for SharedMemory. r=billm 2017-05-23 22:36:28 +02:00
SharedMemoryBasic_mach.mm Bug 1362303: Avoid crashes when dragging on macOS due to failed allocations of large shmem segments. r=glandium 2018-03-06 13:21:54 -05:00
SharedMemoryBasic.h
Shmem.cpp Bug 1440511 - Part 5: Move all serialization logic into an IPDLParamTraits impl for Shmem, r=froydnj 2018-03-05 16:00:02 -05:00
Shmem.h Bug 1440511 - Part 12: Remove the now-unused per-actor pickling code, r=froydnj 2018-03-05 16:00:04 -05:00
StringUtil.cpp
TaskFactory.h Bug 1412138 - Re-fix mode lines in ipc/chromium and ipc/glue. r=kanru 2017-10-26 16:05:47 -07:00
Transport_posix.cpp
Transport_posix.h
Transport_win.cpp
Transport_win.h
Transport.h
URIParams.ipdlh Bug 1322874 - Get rid of nsIURI.originCharset. r=valentin.gosu 2017-08-02 20:43:30 +09:00
URIUtils.cpp Bug 1415205 - Add nsIURIMutator impls for all objects implementing nsIURI r=bagder 2017-11-20 17:11:30 +01:00
URIUtils.h
WindowsMessageLoop.cpp Backed out 4 changesets (bug 1437167) for build bustages on nsUpdateDriver.cpp and WindowsMessageLoop.cpp on a CLOSED TREE. 2018-03-06 00:09:46 +02:00
WindowsMessageLoop.h