Граф коммитов

353 Коммитов

Автор SHA1 Сообщение Дата
Gerald Squelart c4a6f1bac7 Bug 1663382 - Remove dangerous ProfilerStringView::Data() - r=florian
`ProfilerStringView::Data()` would return a pointer to the start of the string, but there may not be a null terminator at the end!
To reduce the likelihood of misuses, that function has now been removed.
Instead, callers must now access the data through `AsSpan` or the `Span` conversion operator (which makes it easy to use with `NS_ConvertUTF16toUTF8` for example).

It was not an issue until now, because deserialized string would always be terminated when copied out of the profile buffer, but a following patch will add optimized code where the non-terminated string inside the buffer will be directly pointed at.

Differential Revision: https://phabricator.services.mozilla.com/D125027
2021-09-10 11:43:47 +00:00
Sean Feng 179b13c16b Bug 1373086 - Optimize Performance::GetEntriesByName r=smaug
We did two optimizations in this patch
  1. Since mResourceEntries and mUserEntries are presorted
  arrays, we could just merge them by iterating them over without
  performing a quick sort.
  2. Don't perform quick sort if entry type is provided.

Differential Revision: https://phabricator.services.mozilla.com/D124797
2021-09-08 19:22:52 +00:00
Nazım Can Altınova a38b25b295 Bug 1728544 - Make the MarkerSchema::Format enum class values CamelCased r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D124241
2021-09-03 14:30:10 +00:00
Nazım Can Altınova ddae0f7cd6 Bug 1728544 - Make the MarkerSchema::Location enum class values CamelCased r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D124240
2021-09-03 14:30:09 +00:00
Andi-Bogdan Postelnicu 250fa0d795 Bug 1725145 - header files fixes in the hybrid build env. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D122343
2021-08-22 10:21:55 +00:00
Kagami Sascha Rosylight ad1eb3ed7e Bug 1723050 - Part 21: Replace typedef by using in dom/performance/ r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121319
2021-08-09 13:37:29 +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
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
Florian Quèze cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +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
Sean Feng 22e7aa390f Bug 1710682 - Make Event::GetEventName returns a char16_t r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D114872
2021-05-11 20:11:01 +00:00
Sean Feng f6a4e52580 Bug 1706132 - Suppress the ErrorResult in EventCounts::EventCounts r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D114122
2021-05-06 01:36:51 +00:00
Sean Feng 7f054950d5 Bug 1709232 - Make PerformanceObserver.supportedEntryTypes respects dom.enable_event_timing r=emilio
PerformanceObserver.supportedEntryTypes doesn't check whether
PerformanceEventTiming is enabled or not, so it'll falsely claims
PerformanceEventTiming is supported even if the pref is disabled.

This patch fixes that by adding a guard to it.

Differential Revision: https://phabricator.services.mozilla.com/D114250
2021-05-05 17:20:12 +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 a0fc34d157 Bug 1693327 - Assert the global is dying when EventCounts fails to set values r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D106530
2021-03-22 23:22:23 +00:00
Simon Giesecke fb4e3cda44 Bug 1673931 - Add missing include directives. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D107189
2021-03-04 14:32:14 +00:00
Sean Feng 04790aa069 Bug 1695328 - PerformanceObserver should throw TypeError instead of SyntaxError r=smaug
According to the latest spec
https://w3c.github.io/performance-timeline/#observe-method,
TypeError should be thrown, however we throw SyntaxError.

Differential Revision: https://phabricator.services.mozilla.com/D106669
2021-03-01 21:45:59 +00:00
smolnar 11a45394a8 Backed out changeset 60a3eddb183b (bug 1695328) for causing failures in PerformanceObserver. CLOSED TREE 2021-03-01 17:16:51 +02:00
Sean Feng 2096c9da69 Bug 1695328 - PerformanceObserver should throw TypeError instead of SyntaxError r=smaug
According to the latest spec
https://w3c.github.io/performance-timeline/#observe-method,
TypeError should be thrown, however we throw SyntaxError.

