Commit Graph

6829 Commits

Author SHA1 Message Date
Nika Layzell
acedd82927 Bug 1734739 - Part 3: Stop providing pids in places where it's not needed/used, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128220
2021-11-24 17:56:01 +00:00
Nika Layzell
c8c4669312 Bug 1734739 - Part 2: Stop requiring the OtherPid to create Endpoint, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128219
2021-11-24 17:56:00 +00:00
Nika Layzell
26555d958a Bug 1734739 - Part 1: Stop requiring otherpid for ShareTo, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128218
2021-11-24 17:56:00 +00:00
Nika Layzell
97b5060ecd Bug 1734735 - Part 8: Remove the now-unused old mach_ipc_mac code, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128217
2021-11-23 16:15:23 +00:00
Nika Layzell
54f46c1714 Bug 1734735 - Part 7: Remove all SharedMemoryBasic special messaging code, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128216
2021-11-23 16:15:23 +00:00
Nika Layzell
e8759da1c8 Bug 1734735 - Part 6: Remove dead TextureSync code, r=dthayer
Differential Revision: https://phabricator.services.mozilla.com/D128215
2021-11-23 16:15:22 +00:00
Nika Layzell
f6598b1f3c Bug 1734735 - Part 5: Convert SharedMemoryBasic_mach to use relayed mach ports, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128214
2021-11-23 16:15:22 +00:00
Nika Layzell
242fc0f7d7 Bug 1734735 - Part 4: Support relaying mach ports via the parent process, r=handyman,mstange
Differential Revision: https://phabricator.services.mozilla.com/D128213
2021-11-23 16:15:21 +00:00
Nika Layzell
16985051ce Bug 1734735 - Part 3: Generalize IPC message footer writing code, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D128212
2021-11-23 16:15:21 +00:00
Alexandre Lissy
a9b9bae961 Bug 1726804 - Refactor PROCESS_TYPE_* from nsICrashService r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D121389
2021-11-19 14:02:56 +00:00
Alexandre Lissy
60d10601bb Bug 1726804 - Refactor definition and usage of GECKO_PROCESS_TYPE() r=nika,firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121388
2021-11-19 14:02:55 +00:00
Alexandru Michis
2cb5b32d02 Backed out 2 changesets (bug 1726804) for causing sm bustages in geckoprocesstypes.
CLOSED TREE

Backed out changeset bf7f73fd1921 (bug 1726804)
Backed out changeset c9936f7534cb (bug 1726804)
2021-11-19 11:40:59 +02:00
Alexandre Lissy
882ec7bc7a Bug 1726804 - Refactor PROCESS_TYPE_* from nsICrashService r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D121389
2021-11-19 08:33:43 +00:00
Alexandre Lissy
b71c7b7255 Bug 1726804 - Refactor definition and usage of GECKO_PROCESS_TYPE() r=nika,firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121388
2021-11-19 08:33:42 +00:00
Nika Layzell
ab32545d5a Bug 1741152 - Add diagnostic warnings to process launch codepaths, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D131419
2021-11-17 22:19:13 +00:00
Andrew McCreight
484cac8a89 Bug 1707642 - Increase message size limit in fuzzing builds. r=ipc-reviewers,nika
If the limit is small, then the fuzzers hit crashes in various places when
passing in large data structures to DOM APIs, so increase the limit.

Differential Revision: https://phabricator.services.mozilla.com/D130890
2021-11-11 18:00:02 +00:00
Andrew McCreight
5c16837860 Bug 1740529 - Log the PID of the process we're waiting on in WillDestroyCurrentMessageLoop(). r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D130889
2021-11-11 00:19:20 +00:00
Marian-Vasile Laza
133cd29435 Backed out 2 changesets (bug 1712837) for causing mochitest and marionette test failures. CLOSED TREE
Backed out changeset ecfd23a7ef69 (bug 1712837)
Backed out changeset 51529cb4682e (bug 1712837)
2021-11-11 01:52:57 +02:00
Dana Keeler
15ebcb5e82 Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-11-10 21:48:47 +00:00
Nika Layzell
0d9a71dc85 Bug 1740596 - Include more details in IPDL warnings, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D130923
2021-11-10 21:48:22 +00:00
Marian-Vasile Laza
948f23ed24 Backed out changeset c667e28154b6 (bug 1707642) for causing build bustages on MessageLink.cpp. CLOSED TREES 2021-11-10 22:26:37 +02:00
Andrew McCreight
75a68d0785 Bug 1707642 - Increase message size limit in fuzzing builds. r=ipc-reviewers,nika
If the limit is small, then the fuzzers hit crashes in various places when
passing in large data structures to DOM APIs, so increase the limit.

Differential Revision: https://phabricator.services.mozilla.com/D130890
2021-11-10 17:59:24 +00:00
Nika Layzell
713c899320 Bug 1732343 - Part 10: Remove the now-unused ipc::DuplicateHandle, r=handyman
This should unblock removing support for BrokerDuplicateHandle from our fork of
the chromium sandboxing code.

Differential Revision: https://phabricator.services.mozilla.com/D126572
2021-11-09 14:17:35 +00:00
Nika Layzell
f3e5fa0fee Bug 1732343 - Part 7: Use attached handles for Windows CrossProcess{Mutex,Semaphore} serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126569
2021-11-09 14:17:34 +00:00
Nika Layzell
71d0301a3c Bug 1732343 - Part 6: Use attached handles for Windows TransportDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126568
2021-11-09 14:17:34 +00:00
Nika Layzell
4bf7ce347c Bug 1732343 - Part 5: Use attached handles for Windows SharedMemory serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126567
2021-11-09 14:17:33 +00:00
Nika Layzell
95cdfbabee Bug 1732343 - Part 4: Use attached handles for Windows FileDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126566
2021-11-09 14:17:33 +00:00
Nika Layzell
429530ace6 Bug 1732343 - Part 3: Support directly attaching handles to IPC messages on windows, r=handyman
Handles which are directly attached to IPC messages will be transferred by the
parent process. This is handled either directly by the parent process (if it is
one of the participants), or by relaying the message via the parent process if
it is not. Ordering issues are avoided here thanks to support in the mojo ports
code for messages being delivered out-of-order.

