Closed Bug 2074386 Opened 2 months ago Closed 1 month ago

Type the window and browser handles SessionStore.sys.mjs passes around

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Several call sites hand a mozIDOMWindowProxy to a method taking a Window, a Window to one taking a ChromeWindow, an interface requestor without the cast to nsIInterfaceRequestor, an empty object where window state is expected, and a BrowsingContext read for properties its type doesn't declare. A few string and number mixups sit beside them: parseInt on a number, JSON.parse on a value that may already be parsed, and an undo_close trigger option the callee's option type doesn't list. Each is a local cast or a corrected annotation, and one or two may be real mismatches.

The module stays on the exclude list in browser/components/sessionstore/tsconfig.json until the last of the bugs splitting this work up takes it off.

Blocks: 2074388

This is behavior-neutral apart from the four no-op methods on SHistoryListener: nsSHistory calls OnHistoryTruncate, OnDocumentViewerEvicted, OnHistoryCommit and OnEntryUpdated on every listener, and each of those calls used to fail in XPConnect because the JS listener lacked the method.

resetBrowserToLazyState now stores a literal 0 for userTypedClear. Only lazy browsers have that property, and the function returns early for them, so the read always yielded the default. selectTab drops parseInt because the session schema declares selected an integer.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8bc3d39ec629 https://hg.mozilla.org/integration/autoland/rev/9bd935bc6e47 Type the window and browser handles in SessionStore.sys.mjs. r=Standard8,sfoster,sessionstore-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
QA Whiteboard: [qa-triage-done-c160/b159]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: