Commit Graph

6893 Commits

Author SHA1 Message Date
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Nazım Can Altınova
7471bb6338 Bug 1758099 - Add the origin tid of the IPC markers if the thread is not being profiled r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D141100
2022-03-16 14:27:36 +00:00
Butkovits Atila
927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Karl Tomlinson
33229c7294 Bug 1753350 Don't block PBackgroundParent thread while the main thread processes its queued tasks r=jib
Assumptions about safety of waiting on other threads are very risky when the
threads are shared with other consumers that may be making different
assumptions.  cf. https://phabricator.services.mozilla.com/D29701#872962

The thread creation hop was introduced under the assumption that creating and
joining threads from different threads would be problematic.
https://bugzilla.mozilla.org/show_bug.cgi?id=1209987#c6
No-one identified any particular OS that was problematic.

https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread
says
> When a thread terminates, the thread object attains a signaled state,
> satisfying any threads that were waiting on the object.

man 3p pthread_join says
> The results of multiple simultaneous calls to pthread_join() specifying the
> same target thread are undefined.

Differential Revision: https://phabricator.services.mozilla.com/D140021
2022-03-16 04:06:32 +00:00
Daniel Holbert
b1b2dd2f1a Bug 1759763: Fix typo in IPC in-tree docs. r=mccr8
DONTBUILD because just editing an in-tree doc.

This patch fixes a typo by adding a word that was previously missed ("in").

Differential Revision: https://phabricator.services.mozilla.com/D141164
2022-03-15 23:37:21 +00:00
Paul Bone
aa363a88ac Bug 1707499 - Fix uninitialised member r=jld
Differential Revision: https://phabricator.services.mozilla.com/D113470
2022-03-15 03:22:41 +00:00
Jan Varga
01ad68bec6 Bug 1754448 - Add basic testing for snapshot re-using; r=dom-storage-reviewers,webidl,asuth,jari,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D138405
2022-03-09 09:43:09 +00:00
sotaro
7991ca6079 Bug 1757879 - Make SimulateDeviceReset() similar to actual device reset handling r=ipc-reviewers,gfx-reviewers,lsalzman,mccr8
SimulateDeviceReset() works differently from actual device reset handling. It seems better to make SimulateDeviceReset() more similar to actual device reset handling.

Differential Revision: https://phabricator.services.mozilla.com/D140161
2022-03-08 23:14:28 +00:00
Gerald Squelart
5802980a6e Bug 1757596 - #include "mozilla/ProfilerThreadSleep.h" instead of GeckoProfiler.h where possible - r=florian
And in one case, #include "mozilla/ProfilerThreadState.h" where only `AUTO_PROFILER_THREAD_WAKE` is used.

Depends on D140172

Differential Revision: https://phabricator.services.mozilla.com/D140173
2022-03-08 10:32:44 +00:00
Toshihito Kikuchi
0cc2fc80c7 Bug 1756518 - Delay starting UntrustedModulesProcessor. r=mhowell,necko-reviewers,kershaw
This patch is to delay starting `UntrustedModulesProcessor` to avoid
processing a massive amount of loaded modules in the browser process
during startup.

To achive that, this patch introduces "unblock-untrusted-modules-thread"
notification.  Before the notification, `UntrustedModulesProcessor` is
created but marked as not ready.  This means the processor does not
go beyond `ScheduleNonEmptyQueueProcessing`.  Once the notification is
observed, we propagate it to all existing child processes, and afterward
`UntrustedModulesProcessor` in new processes will be marked ready from
the beginning.

Differential Revision: https://phabricator.services.mozilla.com/D140123
2022-03-05 04:39:05 +00:00
Csoregi Natalia
eceb974192 Backed out changeset c63f50d02eac (bug 1756518) for bp-hybrid bustage on SocketProcessHost.cpp. CLOSED TREE 2022-03-05 01:37:50 +02:00
Toshihito Kikuchi
c601fd8b0a Bug 1756518 - Delay starting UntrustedModulesProcessor. r=mhowell,necko-reviewers,kershaw
This patch is to delay starting `UntrustedModulesProcessor` to avoid
processing a massive amount of loaded modules in the browser process
during startup.

To achive that, this patch introduces "unblock-untrusted-modules-thread"
notification.  Before the notification, `UntrustedModulesProcessor` is
created but marked as not ready.  This means the processor does not
go beyond `ScheduleNonEmptyQueueProcessing`.  Once the notification is
observed, we propagate it to all existing child processes, and afterward
`UntrustedModulesProcessor` in new processes will be marked ready from
the beginning.

