Commit Graph
207 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 1bd0da8bf7 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 22:04:17 +00:00
iulian moraru 480fc572da Revert "Bug 2036439, Bug 2033243 - Deal with ownerGlobal -> documentGlobal rename in extensions. r=robwu,home-newtab-reviewers,mconley" for causing newtab failures.
This reverts commit 4f62279d01.

Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug"

This reverts commit 91a4ece356.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 5a95a889e1.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 7177a68e67.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 5263254690.
2026-05-02 16:43:35 +00:00
Emilio Cobos Álvarez 7177a68e67 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 15:33:23 +00:00
rperta d4cc71008d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" on developer request
This reverts commit e58e122135.

This reverts commit 84ca206f3e.

This reverts commit a7945292ed.

This reverts commit 367d83d299.
2026-05-02 06:20:30 +00:00
Emilio Cobos Álvarez a7945292ed Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-01 11:58:14 +00:00
agoloman c814da612d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" for causing multiple failures.
This reverts commit c7246654bc.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 8873ddf33c.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 8bf999e03c.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 7dea1af2e0.
2026-04-30 20:13:14 +00:00
Emilio Cobos Álvarez 8bf999e03c Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-04-30 17:47:11 +00:00
Nika Layzell 5f0f9dd22a Bug 2020817 - Part 4: Annotate & clean up nsACString callers of BeginReading/Data, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,toolkit-telemetry-reviewers-rotation,layout-reviewers,dom-worker-reviewers,gfx-reviewers,webgpu-reviewers,necko-reviewers,dom-core,smaug,handyman,emilio,pehrsons,kershaw,timhuang,edenchuang,padenot,bradwerth
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.

Differential Revision: https://phabricator.services.mozilla.com/D286158
2026-03-25 08:23:04 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Damien Carver d4d96c1939 Bug 1979356 - Remove the "searchable" flag from marker schema fields r=necko-reviewers,profiler-reviewers,toolkit-telemetry-reviewers,canaltinova,jesup
Differential Revision: https://phabricator.services.mozilla.com/D281769
2026-02-06 14:49:32 +00:00
Jens Stutte 8780e76c26 Bug 1995254 - Always rely on QueryPerformanceCounter for Windows TimeStamp. r=glandium,profiler-reviewers,mstange
QueryPerformanceCounter is considered both reliable and fast since the era of Windows 8, so we can make a huge jump here and move away from GetTickCount always.
This largely simplifies TimeStamp on Windows and brings it on-par in terms of the used data (8 Bytes instead of 24) with all other platforms.
We can eliminate every measured heuristic and rely just on the values given from QueryPerformanceFrequency to determine ticks per second and/or resolution.

For consumers of Now() nothing really changes, as for virtually all "normal" cases they were already seeing QPC values.
But we know at least from bug 1976975 that the old reliability heuristic would strike from time to time in CI and let us fall back to GTC.
There might be other time related weirdnesses in tests coming from that we are not aware of to be related.

Consumers of NowLoRes() will now see the same high resolution (as they do already on MacOS) and practically there is no more reason to use it on Windows.
This guarantees 100% comparability between low- and high-res timestamps, which previously may have led to problems, too.

Note that this will remove support for the MOZ_TIMESTAMP_MODE environment variable, too. There seems to be no usage or documentation of it, it was there probably just for testing purposes.

Differential Revision: https://phabricator.services.mozilla.com/D269724
2025-11-11 13:27:42 +00:00
Atila Butkovits cffdaea8d7 Revert "Bug 1995254 - Always rely on QueryPerformanceCounter for Windows TimeStamp. r=glandium,profiler-reviewers,mstange" for causing bustages at TimeStamp_windows.cpp.
This reverts commit a2598ac838.
2025-11-11 10:03:01 +00:00
Jens Stutte a2598ac838 Bug 1995254 - Always rely on QueryPerformanceCounter for Windows TimeStamp. r=glandium,profiler-reviewers,mstange
QueryPerformanceCounter is considered both reliable and fast since the era of Windows 8, so we can make a huge jump here and move away from GetTickCount always.
This largely simplifies TimeStamp on Windows and brings it on-par in terms of the used data (8 Bytes instead of 24) with all other platforms.
We can eliminate every measured heuristic and rely just on the values given from QueryPerformanceFrequency to determine ticks per second and/or resolution.

