Bug 1766240 Comment 6 Edit History

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

While implementing this command, I first went with the approach of forwarding the command to a child process and returning the information of the realms, cached there. For the case when browsing context is not provided, it would mean getting all the browsing contexts and forwarding commands to each one of them.
Then I had a look at https://bugzilla.mozilla.org/show_bug.cgi?id=1779231. Here we would need to get browsing context for a specified `realmId` that means that most likely we would need to have in the parent process a map between at least `realmId` and `contextId`, but we could of course store also all other required realm information. That could mean that when `getRealms` is called, we can just return this map. The only problem is, that we would not have realms stored which were not used for script evaluation. (We also could have already destroyed realms)
The next thought would be that ideally we should listen to `script.realmCreated` and `script.realmDestroyed` events to build realm info map. Then it can be safely used to return it when `getRealms` is called or if `evaluate` or `callFunction` is called with `realmId` and we have to find an associated browsing context.
So it looks like it would be better to block this bug at least on https://bugzilla.mozilla.org/show_bug.cgi?id=1788657.
While implementing this command, I first went with the approach of forwarding the command to a child process and returning the information of the realms, cached there. For the case when browsing context is not provided, it would mean getting all the browsing contexts and forwarding commands to each one of them.
Then I had a look at bug 1779231. Here we would need to get browsing context for a specified `realmId` that means that most likely we would need to have in the parent process a map between at least `realmId` and `contextId`, but we could of course store also all other required realm information. That could mean that when `getRealms` is called, we can just return this map. The only problem is, that we would not have realms stored which were not used for script evaluation. (We also could have already destroyed realms)
The next thought would be that ideally we should listen to `script.realmCreated` and `script.realmDestroyed` events to build realm info map. Then it can be safely used to return it when `getRealms` is called or if `evaluate` or `callFunction` is called with `realmId` and we have to find an associated browsing context.
So it looks like it would be better to block this bug at least on bug 1788657.

Back to Bug 1766240 Comment 6