Differential Revision: https://phabricator.services.mozilla.com/D140123
2022-03-04 21:12:18 +00:00
Nika Layzell
6617df9161 Bug 1754037 - Part 8: Switch ipdlc to use ParamTraits instead of IPDLParamTraits, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D140009
2022-03-04 15:39:43 +00:00
Nika Layzell
a08d13bebb Bug 1754037 - Part 6: Add a FatalError method to Message{Reader,Writer}, r=ipc-reviewers,mccr8
This will take the place of the existing uses of `aActor->FatalError` in
ipdlc-generated ParamTraits implementations, and will function without an
actor.

Differential Revision: https://phabricator.services.mozilla.com/D140007
2022-03-04 15:39:42 +00:00
Nika Layzell
d9489230f7 Bug 1754037 - Part 5: Update IPC documentation for ParamTraits, r=ipc-reviewers,mccr8
The documentation now reflects the fact that IPDLParamTraits is no longer
necessary.

Differential Revision: https://phabricator.services.mozilla.com/D140006
2022-03-04 15:39:42 +00:00
Nika Layzell
be0d18a401 Bug 1754037 - Part 4: Implement IPDLParamTraits in terms of ParamTraits, r=ipc-reviewers,mccr8
This flips around the relationship between IPDLParamTraits and ParamTraits so
that callers can always use ParamTraits instead of IPDLParamTraits.

Differential Revision: https://phabricator.services.mozilla.com/D140005
2022-03-04 15:39:41 +00:00
Nika Layzell
05dc5e0d76 Bug 1754037 - Part 3c: Automatically update all ParamTraits implementations, r=ipc-reviewers,media-playback-reviewers,bryce,mccr8
Automatically generated rewrites of all ParamTraits and IPDLParamTraits
implementations in-tree to use IPC::Message{Reader,Writer}.

Differential Revision: https://phabricator.services.mozilla.com/D140004
2022-03-04 15:39:41 +00:00
Nika Layzell
1d44e4355c Bug 1754037 - Part 3b: Update IPDL generated code to new ParamTraits API, r=ipc-reviewers,mccr8
Updates to the IPDL code generator to make the generated code correctly
use the new ParamTraits APIs for serialization and deserialization.

IPDL continues to use IPDLParamTraits after this change, it will be
changed to use ParamTraits in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D140002
2022-03-04 15:39:40 +00:00
Nika Layzell
5f06238318 Bug 1754037 - Part 3a: Manual changes to new ParamTraits API, r=ipc-reviewers,mccr8
This change does not build without the automatically rewritten changes from
part 3c, as every IPC::ParamTraits and IPDLParamTraits implementation needs to
be updated at once, but these are the manual changes which are required and not
handled by the automatic script.

Differential Revision: https://phabricator.services.mozilla.com/D140001
2022-03-04 15:39:40 +00:00
Nika Layzell
14e4d6be72 Bug 1754037 - Part 2: Forward declare Message{Reader,Writer} where Message is forward declared, r=ipc-reviewers,mccr8
This will allow the types to be more easily automatically substituted in place
of `IPC::Message`, as the type will already be declared in places it is used.

Differential Revision: https://phabricator.services.mozilla.com/D140000
2022-03-04 15:39:39 +00:00
Nika Layzell
e1a369d1f2 Bug 1754037 - Part 1: Introduce MessageWriter and MessageReader types, r=ipc-reviewers,mccr8
These types will replace `IPC::Message` in ParamTraits method arguments, and
combine the `IPC::Message*`, `PickleIterator` and `IProtocol*` arguments
together into a single argument.

In a future patch this will be used to remove IPDLParamTraits and merge it back
with ParamTraits.

Differential Revision: https://phabricator.services.mozilla.com/D139999
2022-03-04 15:39:39 +00:00
Nazım Can Altınova
c7cba430c9 Bug 1709104 - Send the IPC markers in sender/receiver/background threads to the main thread if they are not profiled r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D140089
2022-03-04 12:10:02 +00:00
Nazım Can Altınova
186ed89c0e Bug 1755965 - Send the IPC markers in IPC I/O thread to the main thread if they are not profiled r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D140088
2022-03-04 12:10:01 +00:00
Butkovits Atila
fed1c445a8 Backed out changeset 6f9edda31be0 (bug 1756518) for causing failures at TestHttpChannel.PBAsyncOpen. CLOSED TREE 2022-03-04 07:08:12 +02:00
Toshihito Kikuchi
69d4c48340 Bug 1756518 - Delay starting UntrustedModulesProcessor. r=mhowell,necko-reviewers,kershaw
This patch is to delay starting `UntrustedModulesProcessor` to avoid
processing a massive amount of loaded modules in the browser process
during startup.