For consumers of Now() nothing really changes, as for virtually all "normal" cases they were already seeing QPC values.
But we know at least from bug 1976975 that the old reliability heuristic would strike from time to time in CI and let us fall back to GTC.
There might be other time related weirdnesses in tests coming from that we are not aware of to be related.

Consumers of NowLoRes() will now see the same high resolution (as they do already on MacOS) and practically there is no more reason to use it on Windows.
This guarantees 100% comparability between low- and high-res timestamps, which previously may have led to problems, too.

Note that this will remove support for the MOZ_TIMESTAMP_MODE environment variable, too. There seems to be no usage or documentation of it, it was there probably just for testing purposes.

Differential Revision: https://phabricator.services.mozilla.com/D269724
2025-11-11 08:12:22 +00:00
Nazım Can Altınova e3efe1488d Bug 1994144 - Use static atoms directly for PerformanceEntry types r=jlink,smaug
Previously we were passing strings to the constructor for
PerformanceEntry types, but we don't need that since we know them for
sure during the compile time. It makes it easier to use the static
atoms, and they should be faster than the previous code.

Differential Revision: https://phabricator.services.mozilla.com/D268543
2025-10-17 13:33:05 +00:00
Nazım Can Altınova 73746112e3 Bug 1994145 - Rename Performance::DispatchBufferFullEvent to DispatchResourceTimingBufferFullEvent r=jlink
Previously, it was called DispatchBufferFullEvent confusingly, but it
actually dispatches an event called resourcetimingbufferfull.

Differential Revision: https://phabricator.services.mozilla.com/D268520
2025-10-14 21:47:12 +00:00
Nazım Can Altınova 1cb3be8cd6 Bug 1994145 - Rename Performance::BufferEvent to ResourceTimingBufferFullEvent r=jlink
Previously, it was called BufferEvent confusingly, but it actually
handles the logic related to the resource timing buffer full event.

Differential Revision: https://phabricator.services.mozilla.com/D268519
2025-10-14 21:47:09 +00:00
Kelsey Gilbert f5e3591910 Bug 1958371 - Reduce header-header-includes of nsGlobalWindowInner.h. r=mccr8,chutten,timhuang
* Forward s/nsGlobalWindowInner_CachesEnabled/nsGlobalWindowInner::CachesEnabled/.

Differential Revision: https://phabricator.services.mozilla.com/D244408
2025-09-05 19:36:07 +00:00
agoloman 2c8936cbbf Revert "Bug 1958371 - Reduce header-header-includes of nsGlobalWindowInner.h. r=mccr8,chutten,timhuang" for causing build bustages @TimeoutManager.cpp.
This reverts commit 4b30815167.
2025-08-26 16:37:54 +00:00
Kelsey Gilbert 4b30815167 Bug 1958371 - Reduce header-header-includes of nsGlobalWindowInner.h. r=mccr8,chutten,timhuang
* Forward s/nsGlobalWindowInner_CachesEnabled/nsGlobalWindowInner::CachesEnabled/.

Differential Revision: https://phabricator.services.mozilla.com/D244408
2025-08-26 15:30:13 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Ryan VanderMeulen 3341008787 Bug 1980681 - Use a default by-reference capture for lambda to make static analysis happy with newer STLs. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D259654
2025-08-02 00:10:33 +00:00
Justin Link 6dedde3821 Bug 1925191: Don't create profiler markers for performance.measure() calls with timestamps that are too far in the future r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D233309
2025-05-23 16:03:16 +00:00
Justin Link 58a96c6abf Bug 1925191: Moved the adding of profiler markers from performance.measure() calls into its own function r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D233308
2025-05-23 16:03:13 +00:00
Denis Palmeiro 946022a89c Bug 1928466: Check if markerFile is defined during NowUnclamped diagnostic assert. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D227537
2024-11-06 14:29:37 +00:00
Julien Wajsberg a28aa58f51 Bug 1922494 - Profiler markers inserted by performance.measure should use an unclamped value when no end value is submitted r=sefeng
A clamped value was used incorrectly when no end timestamp or end mark
was given by the caller.

