Commit graph

121 commits

Author SHA1 Message Date
Sean Feng
551ccbf666 Bug 1877787 - Avoid doing reduced precision computation when generating LCP r=emilio,tjr
When we generate LCP entries, we store the precision-reduced
timestamps which are convenient for later usages, but not very
performant. This patch makes it instead of storing the
precision-reduced timestamps, store the raw timestamps, and only
reduce the precision when they're being used by user code.

Also, this patch changes how we compute precision-reduced timestamps for LCP.
Currently, we effectively use `ReduceTimePrecisionAsMSecsRFPOnly` to
reduce precision which only work in RFP mode. This patch changes it
to `ReduceTimePrecisionAsMSecs` to make it work in 'Normal' mode (i.e.
non-COOP/COEP pages).

Differential Revision: https://phabricator.services.mozilla.com/D200200
2024-02-01 14:30:44 +00:00
Tom Ritter
667283858e Bug 1873405: Relax an assertion about timing r=sefeng
When RFP is enabled and you're dealing with timestamps of
reduced precision, it's possible for these timestamps to
be equal. Relax the assertion to allow that.

Also, conceptually, it should be <= even without RFP because
you can't guarantee the OS timestamps are going to be reliable
(just increasing) and you can't guarantee anything about how
fast or slow computation is going to happen.

Differential Revision: https://phabricator.services.mozilla.com/D197946
2024-01-10 09:56:52 +00:00
Kagami Sascha Rosylight
406c01bc16 Bug 1862244 - Add GlobalTeardownHelper r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D193295
2023-11-23 17:17:39 +00:00
Sean Feng
14bcf0adca Bug 1864160 - Use weak pointer for LCPImageEntryKey.mImageRequestProxy to avoid keeping image loader alive for unnecessary amount of time r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D193964
2023-11-21 17:46:42 +00:00
Sean Feng
a4a246d45c Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-13 19:20:00 +00:00
Stanca Serban
dd5835e707 Backed out changeset cfed378ac68a (bug 1863491) for causing build bustages in PerformanceMainThread.cpp. CLOSED TREE 2023-11-13 18:10:40 +02:00
Sean Feng
c2d69831f7 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-13 14:33:56 +00:00
Nazım Can Altınova
75d7d187ed Bug 1862937 - Add profiler markers for LCP values r=sefeng,profiler-reviewers,florian,emilio
There might be multiple LCP entries in a web page, and we only care about the
last one which is also the biggest value. That's why we need to record these
values in two different places:
- During the Document unload, so we can add markers for the closed pages.
- During the profile capture, so we can add markers for the open pages.

This allows us to capture all the LCP values. Note that this is not the case
for other metrics like FCP, TTFB, DOMContentLoaded etc. that fires only once.

Differential Revision: https://phabricator.services.mozilla.com/D192828
2023-11-13 08:59:17 +00:00
Stanca Serban
45bbc33160 Backed out changeset 24b44cfac27e (bug 1863491) for @ nsIGlobalObject::GetAsInnerWindow related crashes. CLOSED TREE 2023-11-10 23:35:01 +02:00
Sean Feng
91b688376b Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-10 20:44:31 +00:00
Cristian Tuns
535beb363d Backed out changeset e2c6fa08aa82 (bug 1863491) for causing multiple crashes @ nsIGlobalObject::GetAsInnerWindow CLOSED TREE 2023-11-10 10:27:42 -05:00
Sean Feng
15598e3ae4 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-10 14:15:25 +00:00
Cosmin Sabou
22aadef0ce Backed out changeset 4100364d528c (bug 1862937) for causing build bustages. CLOSED TREE 2023-11-09 19:34:15 +02:00
Nazım Can Altınova
2135e815f1 Bug 1862937 - Add profiler markers for LCP values r=sefeng,profiler-reviewers,florian
There might be multiple LCP entries in a web page, and we only care about the
last one which is also the biggest value. That's why we need to record these
values in two different places:
- During the Document unload, so we can add markers for the closed pages.
- During the profile capture, so we can add markers for the open pages.

This allows us to capture all the LCP values. Note that this is not the case
for other metrics like FCP, TTFB, DOMContentLoaded etc. that fires only once.

Differential Revision: https://phabricator.services.mozilla.com/D192828
2023-11-09 16:59:05 +00:00
Stanca Serban
c49907e14f Backed out changeset 31f667310dfe (bug 1862937) for causing multiple failures in WeakPtr.h. CLOSED TREE 2023-11-08 16:52:51 +02:00
Nazım Can Altınova
a05181cdff Bug 1862937 - Add profiler markers for LCP values r=sefeng,profiler-reviewers,florian
There might be multiple LCP entries in a web page, and we only care about the
last one which is also the biggest value. That's why we need to record these
values in two different places:
- During the Document unload, so we can add markers for the closed pages.
- During the profile capture, so we can add markers for the open pages.