The actual handle values are encoded in the message after the message payload,
and removed from the message before handing it off to existing code, so it
should be fully transparent.

In addition, a new flag is added to the message header to support marking a
message as a "relay" message, as well as support for deserializing these
messages with an extra NodeName (the real target/source) in the message footer.

Differential Revision: https://phabricator.services.mozilla.com/D126565
2021-11-09 14:17:32 +00:00
Nika Layzell
d73755617d Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-09 14:17:32 +00:00
Nika Layzell
803584be9d Bug 1732343 - Part 1: Better support for moveonly types in IPDL, r=handyman
In part 2 of this patch, a large number of messages are being converted to
contain move-only types, both as direct arguments and within compound data
structures. This revealed some limitations in IPDL's handling of moveonly
types, which this patch hopes to rectify. This also required changes to allow
distinguishing between types which require move to send vs. them not having a
move constructor.

This does not fully fix the underlying issues, but attempts to preserve
existing behaviour while improving support for the new types being added. There
should be further cleanup in the future.

Differential Revision: https://phabricator.services.mozilla.com/D126563
2021-11-09 14:17:31 +00:00
Cristian Tuns
cbd178830f Backed out 10 changesets (bug 1732343) for causing coverage build bustages (Bug 1739590).
Backed out changeset bba94c79f3e1 (bug 1732343)
Backed out changeset d30fa1e1f605 (bug 1732343)
Backed out changeset ed0b4f757c4b (bug 1732343)
Backed out changeset a272da134c34 (bug 1732343)
Backed out changeset ccb259d73843 (bug 1732343)
Backed out changeset a292990b62de (bug 1732343)
Backed out changeset 7d1854782ca8 (bug 1732343)
Backed out changeset 29eaabd9ffb3 (bug 1732343)
Backed out changeset 1aa26657a7a6 (bug 1732343)
Backed out changeset 7a6708dc620a (bug 1732343)
2021-11-05 07:21:04 -04:00
James Teh
b2865987fc Bug 1736742 part 2: Provide ability to register a COM handler inside an MSIX container. r=nalexander,jmathies
We could do this in HKLM using registry.dat, but that file is difficult to manage.
Instead, we register in HKCU at runtime.
Also, RegCreateKeyTransacted doesn't work in MSIX containers, so we must use RegCreateKeyEx.

Differential Revision: https://phabricator.services.mozilla.com/D129950
2021-11-05 06:25:45 +00:00
Nika Layzell
1cd9e0c087 Bug 1732343 - Part 10: Remove the now-unused ipc::DuplicateHandle, r=handyman
This should unblock removing support for BrokerDuplicateHandle from our fork of
the chromium sandboxing code.

Differential Revision: https://phabricator.services.mozilla.com/D126572
2021-11-04 19:20:21 +00:00
Nika Layzell
902aa7430e Bug 1732343 - Part 7: Use attached handles for Windows CrossProcess{Mutex,Semaphore} serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126569
2021-11-04 19:20:19 +00:00
Nika Layzell
eb3349f581 Bug 1732343 - Part 6: Use attached handles for Windows TransportDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126568
2021-11-04 19:20:19 +00:00
Nika Layzell
fc6ef2a44a Bug 1732343 - Part 5: Use attached handles for Windows SharedMemory serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126567
2021-11-04 19:20:19 +00:00
Nika Layzell
aa3b31b0e4 Bug 1732343 - Part 4: Use attached handles for Windows FileDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126566
2021-11-04 19:20:18 +00:00
Nika Layzell
4bd83c851e Bug 1732343 - Part 3: Support directly attaching handles to IPC messages on windows, r=handyman
Handles which are directly attached to IPC messages will be transferred by the
parent process. This is handled either directly by the parent process (if it is
one of the participants), or by relaying the message via the parent process if
it is not. Ordering issues are avoided here thanks to support in the mojo ports
code for messages being delivered out-of-order.

The actual handle values are encoded in the message after the message payload,
and removed from the message before handing it off to existing code, so it
should be fully transparent.

In addition, a new flag is added to the message header to support marking a
message as a "relay" message, as well as support for deserializing these
messages with an extra NodeName (the real target/source) in the message footer.

Differential Revision: https://phabricator.services.mozilla.com/D126565
2021-11-04 19:20:18 +00:00
Nika Layzell
b8279164db Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-04 19:20:17 +00:00
Nika Layzell
9f23266238 Bug 1732343 - Part 1: Better support for moveonly types in IPDL, r=handyman
In part 2 of this patch, a large number of messages are being converted to
contain move-only types, both as direct arguments and within compound data
structures. This revealed some limitations in IPDL's handling of moveonly
types, which this patch hopes to rectify. This also required changes to allow
distinguishing between types which require move to send vs. them not having a
move constructor.

This does not fully fix the underlying issues, but attempts to preserve
existing behaviour while improving support for the new types being added. There
should be further cleanup in the future.

Differential Revision: https://phabricator.services.mozilla.com/D126563
2021-11-04 19:20:17 +00:00
Dan Minor
bb596c69e6 Bug 1654112 - Add include dirs for abseil-cpp. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D130060
2020-10-26 15:19:21 -04:00
Dan Minor
38d5d300d9 Bug 1654112 - Update include paths for moved upstream code. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D130059
2020-10-23 14:02:54 -04:00
Florian Quèze
1c3f80fe51 Bug 1738285 - move AUTO_PROFILE_FOLLOWING_RUNNABLE to its own header, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D129825
2021-10-28 20:35:06 +00:00
Alexandre Lissy
4e04ec89a3 Bug 1723505 - Convert IPC processes to GeckoArgs r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123186
2021-10-26 19:42:03 +00:00
Marian-Vasile Laza
f8576fec48 Backed out changeset fe716ee1a126 (bug 1723505) for causing build bustages. CLOSED TREE 2021-10-26 20:45:47 +03:00
Alexandre Lissy
14420a3ffc Bug 1723505 - Convert IPC processes to GeckoArgs r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123186
2021-10-26 17:14:13 +00:00
Kagami Sascha Rosylight
b393a76883 Bug 1725942 - Part 3: Migrate LockManager implementation to PLockManager r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125555
2021-10-19 12:01:51 +00:00
Kagami Sascha Rosylight
1b81c6c3a4 Bug 1725942 - Part 2: Add ipc::ParamTraits for dom::Sequence r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D126242
2021-10-19 12:01:50 +00:00
Nika Layzell
8d97cd8228 Bug 1725572 - Part 1: Support automatic cleanup for ManagedEndpoint instances, r=handyman
This patch adds support for ManagedEndpoint instances to be dropped &
gracefully destroyed. Before this change, a ManagedEndpoint which was
dropped without being bound would not clean up its' peer actor, meaning
that messages to and from that actor would be discarded.

