The first change we can make is to simplify the PrivacyLevel.canSave() method
itself as it only takes a single argument, `isHTTPS`. Callers shouldn't be
required to pass an object, they should simply pass a boolean.
The second change here is to cleanup SessionCookies.jsm that still passes the
old `isPinned` argument that's no longer needed. We can remove some house
keeping and simplify the cookie collection code.
SessionCookies.getHostsForWindow() that previously returned a map from hostnames
to a site's pinned status (tab.pinned) can now simply return a Set containing
all hostnames found in a window.
Since a LayoutHistoryState is basically just a collection of PresStates, we just save each PresState we can find and then later restore it.
MozReview-Commit-ID: A6WpdelseHn
When calling SessionHistory.collect(), we can indicate that we're not interested in the first N (where N = aFromIdx + 1) session history entries, with N potentially being a very big number if we don't want any SHEntries at all and are just interested in updating the value of the current history index.
Currently, we always serialise all available SHEntries and then throw away the first N entries, which is wasteful - instead, we should just skip them right away.
We still need to keep track how many entries we actually skipped and how many we could have collected if we wanted to, so
- we can correctly clamp data.index
- if we end up with no entries, figure out whether we simply skipped all of them or else need to create a fallback entry.
MozReview-Commit-ID: DjHnnhK0M9L
Life would easier if the restore function could return a reference to the session history object retrieved from the DocShell, so that Fennec's main session store code can use that to trigger the needed reload afterwards instead of having to retrieve it again independently.
MozReview-Commit-ID: 1J5k4Evbc8Y
We want to use this for Android, too. Once again, moving the file necessitates fixing a few ESLint errors that weren't yet checked for under the old directory.
MozReview-Commit-ID: IPxcizKwzAX
Currently, setting a file input element's value property in a content
process creates a File object that seems valid but causes form
submission to fail -- inexplicably so, from the user's point of view.
The next patch will make that throw, so this patch prepares SessionStore
by making it catch that exception and leave that element unrestored (but
continue with the rest of the form). The user would already have needed
to manually re-pick the file -- until bug 1122855 is fixed to make
SessionStore properly e10s-enabled -- but this makes that more obvious.