Closed Bug 873111 Opened 11 years ago Closed 11 years ago

Move Note*Root methods out of nsCycleCollectionTraversalCallback into a new interface

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

NoteXPCOMRoot, NoteJSRoot and NoteNativeRoot are only used during the very beginning of CC graph building, namely when we add XPConnect roots and purple buffer roots.  Likewise, the other methods are only used later.

We can statically enforce this phase separation by creating a new callback interface that contains only the Note*Root methods (and possibly the various flag-related things), then remove the Note*Root fromnsCycleCollectionTraversalCallback.  Then just update the types and remove all of the useless Note*Root methods from the callback implementations that are not the CC itself.
Assignee: nobody → continuation
NoteWeakMap is another method that we can move over.

One annoyance I'm not sure how to deal with is that both the RootingCallback and the TraversalCallback need a WantAllTraces() method, and then the graph builder inherits from both.  I may take the cheesy approach and just use different field and method names for the two classes.
Attachment #750791 - Flags: review?(bugs)
Comment on attachment 750791 [details] [diff] [review]
split the interface

Could you use the normal coding style in nsCycleCollectionRootingCallback.h.
Foo* aParamName as params.

But nsCycleCollectionRootingCallback is odd. The ...Rooting... part of it.
We're not rooting anything, but noting about roots.
Maybe nsCycleCollectionRootTraversalCallback.
Attachment #750791 - Flags: review?(bugs) → review+
> We're not rooting anything, but noting about roots.
Yeah, I was just continuing the existing weird terminology.  I'll try to think about a better name.
Maybe I'll go with nsCycleCollectionNoteRootCallback.  That's a little shorter and a more literal description of what it does, though really it is just passing the buck.
https://hg.mozilla.org/mozilla-central/rev/286e34bb0bb8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Depends on: 875895
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: