An (AFAICT undocumented) long-standing feature in Windows is the ability to
set the Zone.Identifier ADS on a file by writing to a file named
"${filename}:Zone.Identifier". In DND, this patch exports this alongside
the ${filename} that will be used for the shortcut, so explorer writes both.
This causes the UAC to kick in when the shortcut is launched.
Differential Revision: https://phabricator.services.mozilla.com/D301935
An (AFAICT undocumented) long-standing feature in Windows is the ability to
set the Zone.Identifier ADS on a file by writing to a file named
"${filename}:Zone.Identifier". In DND, this patch exports this alongside
the ${filename} that will be used for the shortcut, so explorer writes both.
This causes the UAC to kick in when the shortcut is launched.
Differential Revision: https://phabricator.services.mozilla.com/D301935
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.
Differential Revision: https://phabricator.services.mozilla.com/D286158
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
When dropping an image over Total Commander, we first offer a .png file
regardless of the source image type, which requires converting to .png
and losing the original file name. Instead, if an application requests
CF_HDROP (which represents an existing file), prefer a file or file promise
if the nsDataObj has one, and only fall back to a native image if it does
not.
Differential Revision: https://phabricator.services.mozilla.com/D253035
HTTPS-Only should be disabled for any repeated request caused by a file
drag-and-drop, as HTTPS-Only may block the repeated request if it is insecure,
even if the original request was exempt from HTTPS-Only. Disabling HTTPS-Only
completely is fine in this case, because if we are dragging from an insecure
source, that source must already be exempt from HTTPS-Only, as it otherwise
would have been upgraded already by HTTPS-Only.
The changes in nsContentAreaDragDrop and nsWebBrowserPersist fix this problem on
macOS, the changes in widget/windows/nsDataObj fix it in Windows.
Differential Revision: https://phabricator.services.mozilla.com/D244905
Factor out the essentially-identical fragments of the helper functions
called by nsDataObj::GetFile() into a single less-messy auxiliary
function.
No functional changes, beyond better failure return value reporting.
Differential Revision: https://phabricator.services.mozilla.com/D236081
Again, convert C-style explicit allocations to use RAII.
No functional changes -- not even to fix questionable return values.
Differential Revision: https://phabricator.services.mozilla.com/D236080
Add new RAII types for managing and working with the Win32 API functions
Global{Alloc,Free,Lock,Unlock}.
As examples of their use, convert a small collection of uninteresting
uses of these functions to use the RAII types. (More interesting uses
will follow in later commits.)
No functional changes, unless unconditionally zeroing freshly-allocated
memory is somehow a functional change.
Differential Revision: https://phabricator.services.mozilla.com/D236075
Factor out the essentially-identical fragments of the helper functions
called by nsDataObj::GetFile() into a single less-messy auxiliary
function.
No functional changes, beyond better failure return value reporting.
Differential Revision: https://phabricator.services.mozilla.com/D236081
Again, convert C-style explicit allocations to use RAII.
No functional changes -- not even to fix questionable return values.
Differential Revision: https://phabricator.services.mozilla.com/D236080
Add new RAII types for managing and working with the Win32 API functions
Global{Alloc,Free,Lock,Unlock}.
As examples of their use, convert a small collection of uninteresting
uses of these functions to use the RAII types. (More interesting uses
will follow in later commits.)
No functional changes, unless unconditionally zeroing freshly-allocated
memory is somehow a functional change.
Differential Revision: https://phabricator.services.mozilla.com/D236075
While we really should fix our BMP alpha-channel handling, this is good
enough for most purposes.
This doesn't affect pasting images _into_ Firefox, nor drag-and-drop (in
either direction); these will have to be dealt with in a later patch.
Differential Revision: https://phabricator.services.mozilla.com/D177868
`nsDataObj::mTransferable`'s lifecycle and ownership semantics are
trivially that of `RefPtr`. Use it.
(We do not presently extend this to `m_enumFE`, below; according to
comments in IEnumFE.h, that one's less trivial.)
No functional changes.
Differential Revision: https://phabricator.services.mozilla.com/D216624
`nsDataObj::mTransferable`'s lifecycle and ownership semantics are
trivially that of `RefPtr`. Use it.
(We do not presently extend this to `m_enumFE`, below; according to
comments in IEnumFE.h, that one's less trivial.)
No functional changes.
Differential Revision: https://phabricator.services.mozilla.com/D216624
The read-loop in OnDataAvailable is needlessly baroque and uses a very
strange dialect of Hungarian notation. Factor out the zero-element case
for simplicity (of explication, if nothing else), and add justificatory
comments as appropriate.
Differential Revision: https://phabricator.services.mozilla.com/D171001
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.
The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.
As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.
Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.
Differential Revision: https://phabricator.services.mozilla.com/D168017
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.
The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.
As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.
Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.
Differential Revision: https://phabricator.services.mozilla.com/D168017
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.
Differential Revision: https://phabricator.services.mozilla.com/D158587
Perform some cleanup to bring the code in this function closer to modern
standards. (This includes, but is not limited to, the simple
variable-name change requested by the Bugzilla bug.)
This commit should have no effective functional changes.
Tested via `browser/base/content/test/general/browser_clipboard.js`,
which was confirmed to complain if changes were made to this function's
output (and, specifically, to the values in the start- and
end-positions).
Differential Revision: https://phabricator.services.mozilla.com/D138087