Commit Graph

1499 Commits

Author SHA1 Message Date
sunil mayya
8fc5324936 Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-27 13:30:11 +00:00
Narcis Beleuzu
a71d185ff5 Backed out 6 changesets (bug 1851992) for DT failure on browser_net_image_cache.js . CLOSED TREE
Backed out changeset 3ceaf46f8f55 (bug 1851992)
Backed out changeset c9d322362e22 (bug 1851992)
Backed out changeset 673df3f83249 (bug 1851992)
Backed out changeset 46e18c56dd39 (bug 1851992)
Backed out changeset f9f9143ac713 (bug 1851992)
Backed out changeset 38c40d735ab7 (bug 1851992)
2023-10-24 13:16:40 +03:00
sunil mayya
69ed451168 Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-24 01:48:09 +00:00
Cristina Horotan
c792918ab6 Backed out 5 changesets (bug 1851992) for causing multiple failures
Backed out changeset d28399b3d947 (bug 1851992)
Backed out changeset 95e4df69007a (bug 1851992)
Backed out changeset fa61d4e76827 (bug 1851992)
Backed out changeset 79969d9eb5cd (bug 1851992)
Backed out changeset 03c17255f1af (bug 1851992)
2023-10-17 14:48:23 +03:00
sunil mayya
40a8c4d35c Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-17 08:27:49 +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
Emilio Cobos Álvarez
3bbfb2e943 Bug 1817122 - Make AsyncEventDispatcher(Event) take ownership of the event. r=smaug,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D190059
2023-10-04 19:37:39 +00:00
scottjehl
3d4c5c86b9 Bug 1836128 - Implement source media for media elements and reference/update relevant platform tests r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D189416
2023-10-03 13:52:06 +00:00
Emilio Cobos Álvarez
eb5453c631 Bug 1856300 - Remove some unnecessary casts in HTMLMediaElement. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D189750
2023-10-02 15:17:44 +00:00
Markus Stange
70bd936589 Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the nsContentUtils::Dispatch methods. r=smaug
This saves a few queryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186976
2023-08-28 23:38:42 +00:00
Thomas Wisniewski
3993d66f78 Bug 1397646 - return empty statusText for HTTP2 fetches and XMLHttpRequests; r=kershaw,necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D184527
2023-08-08 19:47:39 +00:00
Iulian Moraru
b1529c5cba Backed out changeset 675cf3cb3d33 (bug 1397646) for causing mochitest failures on test_fetch_basic_http.html. CLOSED TREE 2023-08-07 07:46:50 +03:00
Thomas Wisniewski
7009795aa6 Bug 1397646 - return empty statusText for HTTP2 fetches and XMLHttpRequests; r=kershaw,necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D184527
2023-08-07 04:00:31 +00:00
Natalia Csoregi
9a4e48d386 Backed out 3 changesets (bug 1693250) for causing high frequency failures on test_recreate_audio_sink_clock_time.html. CLOSED TREE
Backed out changeset 7a2f57793a3b (bug 1693250)
Backed out changeset f869096a85f2 (bug 1693250)
Backed out changeset 54b9fbe63086 (bug 1693250)
2023-07-18 06:01:09 +03:00
alwu
2c2afcf279 Bug 1693250 - part3 : add another test to check whether audio sink incorrectly inserts silence. r=media-playback-reviewers,webidl,saschanaz,padenot
Differential Revision: https://phabricator.services.mozilla.com/D183435
2023-07-17 19:54:24 +00:00
alwu
49d28ce1ba Bug 1693250 - part2 : reset the audible state when the audio sink get shutdown. r=bryce,karlt
When the audio sink shutdown, we should also reset the audible state for
the listeners. Otherwise, MediaDecoderStateMachine would possibly rely
on the incorrect audible state that is produced by previous sink, which
would cause showing the sound indicator even if no sound is being playing.

Eg. Considering following case without the reset of the audible state

1. Sink A is audible -> MDSM set mIsAudioDataAudible=true
2. Stop sink
3. Recreate sink B and it's playing silence -> MDSM's mIsAudioDataAudible=true is still true, this is wrong!

Differential Revision: https://phabricator.services.mozilla.com/D113550
2023-07-17 19:54:24 +00:00
Karl Tomlinson
062cb9e0b4 Bug 1829068 retain the same AudioSinkWrapper when switching output devices r=padenot
This allows video playback to continue uninterrupted.

The AudioSinkWrapper now maintains the correct playback position in the media
data.  Previously the replacement AudioSinkWrapper started its clock at the
"current playback position" from the MediaDecoderStateMachine, which did not
include additional time from looping, so silence would be played until the
missing time had passed.

The AudioSinkWrapper now continues to periodically attempt to open a new
output device if not initially available.  Previously such attempts were only
performed on state changes such as seeking or unmuting.

