Open Bug 1357560 Opened 8 years ago Updated 4 months ago

Convert PRCList usage in nsGlobalWindow to LinkedList

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

People

(Reporter: erahm, Unassigned)

References

(Blocks 1 open bug)

Details

nsGlobalWindow inherits from PRCList [1] so that it can be held in a linked list. It would be nice to use mozilla::LinkedList instead, but the way nsGlobalWindow is designed makes this somewhat difficult as it can be an inner window or outer window. Basically the way things work is that an outer window is essentially a linked list (the thing that holds elements) and an inner window is a linked list element that is held in the outer window's linked list [2]. One option is to have nsGlobalWindow derive from LinkedListElement *and* also have a LinkedList member (probably mInnerWindows). This adds the overhead of an empty LinkedList to each inner window (~20 bytes on 64-bit), but it would make things a lot easier to understand. [1] http://searchfox.org/mozilla-central/rev/214345204f1e7d97abb571b7992b6deedb5ff98f/dom/base/nsGlobalWindow.h#268 [2] http://searchfox.org/mozilla-central/rev/214345204f1e7d97abb571b7992b6deedb5ff98f/dom/base/nsGlobalWindow.cpp#1579-1585
While we're at it we should make the comment describing the nsGlobalWindow's list behavior intelligible [1]. [1] http://searchfox.org/mozilla-central/rev/214345204f1e7d97abb571b7992b6deedb5ff98f/dom/base/nsGlobalWindow.h#241-249
Samael and Michael had some thoughts about splitting GlobalWindow into inner/outer. I am not sure how this bug is related with or working with that plan. Any comments to share, Samael or Michael? Thanks!
Flags: needinfo?(sawang)
Flags: needinfo?(michael)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #2) > Samael and Michael had some thoughts about splitting GlobalWindow into > inner/outer. I am not sure how this bug is related with or working with that > plan. Any comments to share, Samael or Michael? Thanks! khuey was working on this before he left mozilla. I'm not sure if there are any currently running efforts to split nsGlobalWindow into an inner and outer window to make them fully separate. However, it is something which we probably will want to do after the 57 timeframe.
Flags: needinfo?(michael)
I have an impression that the plan was to move outer window to docshell, and so nsGlobalWindow will be only for inner windows. If we do implement it in this way then it should be easier to handle the linked list stuff, but yup I don't think there's active effort on doing this.
Flags: needinfo?(sawang)
Priority: -- → P3
(In reply to Samael Wang [:freesamael] from comment #4) > I have an impression that the plan was to move outer window to docshell, and > so nsGlobalWindow will be only for inner windows. If we do implement it in > this way then it should be easier to handle the linked list stuff, but yup I > don't think there's active effort on doing this. I believe the plan was to first split them into two classes, and then merge outer window into docshell. Doing it all at once would be a truly monumental effort.
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.