Create methods to add or remove listener directly to the media control keys event source.
So if anyone has a need to monitor media control keys event, they can simply implement their own listener and use `MediaControlService::GetMediaControlKeysManager()` to add or remove a listener.
Differential Revision: https://phabricator.services.mozilla.com/D50687
--HG--
extra : moz-landing-system : lando
If the web extention also needs to implement its listener, they would definitely not need the current implementation in `KeyPressed()` for controlling media controller. Therefore, we should make `MediaControlKeysEventListener` as a pure interface and let inherited class to define their own `KeyPressed()`.
Differential Revision: https://phabricator.services.mozilla.com/D50686
--HG--
extra : moz-landing-system : lando
File's name should reflect what the class is inside the file.
Differential Revision: https://phabricator.services.mozilla.com/D50682
--HG--
rename : dom/media/mediacontrol/MediaHardwareKeysEvent.cpp => dom/media/mediacontrol/MediaControlKeysEvent.cpp
rename : dom/media/mediacontrol/MediaHardwareKeysEvent.h => dom/media/mediacontrol/MediaControlKeysEvent.h
rename : dom/media/mediacontrol/MediaHardwareKeysManager.cpp => dom/media/mediacontrol/MediaControlKeysManager.cpp
rename : dom/media/mediacontrol/MediaHardwareKeysManager.h => dom/media/mediacontrol/MediaControlKeysManager.h
extra : moz-landing-system : lando
The media control key events can come from either physical devices, such as a keyboard or a headset, or from virtual interface, such as SMTC-based visual controller on Windows or MPRIS-based visual controller on Linux.
Therefore, we would be better to rename all those MediaHardwareKeysXXX to MediaControlKeysXXX in order to represent a generic concept.
Differential Revision: https://phabricator.services.mozilla.com/D50681
--HG--
extra : moz-landing-system : lando
This patch converts the certList attribute of nsITransportSecurityInfo
from nsIX509CertList to Array<nsIx509Cert>
Differential Revision: https://phabricator.services.mozilla.com/D48745
--HG--
extra : moz-landing-system : lando
Prior to the patch we appear to be returning the size of lpDeviceName rather
than lpTargetPath.
Differential Revision: https://phabricator.services.mozilla.com/D50979
--HG--
extra : moz-landing-system : lando
This makes rejections reject with an Error so that stacks make sense on failure.
It also changes some `let` to `const` since they're never assigned to.
Differential Revision: https://phabricator.services.mozilla.com/D48520
--HG--
extra : moz-landing-system : lando
If MediaDevices received recurring devicechange events from MediaManager, the
FuzzTimer would be restarted for each one, to coalesce them into the same js
event. If the internal events kept coming sooner than the fuzz timer timeout,
the fuzz timer would never fire.
This patch inverts the logic, so that the first scheduled fuzz timer fires, and
any intermediate internal events are ignored. After it has fired, a new internal
event triggers a new fuzz timer.
Differential Revision: https://phabricator.services.mozilla.com/D48519
--HG--
extra : moz-landing-system : lando
This does three major things:
1) Moves the DeviceChange events from manual callbacks/listeners to
MediaEventSource/MediaEventListener. This is the reason this patch is so
large, as it traverses a lot of files.
There are four layers (from low to high):
- CamerasChild for camera device list changes, and CubebDeviceEnumerator for
microphone and speaker device list changes
- MediaEngineWebRTC, which gathers these into a single listener
- MediaManager, which owns the MediaEngineWebRTC backend
- MediaDevices, where the events from MediaManager are exposed to js
2) Changes the fake event triggering from starting a 30-event burst on setting
the js event listener, to a toggle, so that while the pref is on the events
keep coming.
3) Moves the fake event generation from CamerasChild to MediaEngineWebRTC, since
that's the lowest level where we are aware of both video and audio events.
The fake event generation is also greatly simplified. From being a dedicated
thread with periodic runnables, it is now a periodic timer on main thread
that fires while fake events are enabled. MediaEventProducer gracefully
handles thread safety.
Differential Revision: https://phabricator.services.mozilla.com/D48516
--HG--
extra : moz-landing-system : lando
This lets us dispatch tasks already in the MediaManager ctor.
This also removes the last usage of nsAutoPtr from MediaManager.
Differential Revision: https://phabricator.services.mozilla.com/D48513
--HG--
extra : moz-landing-system : lando
It's not the kind of thing we want people to allow observing, generally, and
even less so the kind of thing that we may want people to rely on.
Move internal callers (all of them tests) to a new DOMWindowUtils.paintCount
method.
Differential Revision: https://phabricator.services.mozilla.com/D50817
--HG--
extra : moz-landing-system : lando
In some cases, the actor of the browser host might be null. So, we need
to check before accessing it in order to avoid crashes.
Differential Revision: https://phabricator.services.mozilla.com/D50715
--HG--
extra : moz-landing-system : lando
This updates the Gecko implementation to match the following change to
the Web Animations spec:
792453b952 (diff-4c9f5c055fb219a7fcad23a9a7a80b64)
Differential Revision: https://phabricator.services.mozilla.com/D50768
--HG--
rename : testing/web-platform/tests/web-animations/interfaces/Document/getAnimations.html => testing/web-platform/tests/web-animations/interfaces/DocumentOrShadowRoot/getAnimations.html
extra : moz-landing-system : lando
We can remove mDisplayName/Id and just use VRDisplayInfo to get these two values.
Differential Revision: https://phabricator.services.mozilla.com/D50870
--HG--
extra : moz-landing-system : lando
When JS is paused, VRService will automatically shutdown because the timer is not updated,
we used to create a new VRDisplay to JS. However, the page is still using the older VRDisplay,
so it can't get the newest VRDisplayInfo status. We should exit presentation and
apply the VRDisplayInfo status to the original VRDisplay instead of creating new one.
Besides, we also need to release the VR screen buffer after exiting the immersive mode to avoid eglMakeCurrent error.
Differential Revision: https://phabricator.services.mozilla.com/D50558
--HG--
extra : moz-landing-system : lando
Dictionaries that we never initialize with JS values don't need a full-featured
Init() method. Instead, we output a cut-down Init() method that doesn't even
take a JSContext and Value as argument, and skips as much work as it can. It
uses constant-false for "is the value present?", but also, to avoid compilation
errors due to use of `cx` and `val` in now-dead conversion code, it tells the
native-to-JS conversion machinery that the value is always missing, which lets
it skip most of the the work it would normally try to do and just output
initialization to the default value. We only need to do this for members that
have default values; the others either remain no-passed or are required members
with no default-initialization behavior.
This saves about 330KB of codesize on Linux64 without PGO and 285KB with PGO.
Differential Revision: https://phabricator.services.mozilla.com/D48007
--HG--
extra : moz-landing-system : lando
This saves about 270KB of codesize on Linux64 without LTO, or 20KB with LTO.
The basic idea is that we can flag dictionaries that need to-JS conversion
(hence ToObjectInternal) based on various IDL uses (return value in normal
interface, argument in callback, etc) and then annotate the ones that are
converted to JS manually in C++ code.
The mozwebidlcodegen changes are needed because non-local changes (e.g. whether
a dictionary is used as a return value somewhere) can now affect the code
generation for a dictionary and hence whether the relevant binding file should
be regenerated. Since these changes can happen in any .webidl file, we need to
check for them. We can't track this via the dependency set on the dictionary
itself, because that would not notice new uses being added.
Differential Revision: https://phabricator.services.mozilla.com/D48006
--HG--
extra : moz-landing-system : lando
I don't know when we stopped raising them, but we did at some point.
I am leaving the capability to not generate a union's ToJSVal method, because I will need it soon.
Differential Revision: https://phabricator.services.mozilla.com/D48554
--HG--
extra : moz-landing-system : lando
This saves about 200KB of codesize on Linux64 without LTO. No effect with LTO,
but is needed for the following patches to work.
Very few dictionaries need these conversions, so explicit opt-in is fine.
Differential Revision: https://phabricator.services.mozilla.com/D48005
--HG--
extra : moz-landing-system : lando
Put them behind a MOZ_HASH_TABLE_CHECKS_ENABLED define, which right now is only
defined in DEBUG builds, preserving behavior.
MakeImmutable becomes an empty inline function when disabled, which should be
zero-cost.
Differential Revision: https://phabricator.services.mozilla.com/D50493
--HG--
extra : moz-landing-system : lando