This allows us to capture all the LCP values. Note that this is not the case
for other metrics like FCP, TTFB, DOMContentLoaded etc. that fires only once.

Differential Revision: https://phabricator.services.mozilla.com/D192828
2023-11-08 13:29:41 +00:00
Sean Feng
539e32202b Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 20:53:36 +00:00
Sandor Molnar
a4163792c6 Backed out 7 changesets (bug 1722322) for causing bp-nu bustages
Backed out changeset 0ebd32e273b8 (bug 1722322)
Backed out changeset 7a75717f127c (bug 1722322)
Backed out changeset c2a6440a83d7 (bug 1722322)
Backed out changeset 9955756855bd (bug 1722322)
Backed out changeset 37fccb407777 (bug 1722322)
Backed out changeset f52b1f28f753 (bug 1722322)
Backed out changeset 0121c8cf5d2f (bug 1722322)
2023-11-02 21:27:24 +02:00
Sean Feng
611093989e Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 17:04:47 +00:00
Markus Stange
fa8bfb6bc7 Bug 1851263 - Rename nsIGlobalObject::AsInnerWindow to GetAsInnerWindow because it can return null. r=smaug
This is also the name that was originally suggested in https://bugzilla.mozilla.org/show_bug.cgi?id=218415#c53 .

Differential Revision: https://phabricator.services.mozilla.com/D187340
2023-09-04 04:06:30 +00:00
Tom Schuster
38d425da3c Bug 1811566 - Cut DomainLookupStart/End over to fine-grained RFP. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D167563
2023-01-27 09:17:24 +00:00
Tom Ritter
df00f0130c Bug 1811567: Remove unnecessary restrictions on APIs when RFP is enabled r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167444
2023-01-26 17:01:35 +00:00
Tom Ritter
3f482941b5 Bug 1778510: Cut over a bunch of performance time precision calls to use the new calling convention r=sefeng
Depends on D151306

Differential Revision: https://phabricator.services.mozilla.com/D151307
2022-11-29 13:34:19 +00:00
Tom Ritter
702f5027e4 Bug 1778510: Change Performance objects from taking SystemPrincipal bool to a Timer Caller Type r=sefeng,asuth
The System Principal boolean was only used for RFP purposes.
We replace it with an RTPCallerType and populate it not in
the Performance ctor but rather in the CreateFor methods
that will populate it based on the context of their
construction.

Depends on D151305

Differential Revision: https://phabricator.services.mozilla.com/D151306
2022-11-29 13:34:19 +00:00
Butkovits Atila
cb853b7f77 Backed out 33 changesets (bug 1778510) for causing build bustages at nsIGlobalObject.h. CLOSED TREE
Backed out changeset f2a53c9e497c
Backed out changeset 59350ca6f3f2 (bug 1778510)
Backed out changeset abbba7e72b57 (bug 1778510)
Backed out changeset 6cf7473afae8 (bug 1778510)
Backed out changeset 74fb5fed93ea (bug 1778510)
Backed out changeset 5b5dc70cdd0a (bug 1778510)
Backed out changeset ff93191cafd2 (bug 1778510)
Backed out changeset 39cc006b610c (bug 1778510)
Backed out changeset dfaef3ad17a9 (bug 1778510)
Backed out changeset 8fbabeb8244b (bug 1778510)
Backed out changeset 45051b62e3f1 (bug 1778510)
Backed out changeset 86c0923fd81f (bug 1778510)
Backed out changeset a49c0f69d519 (bug 1778510)
Backed out changeset cfad733d4aaf (bug 1778510)
Backed out changeset df6d0fe89d5b (bug 1778510)
Backed out changeset 704db76eab17 (bug 1778510)
Backed out changeset 0651c128e369 (bug 1778510)
Backed out changeset 1e650de647c0 (bug 1778510)
Backed out changeset fa15a3572741 (bug 1778510)
Backed out changeset 4ceffd409eae (bug 1778510)
Backed out changeset 47db43142c62 (bug 1778510)
Backed out changeset ebb21153aaac (bug 1778510)
Backed out changeset a87eaaec3f9c (bug 1778510)
Backed out changeset 43ad5ee21f79 (bug 1778510)
Backed out changeset 5f20af8e1263 (bug 1778510)
Backed out changeset b78576875db0 (bug 1778510)
Backed out changeset d801fdeac90b (bug 1778510)
Backed out changeset 5af032c628c0 (bug 1778510)
Backed out changeset 86aa59de11b4 (bug 1778510)
Backed out changeset 58642357a19c (bug 1778510)
Backed out changeset c575e824e291 (bug 1778510)
Backed out changeset 32a358de4843 (bug 1778510)
Backed out changeset 40e0708c01e7 (bug 1778510)
2022-11-28 23:14:52 +02:00
Tom Ritter
2b467ece7c Bug 1778510: Cut over a bunch of performance time precision calls to use the new calling convention r=sefeng
Depends on D151306