Differential Revision: https://phabricator.services.mozilla.com/D224455
2024-10-09 11:57:46 +00:00
Emilio Cobos Álvarez 71bf77b3fe Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Michael van Straten 8135451a10 Bug 1902995 - Check if profiler thread is being profiled for markers. r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D213928
2024-06-18 14:09:48 +00:00
Denis Palmeiro 5c062218b6 Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Depends on D205662

Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-15 15:34:04 +00:00
Cristina Horotan 886fe5f5a4 Backed out 4 changesets (bug 1887068, bug 1890934) on request by causing build bustages
Backed out changeset 68a7a8a3bb0f (bug 1890934)
Backed out changeset 658f4b57b8ec (bug 1887068)
Backed out changeset 61a9d3a1e592 (bug 1887068)
Backed out changeset efbf5c7065e3 (bug 1887068)
2024-04-12 02:14:44 +03:00
Denis Palmeiro a63122839e Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Depends on D205662

Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-10 17:48:08 +00:00
Cristian Tuns d9503794a6 Backed out 3 changesets (bug 1887068) for causing build bustages in toolkit/* CLOSED TREE
Backed out changeset c6863f012b03 (bug 1887068)
Backed out changeset 3a4d2b74219e (bug 1887068)
Backed out changeset 90a702920d77 (bug 1887068)
2024-04-09 18:19:08 -04:00
Denis Palmeiro f61b8829df Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-09 19:05:36 +00:00
Markus Stange 510461db11 Bug 1883522 - When running with MOZ_USE_PERFORMANCE_MARKER_FILE=1, mmap the marker file to help out perf + simpleperf + samply. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D203536
2024-03-09 23:04:01 +00:00
Mike Hommey cb8586c356 Bug 1884021 - Avoid warning about unused startTimeStamp/endTimeStamp in cases not using the values. r=profiler-reviewers,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D203842
2024-03-07 20:26:03 +00:00
Cristian Tuns 1fbcf051bb Backed out changeset eea5db012489 (bug 1883522) for causing build bustages in Performance.cpp CLOSED TREE 2024-03-05 17:16:25 -05:00
Markus Stange f3da10359d Bug 1883522 - When running with MOZ_USE_PERFORMANCE_MARKER_FILE=1, mmap the marker file to help out perf + simpleperf + samply. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D203536
2024-03-05 21:34:13 +00:00
Jason Kratzer dc5aa1700a Bug 1876138: Check if in main thread before attempting to create PerformanceMark. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D199384
2024-01-29 17:25:25 +00:00
Markus Stange 1c5624ed94 Bug 1876415 - Make timestamp formats consistent between Jitdump and the marker file. r=glandium
On Linux and Android, both jitdump and the marker file will keep using
`CLOCK_MONOTONIC` nanoseconds, as before.

On macOS, both jitdump and the marker file will now be using
`TimeStamp::RawMachAbsoluteTimeNanoseconds()` , i.e. "nanoseconds since
mach_absolute_time origin".
This value has the advantage that it is also relatively easy to obtain
in other browser engines, because their internal timestamp value is stored
in milliseconds or nanoseconds rather than in `mach_absolute_time` ticks.
In the past, on macOS, Firefox was using `CLOCK_MONOTONIC` nanoseconds for
jitdump and `TimeStamp::RawMachAbsoluteTimeValue()` for the marker file.
This inconsistency is now fixed.
I will update samply to change how it treats jitdump timestamps on macOS.
There are no other consumers of jitdump files on macOS that I know of.

On Windows, we will keep using raw QPC values for the marker file - this
matches what's in the ETW events. Jitdump on Windows is mostly unused but
I'm updating it to match.

Furthermore, this fixes the order in mozglue/misc/moz.build to make sure
we always use the TimeStamp_darwin implementation on Darwin (and not just
due to a broken configure check, see bug 1681445), and it fixes the #ifdef
in TimeStamp.h to match the Darwin check.

Differential Revision: https://phabricator.services.mozilla.com/D199592
2024-01-26 03:38:54 +00:00
Doug Thayer 39e9d8ead9 Bug 1811750 - Eliminate redundant array filling in performance.measure r=sefeng
Basically we were falling off a cliff where if we had a bunch of marks recorded
with a particular name, when trying to measure we would fill an array with all
of them only to return the last one. This just replaces that by iterating in
reverse and returning the first matching mark. Arguably we should be using a
hashmap or something here, but this is a quick and trivial improvement that I
think will resolve the reported issue.

Differential Revision: https://phabricator.services.mozilla.com/D199451
2024-01-24 18:02:35 +00:00
Markus Stange b9d5afe9e6 Bug 1873244 - Reintroduce a call that was accidentally removed in bug 1869835. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D197810
2024-01-05 19:00:39 +00:00
Bas Schouten cabef6614e Bug 1869835 - Part 2: Do some code deduplication and convert UserTimingMarker to the new schema. r=mstange,profiler-reviewers
This will allow ETW to collect the additional payload on the UserTiming markers. As well as allow the provider to filter on these markers in order to minimize overhead from other markers that don't need to be collected.

Differential Revision: https://phabricator.services.mozilla.com/D196332
2023-12-21 18:17:41 +00:00
Emilio Cobos Álvarez d02e297b2d Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Jamie Nicol b8ac2e85bc Bug 1838398 - Add env variable to override output dir for external performance marker files. r=mstange
Currently these get output to the current working directory. On
Android, however, we cannot write to that directory, so this
environment variable can be used to set a directory that is writeable.

Differential Revision: https://phabricator.services.mozilla.com/D190289
2023-10-06 20:56:06 +00:00
Tom Schuster 022e1f7566 Bug 1838415 - Use RFPTarget::ReduceTimerPrecision for Performance(Timing). r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181240
2023-06-26 07:17:39 +00:00
Eden Chuang 73cfb8b6d1 Bug 1800659 - P3 Remove WorkerPrivate::ClearMainEventQueue() r=asuth,smaug
Pending->Canceling->Killing (WorkerNeverRan)

Need to clear WorkerPrivate::mPreStartRunnables

Could we call WorkerRunnable::WorkerRun() to release resource? There could be no WorkerGlobalScope...

Pending->Running->Closing->Canceling->Killing(WorkerRan)
Pending->Running->Canceling->Killing(WorkerRan)

When entering “Closing”
1. Keeping receives normal WorkerRunnables
2. Making ParentStatus as Closing
3. Cancel all timeout
4. Don’t clear the main event queue anymore. But we still wait for all SyncLoops be completed.
5. Call WorkerGlobalScope::NoteTerminating() and nsIGlobalObject::DisconnectEventTargetObjects().
6. Switching to “Canceling” by asking parent thread to call WorkerPrivate::Cancel()

When entering “Canceling”
1. Call WorkerGlobalScope::NoteTerminating()
2. Notify StrongWorkerRefs, worker is in “Canceling”, send and complete the corresponding shutdown work right now.
3. Executing all runnables until no normal WorkerRunnables in queue and no WorkerRefs, SyncLoops and children workers
4. Stop receiving normal WorkerRunnables and DisconnectEventTargetObjects of WorkerScope.
4. Entering “Killing”

When entering “Killing”
1. We would not notify WorkerRefs anymore. Logically all WorkerRefs should be released in “Canceling”
2. Executing all remaining ControlRunnables
3. Release corresponding resources of Worker on worker thread.

Depends on D173850

Differential Revision: https://phabricator.services.mozilla.com/D177511
2023-06-06 06:36:50 +00:00
Tom Schuster 591c5f154e Bug 1834737 - Make RFPTarget parameter of nsIGlobalObject::ShouldResistFingerprinting non-optional. r=tjr,media-playback-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D178924
2023-05-31 09:46:53 +00:00
Jeff Muizelaar 7b1dc94565 Bug 1835513 - Add support emit performance.measure data to an external file. r=sefeng,mstange
This is for use in external profilers like samply and etw-gecko

Differential Revision: https://phabricator.services.mozilla.com/D179302
2023-05-29 15:37:51 +00:00
Randell Jesup 2a176abce0 Bug 1835172: Don't clear performance user entries on MemoryPressure events r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D179174
2023-05-29 00:00:24 +00:00
Nazım Can Altınova 00cd84695f Bug 1820826 - Use the startTime in performance.mark API if it's provided in its options r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D173003
2023-03-22 10:12:50 +00:00
Nazım Can Altınova 7a443c61f2 Bug 1820813 - Keep an unclamped startTime inside PerformanceMark and use it for profiler markers r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D173002
2023-03-22 10:12:50 +00:00