The promise returned from MediaDecoderStateMachine::InvokeSetSink() now
resolves regardless of whether the new device can be opened successfully.
Previously the promise could be rejected if the device was necessary for audio
output at the time of the call but no check for device availability (beyond
that of device enumeration) was performed if playback was suspended or muted
or if a subsequent device change had already been queued.  Even previously the
underlying device was changed even when the promise was rejected and could be
used if a state change occurred.

Differential Revision: https://phabricator.services.mozilla.com/D181975
2023-06-27 08:53:50 +00:00
Cristian Tuns
5d943204d3 Backed out 3 changesets (bug 1829068) for causing wpt failures in setSinkId-with-MediaElementAudioSourceNode.https.html CLOSED TREE
Backed out changeset 40cf2b588396 (bug 1829068)
Backed out changeset 1a8f8cda9b25 (bug 1829068)
Backed out changeset 5eb680967020 (bug 1829068)
2023-06-27 01:25:48 -04:00
Karl Tomlinson
d3b05162c8 Bug 1829068 retain the same AudioSinkWrapper when switching output devices r=padenot
This allows video playback to continue uninterrupted.

The AudioSinkWrapper now maintains the correct playback position in the media
data.  Previously the replacement AudioSinkWrapper started its clock at the
"current playback position" from the MediaDecoderStateMachine, which did not
include additional time from looping, so silence would be played until the
missing time had passed.

The AudioSinkWrapper now continues to periodically attempt to open a new
output device if not initially available.  Previously such attempts were only
performed on state changes such as seeking or unmuting.

The promise returned from MediaDecoderStateMachine::InvokeSetSink() now
resolves regardless of whether the new device can be opened successfully.
Previously the promise could be rejected if the device was necessary for audio
output at the time of the call but no check for device availability (beyond
that of device enumeration) was performed if playback was suspended or muted
or if a subsequent device change had already been queued.  Even previously the
underlying device was changed even when the promise was rejected and could be
used if a state change occurred.

Differential Revision: https://phabricator.services.mozilla.com/D181975
2023-06-27 03:22:10 +00:00
Emilio Cobos Álvarez
529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Tom Schuster
f33200529a Bug 1834737 - Make RFPTarget parameter of Document::ShouldResistFingerprinting non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D178925
2023-05-31 09:46:54 +00:00
Paul Adenot
fa15d38480 Bug 1817997 - Write a version of GetSeekableTimeRanges that uses double and not TimeUnit. r=alwu
When playing a MediaSource, `seekable` should return `[0, duration]`, and duration
can be a double of any precision.

Differential Revision: https://phabricator.services.mozilla.com/D176042
2023-05-24 13:18:43 +00:00
Paul Adenot
71f41c3a9c Bug 1817997 - Limit time resolution to microsecond on values exposed to script. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D176041
2023-05-24 13:18:43 +00:00
Paul Adenot
450c7cfa1a Bug 1817997 - Replace more double representing seconds by TimeUnit in MediaSource. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D176037
2023-05-24 13:18:42 +00:00
Paul Adenot
fcd4b24422 Bug 1817997 - Reduce precision when storing time related to the played attribute. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D173528
2023-05-24 13:18:42 +00:00
Paul Adenot
0c3560d9be Bug 1817997 - Update HTMLMediaElement to use the new TimeUnit. r=alwu
Similarly to other commits, it's necessary to sometimes reduce the precision of
returned time values, to ensure there's no change to returned numbers.