Differential Revision: https://phabricator.services.mozilla.com/D106669
2021-03-01 14:38:32 +00:00
amurali 8632afe08c Bug 1691453 - Remove ObservesTypeOfEntry again in PerformanceObserver::QueueEntry.r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D106290
2021-02-24 18:07:35 +00:00
Sean Feng fc9a6223a7 Bug 1693059 - Make PerformanceObserver::Disconnect clears its option list r=smaug
Per spec, `disconnect` should clear its option list, such that
doing a `observe`->`disconnect`->`observe` will not be reusing
the same options from the first `observe`.

Spec: https://w3c.github.io/performance-timeline/#disconnect-method

Differential Revision: https://phabricator.services.mozilla.com/D105329
2021-02-24 15:01:37 +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 3963c2761d Bug 1692213 - Use nsTArray for PerformanceEventTiming buffer instead of AutoTArray r=smaug
AutoTArray gives us some memory overhead and the benefits it provides
might not be that useful since PerformanceEventTiming only works
for certain event types.

Differential Revision: https://phabricator.services.mozilla.com/D105078
2021-02-16 14:42:34 +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
Sean Feng 4c30f0fb30 Bug 1667836 - Make performance entries may have different `should add entry` algorithm r=smaug
According to https://w3c.github.io/timing-entrytypes-registry/#registry,
unlike other performance entries, `event` and `first-input` entries have
their own algorithms to determine whether it can be added to observers.
This patch factors some code to allow such algorithms can be
implemented.

Differential Revision: https://phabricator.services.mozilla.com/D102034
2021-02-09 18:54:46 +00:00
Markus Stange 5850226b47 Bug 1688941 - Enforce and document that mTimingData is always non-null. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D103007
2021-01-27 19:24:19 +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
Masatoshi Kimura a29e207781 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 12:07:16 +00:00
Narcis Beleuzu 0322452233 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 04:04:37 +02:00
Masatoshi Kimura b384f14cde Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 04:02:41 +02:00
Dorel Luca 9ed19e2828 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 02:45:34 +02:00
Masatoshi Kimura 87e50835c4 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-14 20:44:54 +00:00
Sean Feng d82519ce96 Bug 1682011 - Make performance objects to keep observers alive r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D99495
2020-12-11 22:27:27 +00:00
Simon Giesecke 4cab6ac723 Bug 1677466 - Move ParamTraits specializations with extra dependencies out of IPCMessageUtils.h. r=mccr8
This moves parts of IPCMessageUtils.h to two new header files and adapts
the include directives as necessary. The new header files are:
- EnumSerializer.h, which defines the templates for enum serializers
- IPCMessageUtilsSpecializations.h, which defines template specializations
  of ParamTraits with extra dependencies (building upon both IPCMessageUtils.h
  and EnumSerializer.h)

This should minimize the dependencies pulled in by every consumer of
IPCMessageUtils.h

Differential Revision: https://phabricator.services.mozilla.com/D94459
2020-12-10 11:09:21 +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
Olli Pettay 25c8782343 Bug 1674254 - Inside a WebWorker context, calling performance.addEventListener throws a generic NS_ERROR_FAILURE, r=barret
Differential Revision: https://phabricator.services.mozilla.com/D97805
2020-11-20 22:39:58 +00:00
Gerald Squelart b3314a1582 Bug 1675409 - Removed now-unused ProfilerMarkerPayload and all dependencies - r=gregtatum,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96054
2020-11-18 21:56:57 +00:00
Gerald Squelart 8ed348d0c7 Bug 1675409 - Migrated UserTimingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96051
2020-11-18 21:53:09 +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
Gerald Squelart ced008cc9f Bug 1675409 - Removed now-unused ProfilerMarkerPayload and all dependencies - r=gregtatum,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96054
2020-11-17 22:26:20 +00:00
Gerald Squelart 2ab89b23a6 Bug 1675409 - Migrated UserTimingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96051
2020-11-17 22:22:34 +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
Gerald Squelart f8c24dd6a4 Bug 1675409 - Removed now-unused ProfilerMarkerPayload and all dependencies - r=gregtatum,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96054
2020-11-17 11:40:46 +00:00
Gerald Squelart c152b9befc Bug 1675409 - Migrated UserTimingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96051
2020-11-17 11:37:08 +00:00