Differential Revision: https://phabricator.services.mozilla.com/D151307
2022-11-28 18:04:11 +00:00
Tom Ritter
1590fa267d Bug 1778510: Change Performance objects from taking SystemPrincipal bool to a Timer Caller Type r=sefeng,asuth
The System Principal boolean was only used for RFP purposes.
We replace it with an RTPCallerType and populate it not in
the Performance ctor but rather in the CreateFor methods
that will populate it based on the context of their
construction.

Depends on D151305

Differential Revision: https://phabricator.services.mozilla.com/D151306
2022-11-28 18:04:10 +00:00
Cosmin Sabou
d245f666b9 Backed out 33 changesets (bug 1778510) for causing bp-hybrid bustages on nsIPrincipal.h. CLOSED TREE
Backed out changeset 282f589ede4a
Backed out changeset e23d03ba5a89 (bug 1778510)
Backed out changeset cbdb34cf7c8d (bug 1778510)
Backed out changeset d9a54521f3fb (bug 1778510)
Backed out changeset f5b7f8ce38b0 (bug 1778510)
Backed out changeset eb64607765a9 (bug 1778510)
Backed out changeset 18291e692834 (bug 1778510)
Backed out changeset bb71cc94a8be (bug 1778510)
Backed out changeset 507e84e1dafe (bug 1778510)
Backed out changeset 6d42e7a083ac (bug 1778510)
Backed out changeset 53799e6a46dd (bug 1778510)
Backed out changeset ff20d709839a (bug 1778510)
Backed out changeset 328d4d2df591 (bug 1778510)
Backed out changeset 9ba44fd8a440 (bug 1778510)
Backed out changeset eb1b7e30e519 (bug 1778510)
Backed out changeset c0927de6153b (bug 1778510)
Backed out changeset 02a306acd093 (bug 1778510)
Backed out changeset 2c5eecc4ad4c (bug 1778510)
Backed out changeset 38a9f45c9621 (bug 1778510)
Backed out changeset 35b7c7df62ce (bug 1778510)
Backed out changeset 187d71f42593 (bug 1778510)
Backed out changeset 450f4ccd6cd0 (bug 1778510)
Backed out changeset 915149e27da0 (bug 1778510)
Backed out changeset 9c6e85369f15 (bug 1778510)
Backed out changeset c6a9fe0ce713 (bug 1778510)
Backed out changeset a2f00462157e (bug 1778510)
Backed out changeset 5278e40b80c3 (bug 1778510)
Backed out changeset dba220581d93 (bug 1778510)
Backed out changeset 17a63044b0dc (bug 1778510)
Backed out changeset 68d607aaa121 (bug 1778510)
Backed out changeset e93004f91f6f (bug 1778510)
Backed out changeset 41d6d9f889e1 (bug 1778510)
Backed out changeset 28ac62019086 (bug 1778510)
2022-11-28 07:34:46 +02:00
Tom Ritter
ea0a478056 Bug 1778510: Cut over a bunch of performance time precision calls to use the new calling convention r=sefeng
Depends on D151306

Differential Revision: https://phabricator.services.mozilla.com/D151307
2022-11-28 04:21:30 +00:00
Tom Ritter
21bae9c01b Bug 1778510: Change Performance objects from taking SystemPrincipal bool to a Timer Caller Type r=sefeng,asuth
The System Principal boolean was only used for RFP purposes.
We replace it with an RTPCallerType and populate it not in
the Performance ctor but rather in the CreateFor methods
that will populate it based on the context of their
construction.

Depends on D151305

Differential Revision: https://phabricator.services.mozilla.com/D151306
2022-11-28 04:21:30 +00:00
Michael Comella
312bff454e Bug 1772417 - align IsPerformanceTimingAttribute to user-timing spec. r=sefeng
IsPerformanceTimingAttribute can be called by both Window and WorkerGlobalScope
global objects so we move it to the Performance* superclass.

Differential Revision: https://phabricator.services.mozilla.com/D154819
2022-08-18 21:18:24 +00:00
Michael Comella
3f9fef6bd8 Bug 1767063 - make PerformanceEntry.mEpoch narrowing conversion explicit. r=sefeng
The converted value gets passed into TimingNotification which assigns the value
into a PerformanceEntry (this is the only usage). Since PerformanceEntry is
defined in WebIDL, we could not change its types (which is double for mEpoch) so
we were forced to safely convert the value where we did.

I don't think the existing conversion code had any bugs since we converted a
64-bit signed integer timestamp into uint64_t (safe) into a double (which is
safe for the reasons mentioned in the code comments).