To achive that, this patch introduces "unblock-untrusted-modules-thread"
notification.  Before the notification, `UntrustedModulesProcessor` is
created but marked as not ready.  This means the processor does not
go beyond `ScheduleNonEmptyQueueProcessing`.  Once the notification is
observed, we propagate it to all existing child processes, and afterward
`UntrustedModulesProcessor` in new processes will be marked ready from
the beginning.

Differential Revision: https://phabricator.services.mozilla.com/D140123
2022-03-04 03:18:42 +00:00
Butkovits Atila
2fa3391c7b Backed out changeset 3336c8e9a43f (bug 1756518) for causing build bustages at Unified_cpp_xre_dllservices. CLOSED TREE 2022-03-04 03:49:23 +02:00
Toshihito Kikuchi
216c399735 Bug 1756518 - Delay starting UntrustedModulesProcessor. r=mhowell,necko-reviewers,kershaw
This patch is to delay starting `UntrustedModulesProcessor` to avoid
processing a massive amount of loaded modules in the browser process
during startup.

To achive that, this patch introduces "unblock-untrusted-modules-thread"
notification.  Before the notification, `UntrustedModulesProcessor` is
created but marked as not ready.  This means the processor does not
go beyond `ScheduleNonEmptyQueueProcessing`.  Once the notification is
observed, we propagate it to all existing child processes, and afterward
`UntrustedModulesProcessor` in new processes will be marked ready from
the beginning.

Differential Revision: https://phabricator.services.mozilla.com/D140123
2022-03-04 01:21:32 +00:00
Bob Owen
647c996376 Bug 1755979: Pass accessibilty resource ID down from the parent. r=Jamie,nika
This is being done because the way the ID is determined causes issue with the
sandbox and the ID is required very early in process start up.

Differential Revision: https://phabricator.services.mozilla.com/D139649
2022-03-02 11:06:33 +00:00
Andrew McCreight
fb4b92609e Bug 1757534 - Send ByteBuf::mLen as a uint32_t. r=ipc-reviewers,nika
On ARM64 Windows, the GMP process is running in 32-bit, but
the parent process is running in 64-bit. The FlushFOGData reply
sends a ByteBuf from a GMP process to the parent process. This
is a problem because size_t has different sizes in each process.
This patch addresses that by sending the size as a uint32_t.

WriteBytesZeroCopy already implicitly converts the length
argument, so it seems unlikely that the other users of ByteBuf
depend on this behavior. Additionally, I think that any ByteBuf
large enough to cause issues here would end up crashing due to
hitting the IPC message size limit.

Differential Revision: https://phabricator.services.mozilla.com/D139961
2022-03-01 19:32:45 +00:00
Jens Stutte
77111a883a Bug 1752518: Ignore missing MessagePortService inside MessagePortParent::ForceClose. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D139859
2022-03-01 16:37:32 +00:00
Alexandre Lissy
098690b8f4 Bug 1756802 - Set Utility Process name for profiler r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D139840
2022-03-01 08:27:22 +00:00
Nika Layzell
2f62d8c857 Bug 1751948 - Part 6: Add basic support for running IPDL unit tests during gtest, r=ipc-reviewers,andi,handyman
This patch introduces a new system for building IPDL unit tests, which is
roughly inspired by the old cxx unit test design, however designed to work with
gtest. It re-uses the existing IPDLUnitTest process type, using static
constructors only present in xul-gtest to register child actor constructors and
ProcessChild implementations to avoid bloating xul.

The IPDLUnitTest actor is used as a backchannel to communicate test failures
from the child process back to the parent process, and manage the test's async
lifecycle more reliably.

The IPDLUnitTest process also needed to have various properties about how it was
initialized adjusted:

* The IPDLUnitTest process should now always load xul-gtest when running
  gtests, by using the "Self" process type and adding a DYLD_LIBRARY_PATH override
  on macOS where the "Self" process type cannot be used.
* The IPDLUnitTest process now initializes minimal XPCOM, and runs a
  frankeneventloop to allow it to use XPCOM event loop structures such as
  SpinEventLoopUntil in tests.
* Support for creating IPDLUnitTest processes on Android was added, as these
  tests had never run on android before.

Differential Revision: https://phabricator.services.mozilla.com/D137170
2022-02-28 21:01:49 +00:00
Nika Layzell
0ae1cf31f9 Bug 1751948 - Part 5: Ensure we don't release ActorLifecycleProxy while holding MessageChannel's Monitor, r=jld
Releasing ActorLifecycleProxy can lead to the IToplevelProtocol being
destroyed, due to the reference being the last reference. If this happens, we
can deadlock due to the MessageChannel embedded in IToplevelProtocol locking
mMonitor during its' destructor. This patch moves acquiring the proxy earlier
in the method, so that we do not deadlock in this case any longer.

