Add isDefaultBrowserAsync() to nsIShellService and migrate callers
Categories
(Firefox :: Shell Integration, task)
Tracking
()
People
(Reporter: janv, Assigned: janv)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: leave-open)
Attachments
(13 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
nsIShellService::isDefaultBrowser() is currently synchronous. On Linux, checking the default browser may involve D-Bus, so calling it synchronously on the main thread can block Firefox.
As a first step towards making the Linux implementation truly asynchronous, add an isDefaultBrowserAsync() API to nsIShellService and migrate as many consumers as practical to use it.
Initially, the async implementation can simply call the existing synchronous implementation and resolve the returned value immediately. This keeps the behavior unchanged while allowing callers to be converted to an async API.
In a follow-up, the Linux implementation can move the potentially blocking work off the main thread so that D-Bus access no longer blocks Firefox UI.
This bug should also update affected tests and mocks to support the new async API.
This blocks the broader bug 2044186 for making D-Bus-related internal APIs asynchronous.
| Assignee | ||
Comment 1•11 days ago
|
||
Clean up nsGNOMEShellService::IsDefaultBrowser() in preparation for adding the
asynchronous implementation.
| Assignee | ||
Comment 2•11 days ago
|
||
Add an asynchronous variant of isDefaultBrowser() to nsIShellService and expose
it through ShellService as well.
For now, the platform implementations call the existing synchronous logic and
resolve the result immediately. This allows callers to migrate to the async API
before the Linux implementation is moved off the main thread.
| Assignee | ||
Comment 3•10 days ago
|
||
Use the asynchronous default-browser check when generating the Heartbeat
post-answer URL.
| Assignee | ||
Comment 4•10 days ago
|
||
Use the asynchronous default-browser check when collecting the Telemetry
environment settings.
Propagate the asynchronous operation through the settings update path.
| Assignee | ||
Comment 5•10 days ago
|
||
Use the asynchronous default-browser check when retrieving the default-browser
state in ClientEnvironmentBase.
Propagate the asynchronous operation to UsageReporting and its test.
| Assignee | ||
Updated•10 days ago
|
Comment 7•10 days ago
|
||
| bugherder | ||
| Assignee | ||
Comment 8•9 days ago
|
||
Make nsToolkitShellService provide the shared nsISupports implementation,
including reference counting and QueryInterface for nsIToolkitShellService.
Update the platform shell services to fully inherit that implementation and
document the IsDefaultBrowser() virtual hook in preparation for adding a shared
nsIShellService::isDefaultBrowserAsync() implementation.
Updated•8 days ago
|
Comment 10•8 days ago
|
||
| bugherder | ||
Comment 11•8 days ago
|
||
| bugherder | ||
Comment 12•7 days ago
|
||
Comment 13•6 days ago
|
||
| bugherder | ||
| Assignee | ||
Comment 14•3 days ago
|
||
Return early from _updateDefaultBrowser() before session restore, following
the pattern used by _updateSearchEngine(). Log ignored calls instead of
assigning null to isDefaultBrowser.
| Assignee | ||
Comment 15•3 days ago
|
||
The metric is recorded before session restore, when the default-browser value
is not yet available, and is not updated when the delayed check completes.
Move the Glean write into _updateDefaultBrowser() so it records the check’s
result after session restore. Add a test assertion that the metric contains a
boolean.
| Assignee | ||
Comment 16•3 days ago
|
||
The delayed default-browser test waits for search service initialization but
not for the default-browser check. It currently passes with the trivial async
implementation, but could become flaky when the check runs on a background
thread and takes longer.
Add a small async work tracker so the test can await both operations before
checking the telemetry environment. The helper can also support other async
work started by EnvironmentCache observers.
Comment 17•3 days ago
|
||
Comment 18•2 days ago
|
||
| bugherder | ||
Comment 19•2 days ago
|
||
| Assignee | ||
Comment 20•2 days ago
|
||
Use the asynchronous default-browser check when recording the result of the
set-to-default Spotlight.
| Assignee | ||
Comment 21•2 days ago
|
||
Use the asynchronous default-browser check when determining whether the
default-browser prompt should be shown.
| Assignee | ||
Comment 22•2 days ago
|
||
Use the asynchronous default-browser check when determining whether About
Welcome needs to set Firefox as the default browser.
Update the related About Welcome targeting tests to stub the asynchronous API.
Comment 23•2 days ago
|
||
| bugherder | ||
| Assignee | ||
Comment 24•1 day ago
|
||
Use the asynchronous default-browser check for the cached and uncached ASRouter
targeting attributes. Together with the preceding migrations, this removes
default-browser checks as a source of UI stalls during startup.
Update the related ASRouter tests to use and stub the asynchronous API.
Description
•