This is done by adding a new actor destroy reason for dropping a
ManagedEndpoint.

Differential Revision: https://phabricator.services.mozilla.com/D128776
2021-10-18 22:59:17 +00:00
Mike Hommey
7debb35262 Bug 1572618 - Statically link the rlbox library to libxul. r=firefox-build-system-reviewers,nika,andi
We still rely on dynamic loading to find the symbols, but since we get
them from libxul, we don't need to load the library before activating
the process sandbox anymore.

Differential Revision: https://phabricator.services.mozilla.com/D128333
2021-10-15 01:17:58 +00:00
Thinker Li
d608329c0a Bug 1697429 - Handle crash with the old way if the fork server is prefed out. r=jld
Handle crash with the old way if the fork server is prefed out, and waitpid() for all available stat changes of children processes in the forkserver.

Differential Revision: https://phabricator.services.mozilla.com/D110507
2021-10-14 03:13:00 +00:00
Noemi Erli
ee28b70fed Backed out changeset 88ae7d2397eb (bug 1697429) for causing bustages in process_util_posix.cc 2021-10-08 03:05:56 +03:00
Thinker Li
956b05e8b1 Bug 1697429 - Handle crash with the old way if the fork server is prefed out. r=jld
Handle crash with the old way if the fork server is prefed out, and waitpid() for all available stat changes of children processes in the forkserver.

