On Thu Aug 25 17:09:11 2022 +0000, Gabriel Iv��ncescu wrote:
The entry->num_keys check should keep it alive even with zero refcount, to preserve the data. I did it this way to remove spurious empty origins, in case there's a lot of navigation going on, and then there would be a lot of entries left behind until the thread shuts down for no reason. So it only gets removed when:
- No storage objects hold a ref to it, and
- There is no data stored for that origin.
Since an empty data for an origin is the same as it not having an entry at all, so we can safely remove it (as long as no objects hold a ref to it).
Ah, right, that's fine. (While we're at this, you don't need get_thread_data() error handling here; you know that it exists if session_storage_map_entry exists).