While working on Bug 1777497 I bumped into a few things I would have done
differently that make it harder to misuse the site-scoped permissions.
These are just bugs waiting to happen, so I'm cleaning them up while I'm in here.
Differential Revision: https://phabricator.services.mozilla.com/D152760
The assertion hit has been fixed by the part 7-7 of bug 1774704. I didn't try
to change any behavior with the patch, however, it stops updating `Selection`
immediately after every DOM tree change. Therefore I guess that updating
`Selection` at `execCommand("justifyLeft")` may have failed, and it's now
skipped after handling everything, so the DOM tree after calling it must be
changed by the patch (note that we've stopped throwing from
`Document.execCommand`, so failing to handle the command does not cause stopping
the JS).
Differential Revision: https://phabricator.services.mozilla.com/D154050
Given that libevent's signal handling code is known to have race
conditions, and there are fundamental issues that make it hard to fix
upstream, and previous patches have removed our last usage of it, we
should assert that it's no longer used.
Differential Revision: https://phabricator.services.mozilla.com/D141312
The function DidProcessCrash is now dead code. Before the ProcessWatcher
rewrite, its return value (i.e., whether the process crashed) was never
used, so effectively its only purpose was to make it harder to understand
where the waitpid calls were happening.
Differential Revision: https://phabricator.services.mozilla.com/D141310
This patch rewrites the Unix backend of ProcessWatcher for two reasons:
1. To remove the use of libevent's signal handling, which has concurrency
bugs that can't be easily fixed upstream (see Bugzilla for details)
2. To simplify the code in general; in particular, the new version has one
place where the process and its exit status are consumed from the OS
The new implementation uses the same pipe-to-self technique as libevent
(and which we use elsewhere) to deal with async signal safety. Unlike
the previous version, there is a single object which manages all
monitored child processes rather than one each. (Previously, this
multiplexing was done inside libevent.)
Differential Revision: https://phabricator.services.mozilla.com/D141309
I tested this as much as I could locally -- hence the `dump`
workaround -- but I have no particular suggestion for how to test this
in automation. Even triggering the targeting snapshotting during
shutdown requires the timers and shutdown process to line up in a way
that's not trivial to guarantee.
Differential Revision: https://phabricator.services.mozilla.com/D154285
This is still one blind spot with privileged request done by content processes.
They aren't related to any BrowsingContext/WindowGlobal and there isn't any
attribute on channel/loadInfo which helps knowing they originates from a content process.
Differential Revision: https://phabricator.services.mozilla.com/D150014
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.
This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.
In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.
Differential Revision: https://phabricator.services.mozilla.com/D152682
This patch contains the bulk of the implementation of the modal. Most of
it is UI work and wiring together the various components. There is a bit
of complexity in the clustering algorithm, as I implemented the DBSCAN
algorithm to help cluster the text recognition results.
I filed Bug 1782586 to improve the DBSCAN algorithm, but currently it
works the same as the algorithm is described on Wikipedia.
Note that the tests are in the following patch in order to keep the line
count small for this patch.
Differential Revision: https://phabricator.services.mozilla.com/D153396