Differential Revision: https://phabricator.services.mozilla.com/D110507
2021-10-07 23:42:22 +00:00
Jens Stutte
0a2448163d Bug 1731564: Use motivated SpinEventLoopUntil inside ipc/*. r=ipc-reviewers,nika
Depends on D127100

Differential Revision: https://phabricator.services.mozilla.com/D127102
2021-10-07 08:06:12 +00:00
Marian-Vasile Laza
18fb16c542 Backed out 18 changesets (bug 1731564) for causing build bustages on SpinEventLoopUntil. CLOSED TREE
Backed out changeset 0464dbdc8584 (bug 1731564)
Backed out changeset 0d996df13545 (bug 1731564)
Backed out changeset 5630a0e7a109 (bug 1731564)
Backed out changeset 37b41d187cdb (bug 1731564)
Backed out changeset d37700fa60b6 (bug 1731564)
Backed out changeset b0ce7db44b99 (bug 1731564)
Backed out changeset aa5ec3aa1535 (bug 1731564)
Backed out changeset 73b648f1fa70 (bug 1731564)
Backed out changeset bb8fb0f9833e (bug 1731564)
Backed out changeset 0d8905144f5d (bug 1731564)
Backed out changeset 2cfb094a1ec3 (bug 1731564)
Backed out changeset 78d3b0257a6a (bug 1731564)
Backed out changeset e9d32926e93c (bug 1731564)
Backed out changeset 874cab520ce5 (bug 1731564)
Backed out changeset d8071cc32bd9 (bug 1731564)
Backed out changeset 283c5393cbbc (bug 1731564)
Backed out changeset 317bc38e3de5 (bug 1731564)
Backed out changeset 53e3f4862439 (bug 1731564)
2021-10-07 00:09:19 +03:00
Jens Stutte
4c843c7054 Bug 1731564: Use motivated SpinEventLoopUntil inside ipc/*. r=ipc-reviewers,nika
Depends on D127100

Differential Revision: https://phabricator.services.mozilla.com/D127102
2021-10-06 19:45:13 +00:00
Petr Sumbera
7ee3993e66 Bug 1732325 - SharedMemory::FindFreeAddressSpace should use MAP_NORESERVE r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D126510
2021-10-01 08:16:37 +00:00
Alexandre Lissy
9a7966a721 Bug 1732999 - Annotate intentional crash when testing buildid mismatch r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D126905
2021-09-29 13:47:00 +00:00
Eitan Isaacson
1de5b0abcd Bug 1731374 - Add string storage to AccAttributes with move semantics. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D126012
2021-09-28 22:01:35 +00:00
Jed Davis
fb5243f075 Bug 1715414 - Start PBackground earlier in content processes. r=nika
Previously we were staring `PBackground` in content processes in
response to receiving the `SetXPCOMProcessAttributes` IPC message, which
is sent immediately after the process is launched.  Meanwhile, the
idle scheduler tries to use PBackground when the main thread considers
itself idle.  But if thread scheduling is such that the content process
main thread becomes idle before the IPC I/O thread has received and
dispatched that message, then we have a problem (signaled by an assertion
failure).

This patch moves content process `PBackground` startup earlier, to the
end of `ContentProcess::Init`; that point is after enough of IPC and
XPCOM is started for it to work, but before we start spinning the main
thread event loop.

Differential Revision: https://phabricator.services.mozilla.com/D126144
2021-09-28 19:13:15 +00:00
criss
a8345dc602 Backed out changeset 671ba1530436 (bug 1715414) for casuing bustages on ContentProcess.cpp. CLOSED TREE 2021-09-28 07:33:53 +03:00
Jed Davis
86b3598e72 Bug 1715414 - Start PBackground earlier in content processes. r=nika
Previously we were staring `PBackground` in content processes in
response to receiving the `SetXPCOMProcessAttributes` IPC message, which
is sent immediately after the process is launched.  Meanwhile, the
idle scheduler tries to use PBackground when the main thread considers
itself idle.  But if thread scheduling is such that the content process
main thread becomes idle before the IPC I/O thread has received and
dispatched that message, then we have a problem (signaled by an assertion
failure).

This patch moves content process `PBackground` startup earlier, to the
end of `ContentProcess::Init`; that point is after enough of IPC and
XPCOM is started for it to work, but before we start spinning the main
thread event loop.

Differential Revision: https://phabricator.services.mozilla.com/D126144
2021-09-28 02:02:19 +00:00
Mike Hommey
87a967bf85 Bug 1732208 - Silence the unused-but-set-variable warning in ipc. r=mccr8
ipc/chromium/src/chrome/common/ipc_channel_win.cc(133,8): error: variable 'waited' set but not used [-Werror,-Wunused-but-set-variable]
  bool waited = false;
       ^
ipc/mscom/InterceptorLog.cpp(183,12): error: variable 'rv' set but not used [-Werror,-Wunused-but-set-variable]
  nsresult rv = mThread->Dispatch(
           ^

Differential Revision: https://phabricator.services.mozilla.com/D126455
2021-09-28 00:02:45 +00:00
Tim Huang
93a518fe4f Bug 1731557 - Part 1: Using an enum to represent storage permission in the loadInfo. r=pbz,necko-reviewers,dragana
To differentiate the storage permission is granted by either the
permission or the allowList, we need to change the hasStoragePermission
to an enum to represent the storage permission state.

This patch also changes the name of the attribute to make it reasonable
with respect to this change.

Differential Revision: https://phabricator.services.mozilla.com/D126276
2021-09-27 22:50:41 +00:00
Bob Owen
972b41f513 Bug 1546154 p3: Explicitly load COM functions from combase.dll to prevent ole32 loading. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D124931
2021-09-20 10:09:01 +00:00
Bob Owen
ced8f2090a Bug 1546154 p1: Call CommandLineToArgvW via API set when possible to prevent shell32 loading. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D124928
2021-09-20 10:08:59 +00:00
Marian-Vasile Laza
1cf4af94e5 Backed out 7 changesets (bug 1546154) for causing build bustages on ContentProcess.cpp. CLOSED TREE
Backed out changeset 0bd777eee249 (bug 1546154)
Backed out changeset 611812ee62a2 (bug 1546154)
Backed out changeset cef0aa18a3ab (bug 1546154)
Backed out changeset cfda47fb0a46 (bug 1546154)
Backed out changeset f3e005f5fedc (bug 1546154)
Backed out changeset 7f50fca0c2cd (bug 1546154)
Backed out changeset bbb0b25450f5 (bug 1546154)
2021-09-15 14:12:55 +03:00
Bob Owen
8b6ae95727 Bug 1546154 p3: Explicitly load COM functions from combase.dll to prevent ole32 loading. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D124931
2021-09-15 10:21:04 +00:00
Bob Owen
461bc82ee8 Bug 1546154 p1: Call CommandLineToArgvW via API set when possible to prevent shell32 loading. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D124928
2021-09-15 10:21:03 +00:00
Tetsuharu Ohzeki
0109338d54 Bug 1729476 - Remove unused CompositorBridgeChild::SendMakeSnapshot(). r=gfx-reviewers,ipc-reviewers,nika,nical
Differential Revision: https://phabricator.services.mozilla.com/D124818
2021-09-07 22:37:48 +00:00
Kershaw Chang
5ea2a6408c Bug 1716566 - Make websocket work when socket process is enabled, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D123108
2021-09-07 14:42:44 +00:00
Nika Layzell
4d227d94ae Bug 1725335 - Streamline ownership and locking in MessageTask, r=ipc-reviewers,mccr8
This simplifies the logic around MessageTask's lifecycle to make
ownership as clear as possible and reduce the number of redundant
checks.

This new change no longer clears the mChannel member when the
MessageTask is disconnected, instead relying on isInList() to check
whether the MessageTask is still in the channel's mPending list. This is
already being automatically managed as the mPending list is modified,
and should avoid potential usage mistakes.

Differential Revision: https://phabricator.services.mozilla.com/D123140
2021-09-01 15:26:54 +00:00
Matt Woodrow
d751b43176 Bug 1727489 - Remove PLayerTransaction. r=jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D123595
2021-08-26 04:59:57 +00:00
Butkovits Atila
c83e348e26 Backed out 2 changesets (bug 1727488, bug 1727489) for causing bustages on KnowsCompositor.cpp. CLOSED TREE
Backed out changeset 5a00db1b7a6a (bug 1727489)
Backed out changeset 13686567e748 (bug 1727488)
2021-08-26 04:49:16 +03:00
Matt Woodrow
0d4e9aa48a Bug 1727489 - Remove PLayerTransaction. r=jrmuizel,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D123595
2021-08-26 00:25:21 +00:00
Nika Layzell
28c8f793f9 Bug 1715755 - Part 3: Don't defer messages if the interrupt stack is empty, r=handyman
Previously this would misbehave as it couldn't get the interrupt stack.

Depends on D123149

Differential Revision: https://phabricator.services.mozilla.com/D123150
2021-08-25 18:30:25 +00:00
Nika Layzell
4cc950d178 Bug 1715755 - Part 2: Recover from unhandled special messages without crashing, r=handyman
This change instead recovers from unhandled special messages by reporting a
normal IPC error, which should be handled using the normal IPC error
mechanisms.

Depends on D123148

Differential Revision: https://phabricator.services.mozilla.com/D123149
2021-08-25 18:30:24 +00:00
Nika Layzell
e3b52f319a Bug 1715755 - Part 1: Don't ignore dead actors for sync and intr messages, r=handyman
When this change was first implemented, it ignored dead actors for all types of
messages, but for messages with replies they cannot be ignored, as a reply must
be sent. This should fix that oversight.

Differential Revision: https://phabricator.services.mozilla.com/D123148
2021-08-25 18:30:24 +00:00
Nika Layzell
6d8a72603f Bug 1727422 - Support arbitrary integer keys in nsTHashMap, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D123547
2021-08-25 16:31:08 +00:00
Andi-Bogdan Postelnicu
2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Mike Hommey
c033e2536d Bug 1726474 - Preload rlbox library on Windows. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D123039
2021-08-25 07:39:00 +00:00
Cosmin Sabou
1958e4b9fe Backed out 4 changesets (bug 1726474) for causing windows build bustages. CLOSED TREE
Backed out changeset c7fcc6914b7c (bug 1726474)
Backed out changeset 1dcd8069568e (bug 1726474)
Backed out changeset 938043bb1ca2 (bug 1726474)
Backed out changeset e12c90f66a6c (bug 1726474)
2021-08-24 06:12:08 +03:00
Mike Hommey
44bb728fba Bug 1726474 - Preload rlbox library on Windows. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D123039
2021-08-24 02:52:18 +00:00
Csoregi Natalia
84d67f5d03 Backed out 4 changesets (bug 1726474) for causing crashes. CLOSED TREE
Backed out changeset 5add6784a784 (bug 1726474)
Backed out changeset e2047ab95703 (bug 1726474)
Backed out changeset d53f62933fd0 (bug 1726474)
Backed out changeset 796a54dcb5f0 (bug 1726474)
2021-08-24 04:49:04 +03:00
Mike Hommey
2829072aeb Bug 1726474 - Preload rlbox library on all platforms. r=nika
Notably, on Windows, the sequences of loading/unloading in child processes trigger https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/toolkit/xre/dllservices/UntrustedModulesData.cpp#324

Differential Revision: https://phabricator.services.mozilla.com/D123039
2021-08-24 01:01:38 +00:00
Andi-Bogdan Postelnicu
9945b94835 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.1 (taskcluster-dNZqCRqWRTqa6cZxPKxh7Q)

Differential Revision: https://phabricator.services.mozilla.com/D122814
2021-08-23 09:30:23 +00:00
Mike Hommey
14a11072e2 Bug 1726476 - Adjust GetSandboxedRLBoxPath for the changes in rlbox_wasm2c_sandbox. r=nika
rlbox_wasm2c_sandbox was adjusted to avoid using LoadLibraryA (rejected by
build/clang-plugin/LoadLibraryUsageChecker.cpp), so we adjust
GetSandboxedRLBoxPath (which is used to feed it) to return an UTF-16
string on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D123025
2021-08-20 23:33:05 +00:00
Jed Davis
629eedfcfa Bug 1672085 - Don't pre-allocate when using memfd in IPC shared memory. r=glandium
Memory for memfd files isn't subject to any file size limit, unlike
named files in /dev/shm, and is documented as being handled similarly
to anonymous mmap for accounting / resource management purposes.
Therefore, there isn't any need to pre-commit the memory with
posix_fallocate in that case.

Differential Revision: https://phabricator.services.mozilla.com/D121818
2021-08-18 21:56:10 +00:00
Jed Davis
dcf8361aeb Bug 1672085 - Refactor posix_fallocate support in IPC shared memory. r=glandium
This merges the cases for posix_fallocate being unavailable at build
time and being rejected dynamically by the OS (some don't support
it with their implementation of POSIX shm), to make it simple to
dynamically opt out in the memfd case.

Differential Revision: https://phabricator.services.mozilla.com/D121817
2021-08-18 21:56:09 +00:00
André Bargull
d2bbf86876 Bug 1726123 - Part 5: Add missing "js/" includes outside of SM. r=arai
In preparation for the next part, add missing includes to "js/" public headers.

Differential Revision: https://phabricator.services.mozilla.com/D122843
2021-08-17 15:45:39 +00:00
Mike Hommey
6d5f4e8060 Bug 1725521 - Simplify getting the rlbox library path. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D122552
2021-08-17 00:16:03 +00:00
Makoto Kato
329f65c790 Bug 1725593 - Get rid of SendCheckAndSuggest sync IPC. r=masayuki,ipc-reviewers,mccr8
Depends on D122579

Differential Revision: https://phabricator.services.mozilla.com/D122580
2021-08-16 01:40:00 +00:00
Paul Bone
1eea9a0557 Bug 1710552 - pt 2. Inform the idle scheduler when we initiate a GC r=smaug
This lets the idle scheduler know that we've initiated a GC that we didn't
ask its permission for.  Eg the JS engine hit a threshold.  It now uses this
info when scheduling GCs for other processes.

Differential Revision: https://phabricator.services.mozilla.com/D120831
2021-08-13 04:06:26 +00:00
Paul Bone
0d0bbcac0f Bug 1710552 - pt 1. Prepare for GCs being denied r=smaug
This patch also:
 * adds an assertion to KillGCRunner() to ensure it's never killed if
   needed, now that there are more calls to KillGCRunner(), some calls have
   been moved eg in nsJSEnvironment so as not to kill the runner a little
   later and keep the assertions happy.

 * IdleSchedulerChild will decline a request for a GC if there's already a
   request in flight.

 * CCGCScheduler will check if a GC is already in progress when handling the
   parents' response to a GC request.

Differential Revision: https://phabricator.services.mozilla.com/D120830
2021-08-13 04:06:25 +00:00
Paul Zuehlcke
3a8091d1c2 Bug 1673889 - Remove topLevelStorageAreaPrincipal. r=timhuang,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D122364
2021-08-11 18:51:20 +00:00
Gabriele Svelto
65f2ae5b03 Bug 1723934 - Remove old and useless crash annotations r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D121709
2021-08-09 20:08:17 +00:00
Gabriele Svelto
559377e821 Bug 1723934 - Remove useless nsExceptionHandler.h inclusions and crash reporter service definitions r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D121708
2021-08-09 20:08:17 +00:00
Niklas Goegge
6763769587 Bug 1723954: Return NS_OK if PrincipalInfoToPrincipal fails. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D121867
2021-08-05 13:58:41 +00:00
Aaron Klotz
5df7df28c5 Bug 1723837: Improve mscom::ProcessRuntime idempotency; r=Jamie,handyman
`mscom::ProcessRuntime` supports multiple instances because Reasons (TM).
To make this happen, we store some information in `mozglue` that enforces
serialization between instances and also informs an instance as to whether
any other instances have successfully completed initialization.

Unfortunately it is possible for us to encounter situations where one instance
manages to *partially* but not *completely* finish initialization. Since our
shared information is currently a simple `bool`, we cannot really capture this
case.

Furthermore, APIs such as `CoInitializeSecurity` will actually fail if called
again after previous activity, so we should guard against multiple invocations
within the same process.

To improve this situation, I'd like to replace the shared `bool` with a typed
enum that can provide finer-grained information as to how far a previous
instance actually managed to get.

Differential Revision: https://phabricator.services.mozilla.com/D121672
2021-08-04 18:02:30 +00:00
Doug Thayer
d8acee36a4 Bug 1722515 - Fix WindowsMessageLoop no-a11y breakage r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D121660
2021-08-04 12:56:14 +00:00
Marian-Vasile Laza
e954091acf Backed out 2 changesets (bug 1720965) for causing bustages on nsContentUtils.cpp. CLOSED TREE
Backed out changeset 2ed56ddce45a (bug 1720965)
Backed out changeset 3531708ab54e (bug 1720965)
2021-08-04 03:14:29 +03:00
Jeff Gilbert
fba93f87af Bug 1720965 - Give up on move semantics for Shmem for now. r=nika
Don't pretend that it's not a copy, as this causes readers to get the
wrong impression of how it behaves.

Differential Revision: https://phabricator.services.mozilla.com/D120124
2021-08-03 20:06:55 +00:00
Randell Jesup
ecb0c56479 Bug 1687843: PreallocatedProcessManager will return a launching process if one exists r=nika
Differential Revision: https://phabricator.services.mozilla.com/D118226
2021-07-24 03:25:59 +00:00
Nika Layzell
c705251ce8 Bug 1719577 - Part 8: Remove some unused methods from MessageChannel, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D119356
2021-07-23 19:14:59 +00:00
Nika Layzell
99a0665a8b Bug 1719577 - Part 7: Remove outdated comment, r=handyman
This comment refers to the old ProcessLink implementation, and was missed when
that implementation was removed.

Differential Revision: https://phabricator.services.mozilla.com/D119355
2021-07-23 19:14:58 +00:00
Nika Layzell
639ed70cb4 Bug 1719577 - Part 6: More consistently use the monitor during MessageChannel shutdown, r=handyman
This should make the logic around clearing a MessageChannel more obviously
correct by holding the mutex when accessing fields which are traditionally
guarded by the mutex. These lock calls shouldn't introduce performance issues
as the lock should be uncontended.

Differential Revision: https://phabricator.services.mozilla.com/D119354
2021-07-23 19:14:58 +00:00
Nika Layzell
93f8303221 Bug 1719577 - Part 5: Remove the now-unused ChannelOpening state, r=handyman
This state was only used by the ProcessLink MessageLink implementation, and no
longer exists with the new PortLink implementation, so can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D119353
2021-07-23 19:14:58 +00:00
Nika Layzell
30d790aee6 Bug 1719577 - Part 4: Hold the monitor for more of MessageChannel::Open, r=handyman
This simplifies some of the reasoning about when to hold locks by holding it
when setting all monitor-guarded fields.

Differential Revision: https://phabricator.services.mozilla.com/D119352
2021-07-23 19:14:57 +00:00
Nika Layzell
64fd825e97 Bug 1719577 - Part 3: Remove dead WaitForIncomingMessage function, r=handyman
This method is never called.

Differential Revision: https://phabricator.services.mozilla.com/D119351
2021-07-23 19:14:57 +00:00
Nika Layzell
0e37500335 Bug 1719577 - Part 2: Create mMonitor eagerly in MessageChannel's constructor, r=handyman
Now that PortLink is the only MessageLink implementation, it is no longer
necessary to support sharing a single `RefCountedMonitor` between multiple
MessageChannels, meaning that we can construct the monitor directly in the
`MessageChannel` constructor. The monitor still needs to be refcounted due to
being used by the PortLink as part of the listener implementation.

Differential Revision: https://phabricator.services.mozilla.com/D119350
2021-07-23 19:14:56 +00:00
Nika Layzell
488fc0d1be Bug 1719577 - Part 1: Use inline initializers for MessageChannel fields, r=handyman
This makes things generally more clear, and avoids a long list of initializers
in the MessageChannel constructor. In addition, some fields which are never
modified are marked as `const`.

Differential Revision: https://phabricator.services.mozilla.com/D119349
2021-07-23 19:14:56 +00:00
Kashav Madan
f36c3b6e89 Bug 1720688 - Handle invalid attribute values for "Nested"/"NestedUpTo" and "Priority", r=mccr8
This KeyErrors since we build the ast before we typecheck attributes.

Differential Revision: https://phabricator.services.mozilla.com/D120376
2021-07-22 02:24:43 +00:00
Kashav Madan
5781dca888 Bug 1720688 - Support extended attribute syntax in protocol declarations, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D119975
2021-07-22 02:24:43 +00:00
Bob Owen
b2d767fbb9 Bug 1716024 p2: Flag all binaries apart from firefox, xpcshell and plugin-container as CET compatible. r=glandium
We will only run the processes in CET compatible modules only mode when not
using the JIT code. So marking xul.dll as compatible should be OK.

Differential Revision: https://phabricator.services.mozilla.com/D117551
2021-07-19 07:36:19 +00:00
Jed Davis
4737104967 Bug 1440103 - Fix handle leak in IPC process launching. r=handyman
We use the process handle returned from `CreateProcess` to derive
another handle with more permissions, but the original handle is never
closed.  This bug appears to be fairly old: it existed before this code
was converted to use MozPromise.

Currently we provide the original handle to external consumers of the
launch promise; this patch resolves the promise with the privileged
handle instead and closes the original one.  (One consumer uses the
handle only to obtain the pid, and the rest don't use it at all, so this
shouldn't change anything.)

As a related cleanup, `ProcessLaunchPromise` is now exclusive (because
it's resolved with resources which are consumed) and no longer declared
in the header file (because it's used only internally).

Differential Revision: https://phabricator.services.mozilla.com/D119820
2021-07-15 22:20:34 +00:00
Florian Quèze
ca7bbcc752 Bug 1720374 - Remove MOZ_GECKO_PROFILER ifdefs that are not useful, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119810
2021-07-15 22:04:23 +00:00
Florian Quèze
57d1e300f5 Bug 1720362 - Remove the last MOZ_GECKO_PROFILER ifdefs in ipc code, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119801
2021-07-15 22:04:22 +00:00
Nika Layzell
7ad5d70418 Bug 1718333 - Remove unnecessary AssertLinkThread assertions, r=handyman
After looking through the methods which have this assertion, I couldn't
find any examples of places where not having a specific "link thread"
sequence would cause any issues. I think these assertions can and should
be removed.

The main change required by this was to remove the `!NS_IsMainThread()`
assertion from the SchedulerGroup listener. Due to how callbacks work,
it would be possible for a vsync message to be detected by a
MessageChannel from the main thread if it was sent before the channel
was bound. I don't believe that this change should cause any issues.

Differential Revision: https://phabricator.services.mozilla.com/D119348
2021-07-15 21:09:55 +00:00
Nika Layzell
e620d25a35 Bug 1715167 - Part 6: Use the unsandboxed result principal as precursor for sandbox principals, r=ckerschb,ngogge
This change stores a generated nsID directly on the LoadInfo, rather
than the full SandboxedLoadingPrincipal. This allows for the sandboxed
principal to be constructed from GetChannelResultPrincipal using the
unsandboxed result principal as a precursor, rather than the loading
principal.

The nsID is reset by HttpChannelBase whenever a non-internal redirect
occurs to reduce the chance of multiple null result principals during a
redirect with the same nsID, but different precursors.

Depends on D119692

Differential Revision: https://phabricator.services.mozilla.com/D119693
2021-07-15 21:09:15 +00:00
Tom Ritter
1b9b6b72db Bug 1666222: Cut over a ton of NowUnfuzzed calls -> Now 4/5 r=smaug,extension-reviewers,zombie
With Fuzzyfox removed, Now() does what NowUnfuzzed() did.

Differential Revision: https://phabricator.services.mozilla.com/D119639
2021-07-14 18:18:17 +00:00
Tom Ritter
42c0ec86b4 Bug 1666222: Rip fuzzyfox out of the timestamp classes 2/5 r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D119637
2021-07-14 18:18:16 +00:00
Tooru Fujisawa
8f6310e25c Bug 1708450 - Move call and construct functions into js/public/CallAndConstruct.h. r=nbp
Depends on D119619

Differential Revision: https://phabricator.services.mozilla.com/D119620
2021-07-13 11:52:43 +00:00
Tooru Fujisawa
cc92ef732d Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Nika Layzell
80d5716044 Bug 1717728 - Hold MessageChannel's monitor when creating PortLink, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118562
2021-07-12 20:36:20 +00:00
Paul Bone
5cbb4adf3a Bug 1718415 - GetMainThreadIdleScheduler checks if scheduler is destroyed r=smaug
If GetMainThreadIdleScheduler is called after IPC is destroyed it can
attempt to start it as if it's the first use, which crashes. Instead check
if we've already destroyed the scheduler once and if so then return early.

Differential Revision: https://phabricator.services.mozilla.com/D119251
2021-07-07 23:43:01 +00:00
Doug Thayer
b5f7314e3e Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-07-07 22:37:14 +00:00
Narcis Beleuzu
1ff027d763 Backed out changeset acf2d74efbbc (bug 1714212) for SM bustages on NativeNt.h 2021-07-07 23:13:42 +03:00
Doug Thayer
dc9c284076 Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-07-07 18:17:36 +00:00
Niklas Goegge
a527e368f3 Bug 1714645: Remove NullPrincipalURI. r=ckerschb,nika
Differential Revision: https://phabricator.services.mozilla.com/D118490
2021-07-06 08:23:12 +00:00
Makoto Kato
f912325645 Bug 1719115 - Add riscv64 defines to build/build_config.h. r=firefox-build-system-reviewers,andi
mozilla-central has some imported files of build_config.h from Chromium.
Actually although they doesn't have riscv64 defines yet, I would like to
add it to build Firefox for riscv64.

Differential Revision: https://phabricator.services.mozilla.com/D119051
2021-07-06 08:05:40 +00:00
Jed Davis
2257145e1c Bug 1635451 - Minimize content processes' connections to the X server. r=jgilbert,stransky,nika
This patch launches content processes with the `MOZ_HEADLESS` env var set
if they're using GTK with an X11 display (and there's no other reason
they'd need GTK).

The goal is to avoid exhausting Xorg's default limit of 256 clients if
there are many content processes due to Fission.  If these conditions
are met, the content process doesn't need to eagerly connect to the X
server.  This does not affect the sandbox policy, and content processes
can still use X if needed for, e.g.,  WebGL.

The boolean pref `dom.ipc.avoid-gtk`, set by default, controls this
feature.  In the future it could also be extended to minimize GTK use
with Wayland displays.

Note that disabling `widget.non-native-theme.enabled`, which is also
enabled by default, will restore the use of X11 in all content processes
even if this pref is set; the alternative is that widgets wouldn't render
in that case.

This change will also save some memory for now-unnecessary instances of
GTK's global state, and improve content process startup time.

Remove also the temp pref dom.ipc.remote-mozIcon because it cannot work
anymore with the content process being headless.

Differential Revision: https://phabricator.services.mozilla.com/D112197
2021-07-06 07:42:42 +00:00
Eden Chuang
4ce2d06b79 Bug 1714299 - Correct the opaque response judgment for opaque response blocking. r=necko-reviewers,annevk,dragana
An opaque response should be not only cross-origin but also be request with no_cors request mode.

To filter out the request with mode Same_origin, navigate, and cors. This patch reuses the algorithm in InternalRequest/FetchDriver to decide whether a response is an opaque response.

https://searchfox.org/mozilla-central/rev/da5d08750e504f3710f7ea051327d9c311c39902/dom/fetch/InternalRequest.cpp#331
https://searchfox.org/mozilla-central/rev/da5d08750e504f3710f7ea051327d9c311c39902/dom/fetch/FetchDriver.cpp#1153,1157

Differential Revision: https://phabricator.services.mozilla.com/D117086
2021-07-02 23:11:55 +00:00
Dorel Luca
bc6f2486e2 Backed out changeset 11d1710e481f (bug 1714212) for Browser-chrome failures in toolkit/xre/test/browser_checkdllblockliststate.js. CLOSED TREE 2021-06-26 09:45:29 +03:00
Doug Thayer
c3702a9447 Bug 1714212 - Ensure COM initialized prior to showing skeleton UI r=Jamie,aklotz,tkikuchi
This implements Jamie's suggested fixes for a screenreader issue when the
skeleton UI is enabled. Most of the work here is just pulling out pieces from the
files we needed to include in mozglue so that any references to, say, nsString
or other pieces from libxul either no longer exist or are only included when
building libxul. In a few cases this meant creating whole files to house single
functions, which isn't so pretty, but it was the best I could come up with to
get the job done.

Differential Revision: https://phabricator.services.mozilla.com/D117663
2021-06-26 04:10:50 +00:00
Nika Layzell
25ecbccf4f Bug 1717993 - Hold a WeakPtr to mExistingListener in NodeChannel, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118868
2021-06-25 21:30:49 +00:00
Florian Quèze
cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Nika Layzell
aa2b0966b8 Bug 1713148 - Part 6: Release sChannelCountMutex before calling report callback, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118431
2021-06-22 18:17:26 +00:00
Nika Layzell
5cc51fa13f Bug 1713148 - Part 5: Remove ThreadLink, r=handyman
This removes the last form of unique link between two MessageChannels so that
all MessageChannels communicate using PortLink, as it is fairly straightforward
to use PortLink to communicate between two threads in-process.

Differential Revision: https://phabricator.services.mozilla.com/D116672
2021-06-22 18:17:25 +00:00
Nika Layzell
7dba3a39f8 Bug 1713148 - Part 4: Remove ProcessLink, r=handyman
After the changes in part 3, this type is now dead code and can be fully
removed.

Differential Revision: https://phabricator.services.mozilla.com/D116671
2021-06-22 18:17:25 +00:00
Nika Layzell
620418372a Bug 1713148 - Part 3: Use ports for Endpoint-created actors, r=handyman
This adjusts how all actors created using `Endpoint` behave so that they now
use ports instead of creating a unique native channel connection between each
pair of processes.

Differential Revision: https://phabricator.services.mozilla.com/D116670
2021-06-22 18:17:25 +00:00
Nika Layzell
c5447d3d6a Bug 1713148 - Part 2: Support port attachments on IPC messages, r=handyman
These port attachments are stored directly on the IPC::Message until the
message is ready to be routed to another process, at which point they will be
attached to the port in WillBeRoutedExternally. When the message is then
received on the other side, the ports will be re-extracted from the
UserMessageEvent before it is discarded and re-added to the IPC::Message so
that serializers only need to interact directly with the IPC::Message type.

Differential Revision: https://phabricator.services.mozilla.com/D116669
2021-06-22 18:17:24 +00:00
Nika Layzell
cd803f0116 Bug 1713148 - Part 1: Expose UserMessageEvent to WillBeRoutedExternally, r=handyman
This is used because, unlike in Mojo, we cannot get from the IPC::Message
object to its enclosing UserMessageEvent object to attach more ports to it, and
this extra parameter makes that easy to do.

Differential Revision: https://phabricator.services.mozilla.com/D116668
2021-06-22 18:17:24 +00:00
Nika Layzell
599b58f458 Bug 1706374 - Part 13: Remove the event footer from an IPC::Message when deserializing, r=handyman,glandium
This unfortunately requires a new method to be added to BufferList to
support truncating the buffer to a particular iterator.

Differential Revision: https://phabricator.services.mozilla.com/D116666
2021-06-22 18:17:23 +00:00
Nika Layzell
7802bbb486 Bug 1706374 - Part 12b: Use NodeController for primary process channels, r=handyman
This extends on the changes in part 12a and consumes the new PortRef-based API
in all existing process types other than the fork server. The IPDL C++ unit
tests were already broken before this change, and were not updated.

Differential Revision: https://phabricator.services.mozilla.com/D112777
2021-06-22 18:17:23 +00:00
Nika Layzell
4527652311 Bug 1706374 - Part 12a: Initialize NodeController when creating IO thread, r=handyman
This also consumes the existing channel created when launching a process to
create the the conneciton required by NodeController for communicating between
processes. In part 12b, consumers of the broken APIs will be adjusted to use
the new interface.

The new routing approach is not used for the fork server process, as an IO
thread and the NodeController object cannot be initialized before the fork has
been performed, and the IPC requirements of that process are fairly minimal.

Differential Revision: https://phabricator.services.mozilla.com/D112776
2021-06-22 18:17:22 +00:00
Nika Layzell
985adb750c Bug 1706374 - Part 11: Add NodeController component bridging IPC and Ports, r=handyman
The NodeController and NodeChannel types act as the backbone connecting the
existing IPC logic and driving the ports routing code. Individual NodeChannel
objects wrap and respond to messages from IPC::Channel, and the NodeController
orchestrates all messaging for a process.

The design of these types are inspired by the types with the same names from
Mojo but have been simplified and streamlined to only support features used by
Gecko.

Support for attaching ports or handles to messages hasn't been added yet, but
can be added in follow-up patches.

Differential Revision: https://phabricator.services.mozilla.com/D112775
2021-06-22 18:17:22 +00:00
Nika Layzell
9ae1129462 Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
2021-06-22 18:17:21 +00:00
Nika Layzell
58c8c1a2c1 Bug 1706374 - Part 9: Allow reading OtherPid() from an opened IPC::Channel, r=handyman
This will be used to handle pre-opened channels more reliably in ports code.

Differential Revision: https://phabricator.services.mozilla.com/D112774
2021-06-22 18:17:21 +00:00
Nika Layzell
7771beab66 Bug 1706374 - Part 8: Add support for separate footers to IPC::Message, r=handyman
These will be used to serialize extra event metadata into IPC messages when
they're sent over the ports infrastructure. In the future better integration
may be used to reduce the overhead of this if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D112773
2021-06-22 18:17:20 +00:00
Nika Layzell
d59f87aea5 Bug 1706374 - Part 7: Add owning helpers for working with transport descriptors, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D112772
2021-06-22 18:17:20 +00:00