Closed Bug 1645541 Opened 7 months ago Closed 7 months ago

Update browser's outerWindowID via the WindowGlobalParent rather than the Browser:Init message

Categories

(Toolkit :: XUL Widgets, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: enndeakin, Assigned: enndeakin)

References

Details

Attachments

(2 files)

The outerWindowID is already synced with the parent via WindowGlobalParent. Update the field in browser-custom-element.js to use this instead of using a separate message.

There are also some other listeners of Browser:Init:

  1. BrowserWindowTracker.jsm
  2. tabbrowser
  3. TargetList seems to think browser.browsingContext could be null and waits for Browser:Init. I'm not sure that's actually possible.

One additional note:

In tabbrowser.js, there is a map '_outerWindowIDBrowserMap' that maintains a map of content outer window ids to browser elements. This is updated via a message that is sent on each framescript load in the content process and a bunch of hard-to-follow places throughout tabbrowser.js.

However, it seems that there are only two consumers of this map:

  1. The Payments UI at [1] looks up the browser element by outer window id to determine which browser to associate the payments ui with. I suspect this UI isn't actually wanting to be dependent on the outer window id (which can be the same for entirely different pages), but would be page specific. However the payments code seems to pass around the outer window id throughout its code.

  2. about:devtools uses the map to determine which tab was last opened so that it can go back to it when closing about:devtools.

Since neither of these cases are particularly common, I just got rid of this map, and replaced it with just iterating over the tabs and comparing browser.outerWindowID to the desired window id on an as-needed basis.

Summary: Update browser's outerWindowID via the WindowGlobalParent rather than a message → Update browser's outerWindowID via the WindowGlobalParent rather than the Browser:Init message

The map is only used by payments and about:devtools.

Blocks: 1645633
Pushed by neil@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/758831c2e097
remove uncommonly used outerid to browser map and just iterate over the tabs instead, r=mconley
https://hg.mozilla.org/integration/autoland/rev/660432a1429d
use outerWindowId from the windowGlobal instead of using the Browser:Init message, Also makes the BrowserTab actor specific to the main browser, r=mconley,remote-protocol-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.