Differential Revision: https://phabricator.services.mozilla.com/D145142
2022-05-18 17:22:15 +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
Emilio Cobos Álvarez
9410c0a59b Bug 1716481 - Improve ManagedPostRefreshObserver. r=smaug
Make it less sketchy.

Differential Revision: https://phabricator.services.mozilla.com/D118284
2021-06-24 22:05:12 +00:00
Peter Van der Beken
f206ae96e4 Bug 1712725 - Stop clearing JS things when calling mozilla::DropJSObjects. r=mccr8
There's a pattern of clearing JS things when calling mozilla::DropJSObjects,
but mozilla::DropJSObjects already clears the JS things itself by calling
CycleCollectedJSRuntime::RemoveJSHolder.

Differential Revision: https://phabricator.services.mozilla.com/D115885
2021-05-27 08:35:40 +00:00
Peter Van der Beken
af93c19a09 Bug 1712725 - Pass the correct object to mozilla::DropJSObjects. r=mccr8
Various code was passing 'this' to mozilla::DropJSObjects in unlink, but that's
the CC participant. The right object to pass is 'tmp'. I also added static
asserts in mozilla::Hold/DropJSObjects to block this in the future.

Differential Revision: https://phabricator.services.mozilla.com/D115884
2021-05-27 08:35:40 +00:00
Emilio Cobos Álvarez
de258a4e58 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
By resolving the relevant promises, instead of crashing (and if we
didn't crash we'd leave the window registered as a refresh driver
observer, which would be bad).

I wanted to reject them, since that's what we do when the page has no
pres shell, but that'd make this test fail:

   https://searchfox.org/mozilla-central/rev/d8194cbbeaec11962ed67f83aea9984bf38f7c63/dom/base/test/browser_promiseDocumentFlushed.js#165-186

For this, we modify the OneShotPostRefreshObserver API to be more
generic (and rename it OneShotManagedRefreshObserver).

We fix APZ's usage of this API, which was doing something extremely
weird (returning a refcounted object in a UniquePtr). This seems like an
artifact from recent OneShotPostRefreshObserver cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D111851
2021-04-14 19:34:23 +00:00
Sean Feng
5c67d2bffc Bug 1692213 - Use raw timestamp internally for PerformanceEventTiming r=smaug
Currently, whenever the algorithm requires to get timestamps, it'll
try to get the corresponding precision reduced timestamps. However,
this creates some memory overhead because the calculation of precision
reduced timestamps. So instead of always generating the precision
reduced timestamps, we use the raw timestamps internally to avoid
generating precision reduced timestamps unnecessarily.

Differential Revision: https://phabricator.services.mozilla.com/D105829
2021-02-22 15:36:45 +00:00
Sean Feng
52117ce9a4 Bug 1692199 - Performance object shouldn't create eventCounts when the pref is not set r=smaug,aryx
Upon the construction of `eventCounts`, a wrapper of it will be created
because we set the initial values to 0. This exposes the interface
despite the pref is not set.

Differential Revision: https://phabricator.services.mozilla.com/D104872
2021-02-12 20:02:15 +00:00
Sean Feng
b03a010048 Bug 1667836 - Implement EventCounts Interface r=smaug
This interface is part of PerformanceEventTiming.

Spec: https://wicg.github.io/event-timing/#sec-event-counts

Differential Revision: https://phabricator.services.mozilla.com/D102037
2021-02-09 18:54:48 +00:00
Sean Feng
a7786149e0 Bug 1667836 - Allow performance event entries can only be retrieved by PerformanceObserver r=smaug
Performance event entries should only be retrieved by
PerformanceObserver, so it can't be retrieved by using
Performance.GetEntries* APIs.

Differential Revision: https://phabricator.services.mozilla.com/D102036
2021-02-09 18:54:48 +00:00
Sean Feng
228f53a393 Bug 1667836 - Implement PerformanceEventTiming Interface r=smaug
Spec: https://wicg.github.io/event-timing/#sec-performance-event-timing

Differential Revision: https://phabricator.services.mozilla.com/D102035
2021-02-09 18:54:47 +00:00
Sean Feng
0c6204c1bd Bug 1667836 - Use nsAtom for entry comparison in GetEntriesByType r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D103908
2021-02-09 18:54:46 +00:00
Olli Pettay
c7fd62bbcb Bug 1688312 - Consider to use nsAtoms in PerformanceEntry, r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D102807
2021-01-24 12:16:55 +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
Valentin Gosu
bd132e112d Bug 1658097 - [fission] Send resource timing data for cross-origin frames to the correct process r=nika,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D96754
2020-11-13 13:48:00 +00:00
Sylvestre Ledru
fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila
964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru
5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Andi-Bogdan Postelnicu
e10c399e77 Bug 1626555 - Add dom/performance to the list of non-unified-build-compatible directories. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D95167
2020-10-29 17:37:02 +00:00