Closed Bug 1700963 Opened 4 years ago Closed 4 years ago

[SHIP] Stop relying on ContentSessionStore.jsm for the SessionStore history listener

Categories

(Firefox :: Session Restore, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Fission Milestone M7a
Tracking Status
firefox89 --- fixed

People

(Reporter: u608768, Assigned: u608768)

References

Details

Attachments

(3 files, 1 obsolete file)

Summary: Stop relying on ContentSessionStore.jsm for the SessionStore history listener → [SHIP] Stop relying on ContentSessionStore.jsm for the SessionStore history listener
Attached file Bug 1700963 - WIP remove disablehistory (obsolete) (deleted) —

The reasoning behind this change is as follows:

  1. For remote="true" browsers, the disablehistory attribute was already
    always ignored, as we'd always create session history. This means
    that the PaymentUIService consumer was already a no-op before this
    patch.

  2. For non-content browsers, such as those in preferences.xhtml and
    browser.xhtml this was also already a no-op, as we'd only create
    session history for toplevel content browsers, so removing the
    attribute there should be a no-op.

  3. This leaves only tests which both use the attribute and have
    type="content" specified. Some manual local testing suggested that
    neither of the modified tests broke with the attribute removed.

After this change, SessionHistory will always be initialized for
toplevel content BrowsingContext instances as they are connected, which
should simplify logic such as the logic in this bug to attach to the
session history instance.

Attachment #9211556 - Attachment is obsolete: true

This does a few things:

  1. Tracks SHistoryListeners with BrowsingContext::BrowserId instead of the
    browser's permanentKey.
  2. Gets rid of the listener's _sHistoryChanges property, which is possible
    because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
  3. Simplifies the code that interacts with SHistoryListener in
    UpdateSessionStoreFromTablistener, and attempts to make that function a
    little more readable.

We now create the listener after receiving a "window-global-created" and destroy
it after receiving "browsing-context-discarded".

Depends on D110336

Attachment #9212664 - Attachment description: WIP: Bug 1700963 - Clean up SessionStore's SHistoryListener, r?nika → Bug 1700963 - Clean up SessionStore's SHistoryListener, r?nika
Attachment #9212665 - Attachment description: WIP: Bug 1700963 - Stop relying on the "AddSHistoryListener" frame script message, r?nika → Bug 1700963 - Stop relying on the "SessionStore:addSHistoryListener" message, r?nika
Severity: -- → S3
Fission Milestone: --- → M7a
Priority: -- → P1

Depends on D110336

Pushed by kmadan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b922e4f612b Clean up SessionStore's SHistoryListener, r=nika https://hg.mozilla.org/integration/autoland/rev/fbafd75b06d3 Add a "browsing-context-did-set-embedder" observer notification, r=nika https://hg.mozilla.org/integration/autoland/rev/cda35e554327 Stop relying on the "SessionStore:addSHistoryListener" message, r=nika

Looks like the cases where we now throw errors are more common than I had thought. Handling those cases more gracefully appears to fix things.

Flags: needinfo?(kmadan)
Pushed by kmadan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39820d01e6ab Clean up SessionStore's SHistoryListener, r=nika https://hg.mozilla.org/integration/autoland/rev/3c654e8a366a Add a "browsing-context-did-set-embedder" observer notification, r=nika https://hg.mozilla.org/integration/autoland/rev/833295fd0979 Stop relying on the "SessionStore:addSHistoryListener" message, r=nika

We were also attempting to collect history in the parent for non-SHIP, which was part of the reason for the non-fission failures.

Regressions: 1705547
Regressions: 1707970
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: