Commit Graph

461 Commits

Author SHA1 Message Date
Jens Stutte
e5b5f8d155 Bug 1775112 - Remove obsolete MessageChannel::Begin/StopPostponingSends feature. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149775
2022-06-21 06:18:31 +00:00
Nika Layzell
03bbeeb7b2 Bug 1768775 - Stash mIsFuzzMsg on the MessageTask so it's available after the message is run, r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D146082
2022-05-11 14:15:35 +00:00
Nika Layzell
b5e2016557 Bug 1768476 - Part 3: Fix nyx-fuzz only bustage on a CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D146026
2022-05-11 00:59:15 +00:00
Nika Layzell
b14a633bee Bug 1768476 - Part 2: Mark MessageTask::mMessage as guarded by the monitor, r=ipc-reviewers,mccr8
All accesses except those through the xpcom interfaces were already
guarded, and given it can be mutated, this seemed easier than adding
thread assertions or similar.

Differential Revision: https://phabricator.services.mozilla.com/D145886
2022-05-10 21:37:26 +00:00
Nika Layzell
42dba697a5 Bug 1768476 - Part 1: Consistently pass IPC::Message around by UniquePtr, r=ipc-reviewers,mccr8
This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.

In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.

Differential Revision: https://phabricator.services.mozilla.com/D145885
2022-05-10 21:37:25 +00:00
Noemi Erli
13882c1928 Backed out 2 changesets (bug 1768476) for causing build bustages in ProtocolFuzzer.h
Backed out changeset c9cb03579c09 (bug 1768476)
Backed out changeset 6732ef394d0e (bug 1768476)
2022-05-10 23:39:29 +03:00
Nika Layzell
a833e671fd Bug 1768476 - Part 2: Mark MessageTask::mMessage as guarded by the monitor, r=ipc-reviewers,mccr8
All accesses except those through the xpcom interfaces were already
guarded, and given it can be mutated, this seemed easier than adding
thread assertions or similar.

Differential Revision: https://phabricator.services.mozilla.com/D145886
2022-05-10 17:45:43 +00:00
Nika Layzell
61ad4be21c Bug 1768476 - Part 1: Consistently pass IPC::Message around by UniquePtr, r=ipc-reviewers,mccr8
This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.

In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.

Differential Revision: https://phabricator.services.mozilla.com/D145885
2022-05-10 17:45:42 +00:00
Christian Holler
040bde52d6 Bug 1756778 - Integrate top-level IPC fuzzing. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D139471
2022-05-05 15:39:24 +00:00
Nika Layzell
6cde34f697 Bug 1745641 - IPC connection errors should be debug-only warnings, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D145258
2022-05-02 21:08:24 +00:00
Alexandre Lissy
ae52a02003 Bug 1756407 - Make about:restartrequired tests more robust r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D144953
2022-04-29 13:44:12 +00:00
Mike Hommey
96c044b561 Bug 1766377 - Fix some sign-compare warnings by using ProcessId more consistently. r=nika,necko-reviewers,kershaw
dom/media/ipc/RDDProcessManager.cpp(320,21): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
      gpuProcessPid != -1 ? gpuProcessPid : base::GetCurrentProcId();
      ~~~~~~~~~~~~~ ^  ~~
