Bug 1656768 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

So the added test in D97763 fails while enabling fission. (succeeds while disabling fission)

I took a look into it and found:
1. While navigate/redirect from a normal(non-cross-origin-isolated) window to a cross-origin-isolated window, the top-level browsing context id for the window is changed. From another perspective, the top-level browsing context id changes after process switching in the same tab.
2. In non-fission mode, [SessionStorage data is copied through SessionStoreUtilis](https://searchfox.org/mozilla-central/rev/f081504642a115cb8236bea4d8250e5cb0f39b02/toolkit/components/sessionstore/SessionStoreUtils.cpp#1232). However, this function isn't called while enabling fission.

SessionStorage in a tab is preserved based on the top-level BrowsingContext id so that this wasn't completely fixed by bug 1654080 (since the top-level browsing context id has been changed after navigation). Also, note that Bug 1654080 makes decoupling SessionStorage preservation from session restore possible since SessionStorage is now syncing to the parent process frequently,  but we are not there yet. To achieve that, we still need to adjust some pieces of code in SessionStore.

To fix the issue here, I think I need one more patch that makes SessionStore be able to copy the SessionStorage to the right global even when fission is enabled (or copy the SessionStorage from the right global to the target window).

Another option is to somehow make a singleton on the parent process be able to maintain a hashmap that maps old top-level browsing context id and new top-level browsing context id in a tab. So that, in SessionStorageManager, we can copy the right SessionStorage data into the target content process.
So the added test in D97763 fails while enabling fission. (succeeds while disabling fission)

I took a look into it and found:
1. While navigate/redirect from a normal(non-cross-origin-isolated) window to a cross-origin-isolated window, the top-level browsing context id for the window is changed. From another perspective, the top-level browsing context id changes after process switching in the same tab.
2. In non-fission mode, [SessionStorage data is copied through SessionStoreUtilis](https://searchfox.org/mozilla-central/rev/f081504642a115cb8236bea4d8250e5cb0f39b02/toolkit/components/sessionstore/SessionStoreUtils.cpp#1232). However, this function isn't called while enabling fission.

SessionStorage in a tab is preserved based on the top-level BrowsingContext id so that this wasn't completely fixed by bug 1654080 (since the top-level browsing context id has been changed after navigation). Also, note that Bug 1654080 makes decoupling SessionStorage preservation from session restore possible since SessionStorage is now syncing to the parent process frequently,  but we are not there yet. To achieve that, we still need to adjust some pieces of code in SessionStore.

To fix the issue here, I think I need one more patch that makes SessionStore be able to copy the SessionStorage to the target global even when fission is enabled.

Another option is to somehow make a singleton on the parent process be able to maintain a hashmap that maps old top-level browsing context id and new top-level browsing context id in a tab. So that, in SessionStorageManager, we can copy the right SessionStorage data into the target content process.

Back to Bug 1656768 Comment 8