Closed Bug 1702055 Opened 1 month ago Closed 9 days ago

Stop using ContentSessionStore.jsm for SessionStore:RestoreDocShellState

Categories

(Firefox :: Session Restore, task, P2)

task

Tracking

()

RESOLVED FIXED
90 Branch
Fission Milestone M7a
Tracking Status
firefox90 --- fixed

People

(Reporter: kashav, Assigned: kashav)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files, 1 obsolete file)

Blocks: 1700960

This should help avoid message ordering issues in the next patches. This also
moves all restore state on the CanonicalBrowsingContext into a separate
mRestoreState struct.

With the removal of the SessionStore:RestoreDocShellState message, the epoch
will no longer be updated otherwise, so we should include it in the Flush
message to ensure that messages are not being dropped.

Depends on D110333

This also makes it so that we will never fire SSTabRestored without first having
sent the associated SSTabRestoring event.

Depends on D110334

Attachment #9212661 - Attachment description: WIP: Bug 1702055 - Replace CallRestoreTabContentComplete with a dom::Promise, r?nika → Bug 1702055 - Replace CallRestoreTabContentComplete with a Promise, r?nika
Attachment #9212662 - Attachment description: WIP: Bug 1702055 - Ensure that ContentSessionStore's epoch is updated for tab flushes, r?nika → Bug 1702055 - Ensure that ContentSessionStore's epoch is updated for tab flushes, r?nika
Attachment #9212663 - Attachment description: WIP: Bug 1702055 - Move the "restore DocShell state" process out of ContentSessionStore.jsm, r?nika → Bug 1702055 - Move the "restore DocShell state" process out of ContentSessionStore.jsm, r?nika
Status: NEW → ASSIGNED
Fission Milestone: --- → M7a

With the new "restore docshell state" codepath, we may be calling
updateTabLabelAndIcon() later than we did before, which means we may have
already set the tab label (in tabbrowser.init()), and it's incorrect to override
that label value with the session history entry's title.

Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bffaa2c203b3
Replace CallRestoreTabContentComplete with a Promise, r=nika
https://hg.mozilla.org/integration/autoland/rev/b5f0638dcbc4
Ensure that ContentSessionStore's epoch is updated for tab flushes, r=nika
https://hg.mozilla.org/integration/autoland/rev/ff67df9befe5
Move the "restore DocShell state" process out of ContentSessionStore.jsm, r=nika
https://hg.mozilla.org/integration/autoland/rev/af21e2d8324e
Only call setInitialTabTitle() if the label hasn't yet been set, r=nika

Looks like it's relying on specific SSTabRestoring timing which changed. Will need to rework the patch a little.

Flags: needinfo?(kmadan)
Attachment #9212662 - Attachment description: Bug 1702055 - Ensure that ContentSessionStore's epoch is updated for tab flushes, r?nika → Bug 1702055 - Include the SessionStore epoch in "SessionStore:flush" messages, r?nika
Attachment #9212663 - Attachment description: Bug 1702055 - Move the "restore DocShell state" process out of ContentSessionStore.jsm, r?nika → Bug 1702055 - Move the "restore DocShell state" process out of ContentSessionStore, r?nika

A previous patch made it so we'd fire this after the full restore finished, but
some consumers expect this event prior to the completion of the load.

Depends on D110335

SessionStore factors both prefs into the decision about if a tab is restored
lazily, but this helper only uses the restore_tabs_lazily pref.

Depends on D114001

Blocks: 1709132
Attachment #9214742 - Attachment is obsolete: true
Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1540ce1bad6b
Replace CallRestoreTabContentComplete with a Promise, r=nika
https://hg.mozilla.org/integration/autoland/rev/41bb9b87829f
Include the SessionStore epoch in "SessionStore:flush" messages, r=nika
https://hg.mozilla.org/integration/autoland/rev/ebc0cf227611
Move the "restore DocShell state" process out of ContentSessionStore, r=nika
https://hg.mozilla.org/integration/autoland/rev/644c228d9125
Ensure SSTabRestoring is only fired once per browser, r=nika
https://hg.mozilla.org/integration/autoland/rev/20f44b561529
Fix how the expected SSTabRestored count is calculated in waitForBrowserState, r=nika
You need to log in before you can comment on or make changes to this bug.