Differential Revision: https://phabricator.services.mozilla.com/D173313
2023-05-24 13:18:41 +00:00
Jens Stutte
014c99b70e Bug 1834326 - Have different error messages for QuotaExceededError in media APIs. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D178683
2023-05-24 07:51:42 +00:00
Cosmin Sabou
bd2029e260 Backed out 80 changesets (bug 1821362, bug 1703812, bug 1817997) for causing media crashes as in Bug 1833890. a=backout
Backed out changeset f2113c9b661f (bug 1817997)
Backed out changeset f1ecfbba7ed2 (bug 1703812)
Backed out changeset 011cece33b0d (bug 1817997)
Backed out changeset 4b42659090f3 (bug 1817997)
Backed out changeset 2d92f903dd66 (bug 1817997)
Backed out changeset 0ef13d357ee3 (bug 1817997)
Backed out changeset 7353f869efd2 (bug 1703812)
Backed out changeset 14b061d0f595 (bug 1817997)
Backed out changeset d29bc29397c8 (bug 1703812)
Backed out changeset 54c3294f0839 (bug 1817997)
Backed out changeset b9f2e1155bd7 (bug 1817997)
Backed out changeset d5d5d390dcbf (bug 1817997)
Backed out changeset 8fca27bd0f6b (bug 1817997)
Backed out changeset 670c599a3b99 (bug 1817997)
Backed out changeset deea3077f762 (bug 1817997)
Backed out changeset 25ecea0f3d49 (bug 1817997)
Backed out changeset 35ab3ed5e3fc (bug 1817997)
Backed out changeset f516a428ba32 (bug 1817997)
Backed out changeset e589b4d30995 (bug 1817997)
Backed out changeset d096b9cc905d (bug 1817997)
Backed out changeset 2952a6fa06e5 (bug 1817997)
Backed out changeset c1ac4c31ad9a (bug 1817997)
Backed out changeset 04c60cd83c5f (bug 1821362)
Backed out changeset 6dd80575e551 (bug 1821362)
Backed out changeset b86b569ecd46 (bug 1817997)
Backed out changeset 412e0a9ec4e8 (bug 1817997)
Backed out changeset 8e0dcf163138 (bug 1817997)
Backed out changeset 7af506896930 (bug 1817997)
Backed out changeset 29f7cd2b341c (bug 1817997)
Backed out changeset 7f64e65d9497 (bug 1817997)
Backed out changeset 89c241451a32 (bug 1817997)
Backed out changeset 66e4a26e1ebe (bug 1817997)
Backed out changeset ea1aebd4e245 (bug 1817997)
Backed out changeset 2d88a5915db9 (bug 1817997)
Backed out changeset 697ec1928f9c (bug 1817997)
Backed out changeset 41c0bd1133c5 (bug 1817997)
Backed out changeset b20cc750c020 (bug 1817997)
Backed out changeset dc5fd84a3a4c (bug 1703812)
Backed out changeset efa6d130d4eb (bug 1703812)
Backed out changeset 20d9b7cf0ddc (bug 1703812)
Backed out changeset e77c61e8fad2 (bug 1703812)
Backed out changeset 582d5c680e5a (bug 1703812)
Backed out changeset 96c9aacc6811 (bug 1703812)
Backed out changeset 56ec4a57a6a6 (bug 1703812)
Backed out changeset 8f96c8811675 (bug 1703812)
Backed out changeset a79a2f1b2b51 (bug 1703812)
Backed out changeset 07eb8b2c5b9f (bug 1703812)
Backed out changeset bae2b2fb9759 (bug 1703812)
Backed out changeset 38b0416538f3 (bug 1703812)
Backed out changeset b27b54c95cf2 (bug 1703812)
Backed out changeset cab00065d83d (bug 1703812)
Backed out changeset ab44727b2e1a (bug 1703812)
Backed out changeset b7fdcb494670 (bug 1703812)
Backed out changeset 73db43d49c6d (bug 1703812)
Backed out changeset ce754dbfb862 (bug 1703812)
Backed out changeset d694726a3ee6 (bug 1703812)
Backed out changeset 6acede55acbb (bug 1703812)
Backed out changeset 86e7d4784a20 (bug 1703812)
Backed out changeset 6b2e055d9314 (bug 1703812)
Backed out changeset b08695e5728a (bug 1703812)
Backed out changeset 3b8a0081fd10 (bug 1703812)
Backed out changeset 3a163596f982 (bug 1703812)
Backed out changeset 5be1d4b282ab (bug 1703812)
Backed out changeset 1ce012d7509e (bug 1703812)
Backed out changeset ee2fab5881c7 (bug 1703812)
Backed out changeset 62941a522893 (bug 1703812)
Backed out changeset d4f11dc33eed (bug 1703812)
Backed out changeset 781bb4c3cc02 (bug 1703812)
Backed out changeset f070e0de0566 (bug 1703812)
Backed out changeset 9f65c67ba2a6 (bug 1703812)
Backed out changeset 1e76eecb85e2 (bug 1703812)
Backed out changeset 953432408a83 (bug 1703812)
Backed out changeset fd1dc92d3911 (bug 1703812)
Backed out changeset 34d56948c6b6 (bug 1703812)
Backed out changeset 2ba7ca61ecc3 (bug 1703812)
Backed out changeset 545253c469e6 (bug 1703812)
Backed out changeset fb4a61ab1300 (bug 1703812)
Backed out changeset bf07b3cfd3d5 (bug 1703812)
Backed out changeset eaff51e7754b (bug 1703812)
Backed out changeset f5c485c41d13 (bug 1703812)
2023-05-19 14:49:57 +03:00
Paul Adenot
ce8cdae836 Bug 1817997 - Write a version of GetSeekableTimeRanges that uses double and not TimeUnit. r=alwu
When playing a MediaSource, `seekable` should return `[0, duration]`, and duration
can be a double of any precision.

