`SyncRunnable`'s helper functions take an `nsIRunnable *`; but the most
common way of building nsIRunnables, `NS_NewRunnableFunction`, returns
an `already_AddRefed<nsIRunnable>` instead. Add two new overloads of the
helper functions to eliminate the impedance mismatch.
(This does result in an uncomfortable amount of code duplication. While
we could eliminate that with appropriate use of SFINAE, it'll be simpler
if we wait for C++20 and its `requires` keyword.)
Additionally, add two explicitly-deleted overloads to catch and prevent
a previously-common antipattern that presumably resulted from this type
mismatch: accidentally wrapping the actual runnable in two layers of
`SyncRunnable`. Fix the former use-sites appropriately. (This was
probably harmless, but is also probably best avoided.)
No functional changes. This is in some sense a continuation of bug
1281626.
(This is no longer actually relevant to bug 1772908 due to a different
approach being taken. It remains in the patchset anyway, for
simplicity's sake.)
Differential Revision: https://phabricator.services.mozilla.com/D157131
This patch adds two parametrized tests (totalling 18 tests) for the perf selector. The first set of 15 tests are for testing the category expansions under different configurations. The last 3 tests are for testing the run methods in the three configurations that we offer: standard, dry runs, and uncategorized test selection (or --show-all).
Depends on D160418
Differential Revision: https://phabricator.services.mozilla.com/D160419
This patch adds the run methods for the perf selector as well as the entry point for the mach command. It also produces the Perfherder URL at the end.
Depends on D160417
Differential Revision: https://phabricator.services.mozilla.com/D160418
This patch adds a method that allows us to push to try. It performs two pushes similar to the compare selector, except in this case we're also capturing the logs in all cases so that we can provide a Perfherder URL afterwards. At the same time, this patch adds a LogProcessor that can capture these logs and parse them for the revisions.
Depends on D160416
Differential Revision: https://phabricator.services.mozilla.com/D160417
This patch adds two methods for getting/selecting tasks. The first one (get_tasks) is used to either query fzf directly, or to use interactively for user selections. The second (get_perf_tasks) makes use of the first to query for categories (through the user) and then query for the selected tasks. It also performs all the necesary intersections/unions for the queries.
These two are separated because we need a simple way to allow the user to look and select the raw tasks instead of categories if needed. This way the user can still get a comparison link at the end instead of going to `mcah try fuzzy`. See the next patches.
Depends on D160414
Differential Revision: https://phabricator.services.mozilla.com/D160415
This patch adds a method for expanding the categories. This method takes all the configuration details from the PerfParser (variants, apps, platforms, etc.) and combines them to create the categories that people will be seeing and selecting from. It creates the queries, and checks for any restrictions among them to provide selections that work. See the method for more details on all of this.
Depends on D160413
Differential Revision: https://phabricator.services.mozilla.com/D160414
This patch adds the basics for the perf selector: file, categorizations, selector configuration, and CLI arguments.
Depends on D155980
Differential Revision: https://phabricator.services.mozilla.com/D160413
This patch adds a `capture_log` flag that will allow a user to capture the logs produced when running the `push_to_try` methods. Currently, we use `subprocess.check_call` which causes hg to hang when we attempt to redirect and gather stdout. Using `subprocess.run` is better as it lets us capture the logs, but the log output is very slow and can easily lead people to believe that hg is hanging when it's not. This results in corrupted repos. Using Popen, the logs are output slower than `check_call`, but faster than `run` so you know something is happening. The speed at which these logs are printed is also why I have this log capturing behind a flag.
This functionality will be used in the `./mach try perf` selector to capture the child revisions produced for the try task config file changes and allow us to produce a PerfCompare link to provide the user.
Differential Revision: https://phabricator.services.mozilla.com/D155980
We can't test source-map package performance yet as it isn't exposed
and only loaded within a webpack bundle.
But it would be nice to also cover the code on top of the source-map package,
the "source map loader".
Differential Revision: https://phabricator.services.mozilla.com/D160199
Third-party's exoplayer2 path is changed to mobile/android/exoplayer2 by
bug 1745246. So we should update ThirdPartyPaths.txt too.
Differential Revision: https://phabricator.services.mozilla.com/D160999
This does the following:
* Moves quick suggest initialization from UrlbarQuickSuggest to QuickSuggest
* Renames UrlbarQuickSuggest.sys.mjs to QuickSuggestRemoteSettingsClient.sys.mjs, so now this file is focused only on remote settings
* Makes QuickSuggest create an instance of QuickSuggestRemoteSettingsClient and keep it as `QuickSuggest.remoteSettings`
* Moves latency telemetry from UrlbarProviderQuickSuggest into QuickSuggestRemoteSettingsClient
* Changes the ad hoc logger used in QuickSuggestRemoteSettingsClient to a proper urlbar-style logger
* Updates consumers to use `QuickSuggest.remoteSettings` instead of UrlbarQuickSuggest
Please see bug 1798595 for details.
Depends on D160985
Differential Revision: https://phabricator.services.mozilla.com/D160986
Since in D159582, the original HttpChannelChild/HttpChannelParent is reused instead of creating a new one. We need to clean up the StreamFilters which are already attached.
In original logic, this would be handled when StreamFilterParent::OnStartRequest is called(). By comparing the stored StreamFilterParent::mChannel and nsIRequest passed into StreamFilterParent::OnStartRequest, StreamFilterParent can know if the redirection happens or not, such that StreamFilterParent can decide should disconnect or not in OnStartRequest(). However, after D159582, since HttpChannelChild is reused, the logic would not work for ServiceWorker fallback redirection.
Opening the new nsHttpChannel in the parent process makes StreamFilters be attached to the original HttpChannelChild again, and it would send duplicate messages (OnStartRequest, OnDataAvailable, OnStopRequest) to the extension. So we need to remove the previous attached StreamFilters before opening the new channel.
In this patch, we introduce a new IPC method PHttpBackgroundChannel::DetachStreamFilters to inform the corresponding HttpChannelChild to disconnect StreamFilters. Unfortunately this introduces that HttpChannelChild needs to keep weak references of StreamFilters since we have no way to traverse the HttpChannelChild's listener chain and do special handling in StreamFilterParent only.
Depends on D159582
Differential Revision: https://phabricator.services.mozilla.com/D160203
This upgrades the minimum node version to 14, as 12.x is out of support.
This also means we can start to use optional chaining in the plugin code - so I've taken a quick look through and used it in a few instances where it makes sense to.
Differential Revision: https://phabricator.services.mozilla.com/D159493
This patch moves the fzf utility methods to a separate file so that they can be used by other try choosers such as the perf chooser. At the same time, helper methods for two aspects of the `mach try fuzzy` run method (setting up the tasks, and building the base command) are added but the code in the run method is left untouched.
Differential Revision: https://phabricator.services.mozilla.com/D159585