There are two new lints introduced since IOUtils was written that we're hitting
now:
* IOUtils::InternalFileInfo's constructor does not initialize `mType`, `mSize`,
`mLastModified`, and `mPermissions`; and
* We should be using a nested namespace statement.
We haven't hit them since these lines haven't been touched, but I noticed them
on the code review frontend.
Differential Revision: https://phabricator.services.mozilla.com/D99163
There are two new lints introduced since IOUtils was written that we're hitting
now:
* IOUtils::InternalFileInfo's constructor does not initialize `mType`, `mSize`,
`mLastModified`, and `mPermissions`; and
* We should be using a nested namespace statement.
We haven't hit them since these lines haven't been touched, but I noticed them
on the code review frontend.
Differential Revision: https://phabricator.services.mozilla.com/D99163
Passing in a callable and its arguments to RunOnBackgroundThread was fine
before we started passing in already_AddRefed<nsIFile>. However, if we fail to
get an event target, then we drop all our arguments and in debug builds
already_AddRefed<T> asserts that it was moved out of.
Now we require callers of RunOnBackgroundThread to pass in a closure that
contains all the bindings they require, which has the added bonus of making
lifetimes more explicit. As part of this refactor, all the `ReadSync` etc
methods now take raw nsIFile* pointers since they are called in a scope that
has them refcounted.
Differential Revision: https://phabricator.services.mozilla.com/D98273
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.
With this change `:-moz-window-inactive` is now fission compatible.
Differential Revision: https://phabricator.services.mozilla.com/D86422
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.
With this change `:-moz-window-inactive` is now fission compatible.
Differential Revision: https://phabricator.services.mozilla.com/D86422
The nsFileOutputStream does all the error checking we were doing in WriteSync,
which we can now remove. PR_CloseDelete and all usages of raw PR file
descriptors can be also now be removed.
Additionally, the mode we were using for writing included `PR_WRONLY |
PR_TRUNCATE | PR_APPEND`, which makes the `PR_APPEND` redundant.
Differential Revision: https://phabricator.services.mozilla.com/D96146
`nsFileInputStream` does most of the same work we were doing manually to read
files and determine their size in `ReadSync`.
Differential Revision: https://phabricator.services.mozilla.com/D96144
`CreateDirectorySync` has also been renamed to `MakeDirectorySync` to mirror
all other `Fn` vs `FnSync` methods in IOUtils.
Differential Revision: https://phabricator.services.mozilla.com/D96140
We no longer normalize the paths in CopyOrMoveSync and instead rely on
nsIFile::{Copy,Move}ToFollowingLinks to provide path normalization.
Differential Revision: https://phabricator.services.mozilla.com/D96138
As part of cleaning up IOUtils, we can construct nsLocalFiles in
IOUtils::Read{,UTF8}, which has the benefit of doing more checks up front,
instead of waiting until we have passed work off to the background thread.
Once all methods pass nsIFile instances through to the background thread,
we can remove our own absolute path checking code.
Differential Revision: https://phabricator.services.mozilla.com/D96135
PathUtils is a path manipulation component to IOUtils, which is based on
simplified file I/O. This work is part of the larger goal of removing
osfile.jsm et al., ospath.jsm et al., and the entire OS.* namespace, especially
from the startup path.
No equivalent was provided for OS.Path.fromFileURI because it is unused.
Differential Revision: https://phabricator.services.mozilla.com/D95105
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045