Differential Revision: https://phabricator.services.mozilla.com/D176042
2023-05-17 15:47:07 +00:00
Paul Adenot
f3b945378b Bug 1817997 - Limit time resolution to microsecond on values exposed to script. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D176041
2023-05-17 15:47:07 +00:00
Paul Adenot
db9cc874d6 Bug 1817997 - Replace more double representing seconds by TimeUnit in MediaSource. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D176037
2023-05-17 15:47:06 +00:00
Paul Adenot
339328dd61 Bug 1817997 - Reduce precision when storing time related to the played attribute. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D173528
2023-05-17 15:47:05 +00:00
Paul Adenot
551347a5ef Bug 1817997 - Update HTMLMediaElement to use the new TimeUnit. r=alwu
Similarly to other commits, it's necessary to sometimes reduce the precision of
returned time values, to ensure there's no change to returned numbers.

Differential Revision: https://phabricator.services.mozilla.com/D173313
2023-05-17 15:47:05 +00:00
Karl Tomlinson
efbfbbfcf1 Bug 1832479 reflow video elements with natural size from metadata r=pehrsons
The spec is inconsistent [1] about whether this size from metadata should be
used, but having predictable behavior in Firefox is better than having the
size change unexpectedly because something unrelated triggers a reflow and
this change makes Firefox consistent with Chrome.

[1] https://github.com/whatwg/html/issues/9279

Differential Revision: https://phabricator.services.mozilla.com/D177984
2023-05-17 01:36:59 +00:00
Karl Tomlinson
f92ec4bbae Bug 1832479 use types for decoder owner Invalidate() boolean parameters r=pehrsons
for safety and readability.

Differential Revision: https://phabricator.services.mozilla.com/D177983
2023-05-16 21:30:29 +00:00
Emilio Cobos Álvarez
ded1458b5b Bug 1829189 - Make OnAttrSetButNotChanged and AfterSetAttr infallible. r=smaug
Same rg + sed shenanigans as the first patch.

There were two that could fail, both due to OOM:

 * HTMLInputElement::AfterSetAttr: If we fail (only in the type=range
   case) we end up with an old value without it being clamped by
   min/max/step.

 * HTMLBodyElement::AfterSetAttr: If we fail we won't peek up the
   DocShell's frame margins and styling could be incorrect.

That seems better than having to deal with broken states after we've
already set the attribute.

Depends on D176069

Differential Revision: https://phabricator.services.mozilla.com/D176070
2023-04-21 08:56:27 +00:00
Emilio Cobos Álvarez
c195031050 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Andreas Pehrson
04981fbabb Bug 1807215 - Make the intrinsic size arg in MediaDecoderOwner::Invalidate a const ref. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D174083
2023-04-03 08:36:39 +00:00
Andi-Bogdan Postelnicu
011e3fc2d9 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban
98c675ed3f Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
5e0156c1e4 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
alwu
db08a6d91a Bug 1820723 - do not create wakelock if XPCOM has started shutdown. r=media-playback-reviewers,jolin
Differential Revision: https://phabricator.services.mozilla.com/D172031
2023-03-09 18:08:43 +00:00
Tom Schuster
46046879fd Bug 1813584 - Use fine grained RFP for CubebUtils::PreferredSampleRate. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D168523
2023-02-15 10:55:31 +00:00
Paul Adenot
37f9d98503 Bug 1812542 - Rename nsMediaElement and nsMediaElementEvents log modules. r=media-playback-reviewers,kinetik
Differential Revision: https://phabricator.services.mozilla.com/D167913
2023-01-27 17:10:47 +00:00
alwu
991c4644f7 Bug 1773551 - part1 : move AutoplayPolicy to media namespace in order to prevent naming collision. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D164748
2022-12-19 20:57:54 +00:00
alwu
203938c43b Bug 1803834 - part2 : pause/resume non-audible autoplay video when its visibility changes. r=media-playback-reviewers,padenot
https://html.spec.whatwg.org/multipage/media.html#ready-states:eligible-for-autoplay-2

Depends on D163741

Differential Revision: https://phabricator.services.mozilla.com/D163742
2022-12-06 18:21:39 +00:00
alwu
d124f21b3c Bug 1803834 - part1 : rename mAutoplaying to 'mCanAutoplayFlag'. r=media-playback-reviewers,padenot
Our current attribute `mAutoplaying` seems be equal to the `can
autoplay flag` defined in the spec, so rename it to the spec name.

https://html.spec.whatwg.org/multipage/media.html#can-autoplay-flag

Differential Revision: https://phabricator.services.mozilla.com/D163741
2022-12-06 18:21:39 +00:00
Martin Robinson
62878408df Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Andreas Pehrson
ec4fa4139b Bug 1796069 - Annotate MediaStreamTrackSources with a tracking id and apply it to CopyVideoStages. r=padenot
This will allow time consuming tasks (copies, capture, etc.) along the pipe to
be grouped per-track-source when visualizing profiler markers.

Differential Revision: https://phabricator.services.mozilla.com/D160754
2022-12-01 09:52:46 +00:00
Botond Ballo
bcf265578a Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00