Closed Bug 1946569 Opened 9 months ago Closed 9 months ago

Wait for New Tab built-in addon to be enabled before allowing navigations to about:home and about:newtab to complete

Categories

(Firefox :: New Tab Page, task)

task

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert, Whiteboard: [hnt-trainhop])

Attachments

(3 files)

Normally, a known built-in addon is initialized very quickly during startup. There is, however, a race here - the initialization of the New Tab built-in addon via the AddonManager is async, and requests to load about:home / about:newtab may arrive before that initialization completes.

We need to solve this. I've been talking to valentin, and it might be possible to suspend the nsIChannel's for about:newtab / about:home until the addon is enabled.

The following details are likely useful to inform plans around this:

The internals described above have been introduced by Bug 1518863 - Blank new tab page displayed on start when an add-on controls the new tab page (due to race between page load and extension startup) to fix a race between Firefox starting up and trying to load a WebExtensions provided new tab page and the extension providing that new tab page starting up, and so it should be relevant and useful also for a buil-in addon provided new tab page..

This implementation of nsIChannel wraps an inner nsIChannel, and blocks all
calls to asyncOpen until allowAsyncOpen is called on the nsISuspendedChannel.

Assignee: nobody → mconley
Status: NEW → ASSIGNED
Depends on: 1938456

This uses the SharedData map to signal to the privileged about content process
that the New Tab built-in addon has initialized. I chose the SharedData map
because it has a pre-existing synchronization mechanism between processes,
and the value that it writes will not need to get refreshed in the event
that the privileged about content process crashes and needs to be respawned.

Attachment #9465272 - Attachment description: Bug 1946569 - Part 1: Create nsISuspendedChannel and implementation. r?valentin! → Bug 1946569 - Part 1: Create nsISuspendableChannelWrapper and implementation. r?valentin!
Attachment #9465274 - Attachment description: Bug 1946569 - Part 2: Split out handling for about:newtab and about:home to a separate nsIAboutModule. r?pdahiya!,Mossop!,#home-newtab-reviewers! → Bug 1946569 - Part 2: Split out handling for about:newtab and about:home to a separate nsIAboutModule, replacing nsIAboutNewTabService. r?pdahiya!,Mossop!,#home-newtab-reviewers!
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8e6bd9219aac Part 1: Create nsISuspendableChannelWrapper and implementation. r=valentin,necko-reviewers https://hg.mozilla.org/integration/autoland/rev/1c7217d8e6fb Part 2: Split out handling for about:newtab and about:home to a separate nsIAboutModule, replacing nsIAboutNewTabService. r=pdahiya,mossop,home-newtab-reviewers,omc-reviewers,chumphreys,thecount https://hg.mozilla.org/integration/autoland/rev/23c635dd5036 Part 3: Suspend all about:newtab or about:home channels until the built-in addon is ready. r=thecount,pdahiya,home-newtab-reviewers,willdurand
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch

(In reply to Pulsebot from comment #5)

Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e6bd9219aac
Part 1: Create nsISuspendableChannelWrapper and implementation.
r=valentin,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/1c7217d8e6fb
Part 2: Split out handling for about:newtab and about:home to a separate
nsIAboutModule, replacing nsIAboutNewTabService.
r=pdahiya,mossop,home-newtab-reviewers,omc-reviewers,chumphreys,thecount
https://hg.mozilla.org/integration/autoland/rev/23c635dd5036
Part 3: Suspend all about:newtab or about:home channels until the built-in
addon is ready. r=thecount,pdahiya,home-newtab-reviewers,willdurand

Perfherder has detected a browsertime performance change from push 23c635dd50363b9897e7458f19a9435bcf9cff7d.

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
6% welcome loadtime windows11-64-24h2-shippable cold fission webrender 37.93 -> 35.77 Before/After
5% welcome fcp windows11-64-24h2-shippable cold fission webrender 73.07 -> 69.64 Before/After

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 44272

For more information on performance sheriffing please see our FAQ.

Keywords: perf-alert
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: