Commit Graph

427 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Butkovits Atila
83f57b5c69 Backed out 22 changesets (bug 1714226, bug 1706374, bug 1713148) for causing build bustages on MessageChannel.cpp. CLOSED TREE
Backed out changeset ea469eaa54ca (bug 1713148)
Backed out changeset fd8523d5126e (bug 1713148)
Backed out changeset f2e5309c914c (bug 1713148)
Backed out changeset 2da57973ed55 (bug 1713148)
Backed out changeset 677e1ee99bb2 (bug 1713148)
Backed out changeset b4c0619e79bf (bug 1706374)
Backed out changeset c02fa459e77d (bug 1706374)
Backed out changeset 72dc6537cf0b (bug 1706374)
Backed out changeset 48088463c656 (bug 1706374)
Backed out changeset b09ae4c3a94b (bug 1706374)
Backed out changeset 04422175004b (bug 1706374)
Backed out changeset 110b2384e7d1 (bug 1706374)
Backed out changeset ab2b086abbd4 (bug 1706374)
Backed out changeset ffde07f73249 (bug 1706374)
Backed out changeset c6303af17ff4 (bug 1706374)
Backed out changeset 02249671c2f9 (bug 1706374)
Backed out changeset a6a5d05b5636 (bug 1706374)
Backed out changeset e21b6defb805 (bug 1706374)
Backed out changeset c72c5be9ddb1 (bug 1706374)
Backed out changeset 23cd961575a6 (bug 1706374)
Backed out changeset b412d6e9e145 (bug 1706374)
Backed out changeset a8ec285d6472 (bug 1714226)
2021-06-22 04:03:56 +03:00
Nika Layzell
8e8aa56ee2 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-21 21:53:13 +00:00
Nika Layzell
03646b0682 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-21 21:53:13 +00:00
Nika Layzell
6de2add6d7 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-21 21:53:10 +00:00
Nika Layzell
4a956a2673 Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
2021-06-21 21:53:10 +00:00
Florian Quèze
dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00
Iulian Moraru
b02492de66 Backed out changeset 617a466d0cce (bug 1715257) for causing build bustages. CLOSED TREE 2021-06-17 10:58:16 +03:00
Florian Quèze
7b4906a6bd Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 06:12:10 +00:00
Alexandre Lissy
59f1595f14 Bug 1651133 - Double-check the build ID to avoid spurious about:restartrequired r=jld
Differential Revision: https://phabricator.services.mozilla.com/D115593
2021-06-14 10:33:19 +00:00
Olli Pettay
e5eb74b09d Bug 1708042, add support for 'control' priority in ipdl, r=jld,ipc-reviewers
Depends on D115404

Differential Revision: https://phabricator.services.mozilla.com/D115405
2021-05-21 15:46:46 +00:00
Iulian Moraru
e0b2722506 Backed out 3 changesets (bug 1708042) for causing wr failures on background-color-animation-in-body.html.
Backed out changeset f8febc2db198 (bug 1708042)
Backed out changeset a0fccd7121b5 (bug 1708042)
Backed out changeset ddc6d95f0601 (bug 1708042)
2021-05-21 16:39:38 +03:00
Olli Pettay
d147cf8e03 Bug 1708042, add support for 'control' priority in ipdl, r=jld,ipc-reviewers
Depends on D115404

Differential Revision: https://phabricator.services.mozilla.com/D115405
2021-05-20 12:42:31 +00:00
Nika Layzell
e983da120a Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8
This both helps IDE integration and will help avoid build issues which would've
otherwise cropped up when adding new files to the directory for bug 1706374.

Differential Revision: https://phabricator.services.mozilla.com/D112764
2021-04-22 14:32:03 +00:00
Sean Feng
6ba50278a7 Bug 1697585 - Rename high priority to vsync priority r=smaug
`High` priority is being used for vsync tasks, so we should rename it to
make it clear, and renaming it also makes our priority naming less
confusing.

Differential Revision: https://phabricator.services.mozilla.com/D109536
2021-04-14 19:56:42 +00:00
Brindusan Cristian
972d8621c6 Backed out 5 changesets (bug 1697585) for causing build bustages on nsTimerImpl.h. CLOSED TREE
Backed out changeset e9e4a710e7d1 (bug 1697585)
Backed out changeset bc271f42bcb7 (bug 1697585)
Backed out changeset d8516aec6a5e (bug 1697585)
Backed out changeset 0b1bc6cb84af (bug 1697585)
Backed out changeset 074ebebaee27 (bug 1697585)
2021-04-06 17:45:02 +03:00
Sean Feng
dae8c27301 Bug 1697585 - Rename high priority to vsync priority r=smaug
`High` priority is being used for vsync tasks, so we should rename it to
make it clear, and renaming it also makes our priority naming less
confusing.

