Re: [whatwg/storage] Session storage and changing browsing contexts (#119)

Firefox's SessionStorage implementation currently assumes only a single content process (akin to renderer) will actively be using the storage for a given (Top level browsing context (session) id, origin) tuple.  It's expected and handled that as history is traversed that this will result in this notional active process changing.  In the event the concurrent access assumption is violated, each content process will effectively fork the state on first SessionStorage access and live in their own universes, never to perceive the canonical state that a new content process would see.

If needed, this could instead be made to converge with the current LocalStorage NextGen implementation wherein multiple processes can access the same data with a consistent snapshot established for the duration of a task the first time LS is accessed within an task, with atomic write-back of any deltas occurring at the end of the task.  In the event of a race, mutation batches will stack and all processes will perceive the canonical state during the next task.  Sync-ish IPC is sadly involved.

In general it would be nice if the single content/renderer process invariant can be maintained.  Which maybe is to say that a SessionStorage storage bottle can only be accessed from one agent cluster at a time?  In cases where that would be violated, we must clone/copy/stick-in-the-replicator the bottle or create a new empty bottle.  It sounds like that's what's being proposed here?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/storage/issues/119#issuecomment-770092871

Received on Friday, 29 January 2021 22:55:09 UTC