A quirk of the JavaScript implementation of XPCOM's QueryInterface is that it loads the interface's functions onto the queried object. For Services like `ShellService` this creates situations where the interface can be initialized at a distance, causing races depending on how Firefox is run - e.g. Desktop vs Background Task. To ensure consistent behavior this patch forces `ShellService` initialization of the native interface so that the native functions are always present.
To accomplish this, `nsIWindowsShellService` has been modified to inherit from `nsIShellService` to match other platforms and ensure that querying it also loads the `nsIShellService` members into `shellService`.
Differential Revision: https://phabricator.services.mozilla.com/D222154
This succeeds in normal Firefox due to `QueryInterface(Ci.nsIWindowsShellService)` having likely been called on the `nsIShellService` prior to this call, which populates the root `nsIShellService` JavaScript object with the queried interface methods. In Firefox Background Tasks the relevant `QueryInterface` is unlikely to be called ahead of time, resulting in an exception.
Differential Revision: https://phabricator.services.mozilla.com/D221540
Currently the windows client sends the current process command line which is
potentially an issue since some of those arguments may have been consumed
already. It will also not support sending custom command lines after startup.
This also switches to sending the UTF-8 command line we already have since that
matches other platforms better and makes some arguments const.
Differential Revision: https://phabricator.services.mozilla.com/D216031
Currently the windows client sends the current process command line which is
potentially an issue since some of those arguments may have been consumed
already. It will also not support sending custom command lines after startup.
This also switches to sending the UTF-8 command line we already have since that
matches other platforms better and makes some arguments const.
Differential Revision: https://phabricator.services.mozilla.com/D216031
- Remove redundant check for `regRename` pref when deciding whether to show set default guidance notification
- Update guidance notification test helper to set `setDefaultBrowserUserChoice` to the same value as `...regRename` to make tests that include one-click being enabled more accurate.
These updates should not change the user experience.
Differential Revision: https://phabricator.services.mozilla.com/D215218
- Remove redundant check for `regRename` pref when deciding whether to show set default guidance notification
- Update guidance notification test helper to set `setDefaultBrowserUserChoice` to the same value as `...regRename` to make tests that include one-click being enabled more accurate.
These updates should not change the user experience.
Differential Revision: https://phabricator.services.mozilla.com/D215218
The enrollmentHelper was much more complicated than it needed to be. The
internal asynchrony that required awaiting an additional promise was fixed in
bug 1773583.
The returned cleanup function is no longer async, so unnecessary awaits have
been removed. This also applies to enrollWithFeatureConfig, as it is a wrapper
around enrollmentHelper.
Differential Revision: https://phabricator.services.mozilla.com/D212318
enrollWithRollout skipped all enrollment logic in ExperimentManager.enroll by
calling ExperimentStore.addEnrollment directly. This prevents prefs being set
by Nimbus correctly when enrolling. enrollWithFeatureConfig already supports
enrolling as a rollout, so all uses of enrollWithRollout have been replaced.
Differential Revision: https://phabricator.services.mozilla.com/D209936
enrollWithRollout skipped all enrollment logic in ExperimentManager.enroll by
calling ExperimentStore.addEnrollment directly. This prevents prefs being set
by Nimbus correctly when enrolling. enrollWithFeatureConfig already supports
enrolling as a rollout, so all uses of enrollWithRollout have been replaced.
Differential Revision: https://phabricator.services.mozilla.com/D209936