Differential Revision: https://phabricator.services.mozilla.com/D109536
2021-04-06 13:10:50 +00:00
Florian Quèze
8ad1e5d0aa Bug 1699742 - Remove MOZ_GECKO_PROFILER ifdefs that are no longer needed, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D109078
2021-03-22 16:29:52 +00:00
Simon Giesecke
b9621d6376 Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
Simon Giesecke
ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Simon Giesecke
7c6ccbe4a8 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-05 15:29:49 +00:00
Alexandru Michis
8c28934f09 Backed out changeset c6b72f3c76ba (bug 1676361) for causing bustages in nsSocketTransportService2.cpp
CLOSED TREE
2021-03-04 23:26:04 +02:00
Simon Giesecke
e41d350c04 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 17:30:48 +00:00
Noemi Erli
11891059f7 Backed out changeset 06452c4c828c (bug 1676361) for causing bustages CLOSED TREE 2021-03-04 19:13:56 +02:00
Simon Giesecke
6c371fcc1c Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 16:14:44 +00:00
Simon Giesecke
4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Gerald Squelart
520450ccf0 Bug 1675406 - Don't record IPC markers if one of the profiler mutexes is locked on the current thread - r=canaltinova
Check `profiler_is_locked_on_current_thread()` before recording an IPC marker.

This removes the deadlock found in bug 1675406:
- SamplerThread: During sampling, some data is recorded into the profile buffer, which locks ProfileChunkedBuffer::mMutex, this triggers some chunk updates that are sent to ProfileBufferGlobalController, which attempts to lock its mutex.
- Main thread: An IPC with an update arrives, ProfileBufferGlobalController locks its mutex, then it sends an IPC out, this records a marker into ProfileChunkedBuffer, which attempts to lock its mMutex.
With this patch and bug 1671403, that last IPC will not record a marker anymore.

Differential Revision: https://phabricator.services.mozilla.com/D96971
2020-11-19 11:48:49 +00:00
Gerald Squelart
bfc0fb9f6d Bug 1675409 - Migrated IPCMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96050
2020-11-18 21:52:41 +00:00
Razvan Maries
b7eeb731df Backed out 23 changesets (bug 1675409) for build bustages on Preferences.cpp. CLOSED TREE
Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
2020-11-18 20:06:28 +02:00
Sylvestre Ledru
bebb9f9181 Bug 1519636 - Reformat with clang-format-11 to the Google coding style r=andi,sg,geckoview-reviewers,snorp
It is bringing some minor changes

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90795
2020-11-18 09:05:59 +00:00
Gerald Squelart
f17a3dc5aa Bug 1675409 - Migrated IPCMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96050
2020-11-17 22:22:01 +00:00
Mihai Alexandru Michis
c0d25b01b2 Backed out 24 changesets (bug 1666566, bug 1675409) for causing hazard failures in profiler/core/platform.cpp
CLOSED TREE

Backed out changeset 4d8af8533fd4 (bug 1666566)
Backed out changeset f031a3a8a20f (bug 1675409)
Backed out changeset 2b7e1a031921 (bug 1675409)
Backed out changeset bda5a24b2d0a (bug 1675409)
Backed out changeset 4282e2284314 (bug 1675409)
Backed out changeset 0637f1b26e9f (bug 1675409)
Backed out changeset 67ae04c8f607 (bug 1675409)
Backed out changeset 6c7b3f3618ef (bug 1675409)
Backed out changeset 2f325c22d169 (bug 1675409)
Backed out changeset 1e48ff70ad8f (bug 1675409)
Backed out changeset 1dfc32d6871d (bug 1675409)
Backed out changeset 4f1f218a777b (bug 1675409)
Backed out changeset e6ac8722b38e (bug 1675409)
Backed out changeset cf132e15fb57 (bug 1675409)
Backed out changeset a126e6b00ba9 (bug 1675409)
Backed out changeset fbc7fbb04f33 (bug 1675409)
Backed out changeset 554c69681474 (bug 1675409)
Backed out changeset 44d0521c701f (bug 1675409)
Backed out changeset 04653dfe4720 (bug 1675409)
Backed out changeset 41ca2c043a00 (bug 1675409)
Backed out changeset 264ae4c805d4 (bug 1675409)
Backed out changeset 5f3bbdac0d52 (bug 1675409)
Backed out changeset 11311c11a6e8 (bug 1675409)
Backed out changeset 0355fbc44baf (bug 1675409)
2020-11-17 19:31:28 +02:00