Open Bug 968799 Opened 11 years ago Updated 3 years ago

disallow already_AddRefed members in classes

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

People

(Reporter: froydnj, Unassigned)

References

(Depends on 1 open bug)

Details

The reason for doing this is that people should be making ownership more clear via .forget() and/or .swap() and/or similar. The plan for doing this is to mark already_AddRefed as MOZ_STACK_CLASS. This is almost airtight; the loopholes are: - having already_AddRefed members in a MOZ_STACK_CLASS; and - declaring already_AddRefed variables. Ideally these will not be a problem. (We don't seem to have any uses of either of these patterns in the tree.) I talked this over with jcranmer and he said that MOZ_STACK_CLASS seems good enough.
Depends on: 968800
Depends on: 968836
I don't think we should do this, as I said in https://bugzilla.mozilla.org/show_bug.cgi?id=968836#c2 already_AddRefed is less hazard than nsCOMPtr when dealing with threads
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.