Extension.jsm, ContextualIdentityService.jsm and GeckoViewConsole.jsm still reference browser.properties.
Depends on D117622
Differential Revision: https://phabricator.services.mozilla.com/D117623
This commit updates the memory runtime code to generally
use pages instead of byte lengths. In terms of runtime
structures: limits are in pages, memory object max
size is in pages, memory object current size is in bytes,
and the TlsData bounds check limit is in bytes.
This code is tricky, so I've added a 'wasm::Pages' typed unit
to catch cases of type confusion and make intent clearer. I've
also tried to add asserts, comments, and rename unclear variables.
The array buffers (shared and non-shared) still track their
length in bytes (this is best as the byte length is needed for
warm code in memory.copy/fill), but now the 'maximum' field is
stored in pages. This allows maximum values that would overflow
byte lengths with memory64 to be represented.
The array buffer interface for wasm now generally only uses
pages, and most code internal operates on pages. There are
still a few cases where byte lengths are required and we add
code or assert that converting from pages to byte lengths is
valid.
Differential Revision: https://phabricator.services.mozilla.com/D116652
Add accessor methods and tweak code to reduce users
that depend on MemoryDesc exposing raw byte lengths for
the initial and maximum fields.
Additionally, MemoryKind is added to MemoryDesc so we can start
asserting in code that assumes Memory32.
Differential Revision: https://phabricator.services.mozilla.com/D116651
This is a clean-up to add a first-class MemoryDesc object,
replacing the ad-hoc methods of describing a module's memory.
Temporarily, this is just a Limits (in pages) and the byte length converted
versions of Limits. The byte length fields will be dropped later.
asm.js used to rely heavily on mutating the ad-hoc representation on
ModuleEnvironment. This commit adds a ModuleEnvironmentShared::Memory
struct for simulating the old way of mutating ModuleEnvironment.
Differential Revision: https://phabricator.services.mozilla.com/D116650
We are going to use the mEffectsInfo's mVisibleRect as a displayport base for
OOP iframe's root scroller and we don't want the displayport base if it hasn't
been arrived from the parent content, to do that, we need to tell the difference
whether the iframe was painted as empty or hasn't been painted.
Differential Revision: https://phabricator.services.mozilla.com/D116575
vqmovn_u16 is very different semantically then _mm_packus_epi16. _mm_packus_epi16 treats the input as signed 16-bit integers and narrows to unsigned 8-bit.
vqmovn_u16, however, is an unsigned to unsigned narrow. vqmovun_s16 does what we actually need here, which is to treated the input as signed 16-bit and narrow to unsigned 8-bit.
Differential Revision: https://phabricator.services.mozilla.com/D117705
This test formerly had a win7-specific fuzzy annotation. I'm generalizing that
annotation to include all Windows versions, since Windows 10 has had similar
fuzzy failures; and I'm also merging with the adjacent "gtkWidget" fuzzy
annotation, since it's got exactly the same fuzzy thresholds.
Differential Revision: https://phabricator.services.mozilla.com/D117719
MDSM will stop decoding video when it reaches the certain amount of frames, but that will not work well if the video decoding is way too slow than the audio decoding.
In that situation, video should keep decoding as much as possible, in order to catch up with the audio decoding.
But we also don't need to decode video without any constraint, set the duration of decoded video to at least as the same as the decoded audio seems fair and enough.
Differential Revision: https://phabricator.services.mozilla.com/D117243
If the decoded video MDSM received is already late, then it indicates that video decoding is too slow.
If we keep decoding but in the same speed, it's very likely all following decoded videos would still be behind the clock and need to be discarded.
The reader has its own mechanism to seek to the next keyframe, but that will only happen when the time of next keyframe is behind the given time threshold, which is the current time.
When the video has pretty long keyframe interval (eg. 5s), then that mechanism won't be triggered because the even if the decoded video frames are late, the next keyframe still far exceeds the current time, so the reader doesn't think it's necessary to skip.
Therefore, MDSM should force the reader to seek to the next keyframe directly, because it know both the decoded time of video frames and the current playback time.
Differential Revision: https://phabricator.services.mozilla.com/D117242
Now that we always have an MTA active, we don't need to explicitly try to
start it anymore. These locations in our source were doing so, which is now
not only redundant, but fails (since `EnsureMTA`'s default constructor is now
`private`).
We also fix a spot in `JumpListBuilder` where we need a lambda to capture by
reference to fix a static analysis issue.
Differential Revision: https://phabricator.services.mozilla.com/D113563
* We make `EnsureMTA`'s default constructor `private`, and `ProcessRuntime` a friend.
`ProcessRuntime` calls this to eagerly create the MTA.
* The default constructor uses the new-ish `CoIncrementMTAUsage` to create the
MTA without requiring a dedicated thread (when available). Otherwise we
fall back to the traditional method. In the latter case, we synchronously
wait for the initialization to complete so that we are guaranteed to have
an MTA when we return.
* Some minor refactoring to make it easier to do the sync wait in the
default constructor. I also renamed a couple of things just to make them
more clear.
Differential Revision: https://phabricator.services.mozilla.com/D113562
This patch does the following:
* General cleanup:
* More explicit restrictions of how/when the various constructors are available.
* `InitializeSecurity` is made `static`, since it doesn't really manipulate instance variables.
* We move some logic for resolving `CoInitializeEx` flags into `GetDesiredApartmentType`.
* Addition of `PostInit`:
* This doesn't do anything at the moment, but since I'm already making a bunch
of changes, I wanted to add this too. `PostInit` is a static method that
is invoked once the `ProcessRuntime` is finished initializing, and, when
present, the sandbox is fully enabled.
* We call `EnsureMTA`'s default constructor to eagerly bring up the MTA. This
causes all background threads to implicitly become members of the MTA, which
means that we can eliminate `CoInitializeEx` calls throughout our codebase,
since they're slow and most developers do not have a clear understanding of
what those functions actually do.
* This also simplifies the COM initialization in sandboxed content processes
with Win32K lockdown, since if our main thread is in the implicit MTA, we
can immediately initialize ourselves without needing to punt that work
over to the persistent MTA thread.
Differential Revision: https://phabricator.services.mozilla.com/D113560
The "magic static" objects created in `nsThread::ThreadList` and
`nsThread::ThreadListMutex` have non-trivial destructors, so they end up
setting `atexit` hooks.
I'd like to switch these over to be `StaticLocalAutoPtr`s which were added
specifically for the purpose of holding magic statics, and have trivial
destructors.
Differential Revision: https://phabricator.services.mozilla.com/D117549
Only a cosmetic change. There is a check during initialization that the constants match the sequential order so little room for getting it wrong.
Differential Revision: https://phabricator.services.mozilla.com/D117702
Also expose the information in the profiler HUD and rename some counters to make it more apparent when specific to the atlases as opposed to other textures mamanged by the texture cache.
Differential Revision: https://phabricator.services.mozilla.com/D117695
I'm replacing the existing [PASS,FAIL] annotation, since I'm pretty sure
moz-wptsync-bot added it (quite recently) in response to some instances of this
intermittent fuzzy-pixels test-failure.
Differential Revision: https://phabricator.services.mozilla.com/D117701
Specifically: in DrawBackgroundImage (which we use to draw borders as well),
this patch makes us translate the anchor-point (together with our destination
rect), for each tiled call to DrawImageInternal.
Differential Revision: https://phabricator.services.mozilla.com/D116596
Currently, as part of initialization of xul.dll on Windows we dynamically
load some DPI-related functions on Windows 10. Those functions cannot be used
with Win32k lockdown, and thus there is no point to loading them.
Differential Revision: https://phabricator.services.mozilla.com/D116629
Currently, we set DPI awareness in the manifest files for firefox.exe.
Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.
This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.
Differential Revision: https://phabricator.services.mozilla.com/D116433
Building on previous patches, this adds a preference to enable
a low quality pinch-zoom mode that reuses cached tiles where
possible.
It doesn't currently redraw at the higher quality scale at the
end of a pinch-zoom, and there are some sampling artifacts in some
cases. However, it should be enough to do some performance testing
on low and devices and see if it helps.
Differential Revision: https://phabricator.services.mozilla.com/D117497