This will ensure that errors in one side of a NS_AsyncCopy will more reliably
propagate to the other side of the NS_AsyncCopy, by allowing us to check for
situations like stream closure reliably even when the other side either has no
available data, or no available space.
Differential Revision: https://phabricator.services.mozilla.com/D170698
This is semantically similar to the existing available() method, however will
not block, and doesn't need to do the work to actually determine the number of
available bytes.
As part of this patch, I also fixed one available() implementation which was
incorrectly throwing NS_BASE_STREAM_WOULD_BLOCK.
Differential Revision: https://phabricator.services.mozilla.com/D170697
This new method can be used to check if the nsIOutputStream has been
closed without having data available to write. It should avoid blocking
to discover this information.
Differential Revision: https://phabricator.services.mozilla.com/D170696
This avoids a syscall and also prevents a lot of unnecessary SeTcbPrivilege
requests which may be audited by security software.
Differential Revision: https://phabricator.services.mozilla.com/D170855
This defines MOZ_CONTENT_TEMP_DIR to make it easier to track this in the code.
It also uses this to guard some Linux specific uses.
Differential Revision: https://phabricator.services.mozilla.com/D168596
This adds `count` out parameter for recursive file remove calls to report the number of the removed entries.
Having a lot of files removed by `::Remove(recursive=true)` has been a problem, as a slow disk can cause a hang with such call. A counter feature will help us knowing the situation better via telemetry.
The use of out parameter here is to mark it optional and prevent unwanted changes in existing callers (because a return value can't be optional).
Differential Revision: https://phabricator.services.mozilla.com/D156940
This adds `count` out parameter for recursive file remove calls to report the number of the removed entries.
Having a lot of files removed by `::Remove(recursive=true)` has been a problem, as a slow disk can cause a hang with such call. A counter feature will help us knowing the situation better via telemetry.
The use of out parameter here is to mark it optional and prevent unwanted changes in existing callers (because a return value can't be optional).
Differential Revision: https://phabricator.services.mozilla.com/D156940
This patch adds the ability for Windows on ARM to launch either x86 or
ARM Widevine plugins. It also adds the ability for Windows on x86 to
refuse ARM binaries in case, for example, a profile is transferred
between machines.
Overall this should be a non-functional change for users at the time of
landing. It does however allow us to ship the ARM Widevine plugin to
Windows ARM users to workaround a plugin crash with the x86 Widevine
plugin. This only affects Windows 10 users (Windows 11 works fine).
Differential Revision: https://phabricator.services.mozilla.com/D167634
Previously we'd always read the full stream, but if an aCount lower than
the actual size of the stream is provided, we should only encode that
many bytes.
This patch also improves handling of streams shorter than aCount bytes,
ensuring that the generated string is of the correct length.
Differential Revision: https://phabricator.services.mozilla.com/D166616
There are many Linux systems where $HOME is preferred as the "default"
directory to $HOME/Desktop.
This prevents the creation of $HOME/Desktop every time about:preferences
is opened.
Differential Revision: https://phabricator.services.mozilla.com/D165979
This patch doesn't change behavior; these APIs were already effectively
infallible, in the sense that it was impossible for them to return anything
other than NS_OK.
The actual API changes here are in xpcom/io/nsIPipe.idl and
xpcom/io/nsPipe3.cpp, and the rest of this patch is just updates to callsites,
removing code that handled failure-flavored return values from these functions.
(All of this removed code was already dead code, effectively.)
Differential Revision: https://phabricator.services.mozilla.com/D161947