Differential Revision: https://phabricator.services.mozilla.com/D137169
2022-02-28 21:01:48 +00:00
Nika Layzell
a2fec877d8 Bug 1751948 - Part 4: Correctly initialize OtherPid() for in-process actors, r=ipc-reviewers,mccr8
Before this change, OtherPid() would only be initialized for one side of an
actor pair when opening an in-process actor using `IToplevelProtocol::Open` or
`IToplevelProtocol::OpenOnSameThread`. This changes the function to directly
accept the other protocol, and initializes the value correctly in all cases.

Differential Revision: https://phabricator.services.mozilla.com/D137168
2022-02-28 21:01:48 +00:00
Marian-Vasile Laza
9b19135d0c Backed out changeset 540d7dd134db (bug 1755979) for causing xpcshell failures on ContentParent.cpp. CLOSED TREE 2022-02-28 11:56:41 -08:00
Bob Owen
2ccbc7a61d Bug 1755979: Pass accessibilty resource ID down from the parent. r=Jamie,nika
This is being done because the way the ID is determined causes issue with the
sandbox and the ID is required very early in process start up.

Differential Revision: https://phabricator.services.mozilla.com/D139649
2022-02-28 17:31:57 +00:00
Emilio Cobos Álvarez
4ea7812d94 Bug 1757209 - Fix Android build.
MANUAL PUSH: Trivial tweak CLOSED TREE
2022-02-28 16:34:48 +01:00
Emilio Cobos Álvarez
74c4e590a6 Bug 1757209 - Don't hardcode snap instance name. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D139761
2022-02-28 15:07:16 +00:00
Jonathan Watt
300fb860be Bug 1756447 - Remove the code supporting saving print setting from the content process. r=bobowen,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D139292
2022-02-27 23:45:56 +00:00
Alexandre Lissy
dd586a7422 Bug 1756069 - Make UtilityProcess parent wait for child init completion to resolve promise r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D139304
2022-02-24 16:42:48 +00:00
Alexandre Lissy
2612e07dc3 Bug 1756069 - Ensure proper termination of Utility process r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D139303
2022-02-24 16:42:48 +00:00
Alexandre Lissy
d22b7310f4 Bug 1755437 - UtilityProcess memory reporting uses inversed child/parent naming r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D139591
2022-02-24 16:38:58 +00:00
Alexandre Lissy
44467cab4c Bug 1756984 - Remove mscom::ProcessRuntime from Utility r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D139589
2022-02-24 13:38:06 +00:00
Narcis Beleuzu
6799f1b983 Backed out 10 changesets (bug 1752332) for bc failures on browser_preferences_usage.js
Backed out changeset 5c475692133f (bug 1752332)
Backed out changeset 7fb5f0cc44f6 (bug 1752332)
Backed out changeset e8b2a80aa796 (bug 1752332)
Backed out changeset 593e5e138927 (bug 1752332)
Backed out changeset a8832dc94d1b (bug 1752332)
Backed out changeset b10197a1ed67 (bug 1752332)
Backed out changeset 8de253223dbc (bug 1752332)
Backed out changeset be908bb7a985 (bug 1752332)
Backed out changeset 26796b527442 (bug 1752332)
Backed out changeset 1a875dc06058 (bug 1752332)
2022-02-23 20:43:01 +02:00
Jens Stutte
5d4e23141d Bug 1755376: Rename receiving NotifyImpendingShutdown to distinguish send and receive case. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D139257
2022-02-23 15:45:24 +00:00
Tom Ritter
dc362926e6 Bug 1752332: Remove the blocklisting check in ::OnPreferenceChange r=KrisWright
Now that we send everything (except sometimes the user value
is sanitized) we should no longer perform this check.

This is also good because it eliminates security code you
have to have (and thus accidently omitting it is a
vulnerability) and changes it to security code that happens
automatically, and is enforced by the compiler (via mandatory
ctor argument.)

Differential Revision: https://phabricator.services.mozilla.com/D138684
2022-02-23 15:31:10 +00:00
Tom Ritter
1c8c5ab5d0 Bug 1752332: Rename ShouldSyncPreference to ShouldSanitizePreference r=necko-reviewers,KrisWright,dragana
This simplifies the number of negations needed,
and makes things easy to understand.  I think
anyway; I know that without renaming it I made
several annoying-to-diagnose negation errors...

Differential Revision: https://phabricator.services.mozilla.com/D138682
2022-02-23 15:31:09 +00:00