This builds on D188681 and adds a new `BaseFeature` called `SuggestBackendRust`.
When `quickSuggestRustEnabled` is true, `UrlbarProviderQuickSuggest` will use
`SuggestBackendRust` to fetch remote settings suggestions; otherwise it will use
`SuggestBackendJs`.
The Rust component is already integrated into desktop Firefox (bug 1851256, bug
1851845), and it's exposed to JS via `RustSuggest.sys.mjs`. Currently it only
supports AMP (sponsored, a.k.a. adM) and Wikipedia (non-sponsored) suggestions.
It's possible to configure the path of the Sqlite file created by the Rust
component. This patch uses `suggest.sqlite` in the user's local profile (cache)
directory.
This is only the initial integration. I can think of a few follow-ups:
* Handle icons. In this patch, results from `SuggestBackendRust` don't have
icons at all. I have a WIP.
* Handle ingestion better. "Ingest" here means Firefox must tell the Rust
component to re-fetch suggestions from remote settings and rebuild its Sqlite
database. Unfortunately the Rust component doesn't keep the data updated by
itself, so we'll need to periodically tell the component to ingest. This patch
performs ingestion every time `SuggestBackendRust` is (re)enabled, which is a
good enough start.
* Maybe handle tests better. For now I modified the main quick suggest unit
test, test_quicksuggest.js, so it tests both backends. Other tests should
maybe be updated too, I'm not sure yet.
Depends on D188681
Differential Revision: https://phabricator.services.mozilla.com/D188684
In order to use the same implementation between regular script and module script,
convert PromiseWorker.js into a template, which is processed by GeneratePromiseWorkerScript.py.
Differential Revision: https://phabricator.services.mozilla.com/D184282
Subtle things:
* We now have shadow trees in NAC, inception! Only a couple lines of
code in the style system had to be changed to match :host rules and
so properly.
* Had to make highlighters.css contentaccessible, because otherwise we
can't load it from the shadow tree. I don't think it's a big deal.
* I removed some of the code from highlighters.css that claimed that
stuff inherited from the html element. That's just no longer true.
* Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
This is needed because CSSOM from chrome code bypasses CSP (as
AnonymousContent did), but setAttribute() doesn't, see bug 1424474.
Differential Revision: https://phabricator.services.mozilla.com/D173998
* Adds a shopping component in toolkit.
* Creates a ShoppingProduct client to handle fetching and validating Products from the Shopping APIs.
* Product config allows updating the shopping sites list and product id regex for each site.
* Creates JSON schemas for validating the API responses.
Differential Revision: https://phabricator.services.mozilla.com/D180978
* For now, make page available via chrome://browser/content/shopping/shopping.html .
* Includes preview ftl file and proof-of-concept working localization of
the page title.
Differential Revision: https://phabricator.services.mozilla.com/D180487
This patch was generated as follows:
Run:
`./mach esmify --imports . --prefix=toolkit/mozapps/extensions/AddonManager`
In the output there are linter/prettifier errors due to unused
XPCOMUtils or separate importESModule calls. These have been fixed
manually and verified with `./mach lint --outgoing`.
The `esmify` script also inserts many unwanted newlines around imports
that are broken on two lines due to length. Due to the number of these,
I fixed them programatically.
1. Create patch from the changes so far.
2. From the patch, delete all lines that consist of "+" (i.e. added blank line).
3. Reset the working dir and apply the revised patch.
4. Verify that the diff between step 1 and 3 looks reasonable.
5. Verify that this patch as a whole looks reasonable.
Commands:
```
git diff > rename.diff
:%g/^+$/d
git commit -va -m WIP-rename
git revert HEAD
git apply --recount rename.diff
git diff HEAD^ # and verify that the removed lines are ok.
git commit -va # one last review to verify correctness of whole patch.
git rebase -i HEAD~3 # drop the WIP + reverted commit, pick only the last.
```
`git apply` has the `--recount` option to force it to ignore mismatches
in line counts, which happens because we deleted added lines (^+$)
without fixing up the line counts in the file headers.
Differential Revision: https://phabricator.services.mozilla.com/D179874
Ran the following:
`./mach esmify --convert toolkit/mozapps/extensions/AddonManager.jsm`
and manually fixed the AsyncShutdown import by renaming it and declaring
a new var, because `AddonManagerPrivate.overrideAsyncShutdown` relies on
it being non-const.
Differential Revision: https://phabricator.services.mozilla.com/D179866
This patch removes the vast majority of OS.File and support code. A few things remain:
- The nsIOSFileConstantsService still exists, but the path related constants
(OS.Constants.Path.*) are no longer added to the OS object. The plan is to
replace this with a proper service e.g. Services.osConstants or similar) in
bug 1786885.
- There is still support for OS.File errors in ErrorSanitizer, which will be
removed in bug 1775167.
- The OS.File to IOUtils migration guide will be rewritten as general IOUtils
documentation in bug 1830097.
- dom/base/Document.cpp has a workaround for not loading osfile.jsm at startup,
which may want to be reconsidered in bug 1830100.
So long, and thanks for all the I/O.
Differential Revision: https://phabricator.services.mozilla.com/D176543
This patch removes the vast majority of OS.File and support code. A few things remain:
- The nsIOSFileConstantsService still exists, but the path related constants
(OS.Constants.Path.*) are no longer added to the OS object. The plan is to
replace this with a proper service e.g. Services.osConstants or similar) in
bug 1786885.
- There is still support for OS.File errors in ErrorSanitizer, which will be
removed in bug 1775167.
- The OS.File to IOUtils migration guide will be rewritten as general IOUtils
documentation in bug 1830097.
- dom/base/Document.cpp has a workaround for not loading osfile.jsm at startup,
which may want to be reconsidered in bug 1830100.
So long, and thanks for all the I/O.
Differential Revision: https://phabricator.services.mozilla.com/D176543