dom/media/ipc/RDDProcessManager.cpp(332,21): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
  if (gpuProcessPid != -1) {
      ~~~~~~~~~~~~~ ^  ~~
gfx/layers/ipc/SharedSurfacesParent.cpp(360,38): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
    if (!gpm || gpm->GPUProcessPid() != -1) {
                ~~~~~~~~~~~~~~~~~~~~ ^  ~~
ipc/glue/MessageChannel.cpp(2145,13): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const base::ProcessId' (aka 'const unsigned long') [-Werror,-Wsign-compare]
    if (pid != base::kInvalidProcessId &&
        ~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144688
2022-04-27 07:45:19 +00:00
Nika Layzell
6bc9f1bacb Bug 1738104 - Shutdown IPC actors during EventTarget shutdown, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D129841
2022-03-23 22:22:05 +00:00
Nika Layzell
1021a748fc Bug 1760357 - Part 3: Add thread-safety annotations to MessageChannel, r=jesup
Like DataPipe, the Monitor in this case is shared between multiple objects and
needs some helper methods.

Theoretically REQUIRES annotations should be added to methods on the
transaction type, however the requirement would be difficult to express,
leading to a lot of assertion methods cluttering up the code, so it was left
out for now.

Differential Revision: https://phabricator.services.mozilla.com/D141534
2022-03-22 14:59:41 +00:00
Cristian Tuns
728770cb3f Backed out 5 changesets (bug 1760357) for causing build bustages on Monitor.h CLOSED TREE
Backed out changeset 799de364a32e (bug 1760357)
Backed out changeset 29957146468a (bug 1760357)
Backed out changeset e79cb8caca88 (bug 1760357)
Backed out changeset afba32f4da1d (bug 1760357)
Backed out changeset ddfc71cdf34e (bug 1760357)
2022-03-21 19:01:11 -04:00
Nika Layzell
f6ec5e1f50 Bug 1760357 - Part 3: Add thread-safety annotations to MessageChannel, r=jesup
Like DataPipe, the Monitor in this case is shared between multiple objects and
needs some helper methods.

Theoretically REQUIRES annotations should be added to methods on the
transaction type, however the requirement would be difficult to express,
leading to a lot of assertion methods cluttering up the code, so it was left
out for now.

Differential Revision: https://phabricator.services.mozilla.com/D141534
2022-03-21 21:05:59 +00:00
Randell Jesup
855202c183 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
16f5f5f2b9 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
a98b1f8218 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
ed16f8a553 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
01197944a0 Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
fe15f2115d 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
Nazım Can Altınova
7bf8cf14dd 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
Nika Layzell
d282e33143 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
Jens Stutte
4cbd0b57a1 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
David Parks
c7a1793a04 Bug 1754812: Improve MessageChannel status message when process closes r=ipc-reviewers,nika
Add the type and PID of the process who received a Goodbye to the log message.

Differential Revision: https://phabricator.services.mozilla.com/D138595
2022-02-18 19:07:24 +00:00
Randell Jesup
d7d42b9b2f Bug 1748759: ipc cleanup r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D135184
2022-02-10 22:01:17 +00:00
Nika Layzell
269e9ca7a9 Bug 1751047 - Remove support for intr messages from IPC, r=ipc-reviewers,mccr8
All uses of the intr message type have been removed from the tree, and the only
remaining uses are in IPDL tests, which currently do not test the IPDL runtime.
This test fully removes support for intr messages from the MessageChannel
interface.

Differential Revision: https://phabricator.services.mozilla.com/D136500
2022-01-27 16:42:13 +00:00
Nika Layzell
dc116daf53 Bug 1749059 - Remove Quantum DOM support from IPDL, r=ipc-reviewers,mccr8
This is no longer necessary as the Quantum DOM project is no longer
happening, and removing support simplifies various components inside of
IPDL.

As some code used the support to get a `nsISerialEventTarget` for an
actor's worker thread, that method was replaced with a method which
instead pulls the nsISerialEventTarget from the MessageChannel and
should work on all actors.

Differential Revision: https://phabricator.services.mozilla.com/D135411
2022-01-25 20:29:46 +00:00
Nika Layzell
8f3976c5cc Bug 1631402 - Remove expired IPC_MAIN_THREAD_LATENCY probes, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D135154
2022-01-07 20:33:01 +00:00
Noemi Erli
6252a9d34e Backed out changeset 686ae9e71a9c (bug 1631402) for causing build bustage in MessageChannel.cpp 2022-01-06 00:45:48 +02:00
Nika Layzell
75604c59c3 Bug 1631402 - Remove expired IPC_MAIN_THREAD_LATENCY probes, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D135154
2022-01-05 21:20:15 +00:00
Jens Stutte
14faec00ac Bug 1747380: Always include channel name and task name while reporting channel errors. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D134613
2022-01-05 16:22:19 +00:00
Nika Layzell
fe41d272fa 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
Alexandre Lissy
64e30d2e6d 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
Nika Layzell
317fbed762 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
Nika Layzell
3cee1b0fdd 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
eb2782a588 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
bda80cc28a 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
b4fdd706ce 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
78222d56ca 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
e5982183d1 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
72a1ad04ff 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
5ca3a9b717 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
3860f6441c 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
Nika Layzell
d6385823d2 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
Tom Ritter
7830c4464f 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
Nika Layzell
ab09f85b54 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
df9ade5538 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
9943c666ea 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