Closed Bug 230480 Opened 21 years ago Closed 21 years ago

Eliminate nsCWeakReference

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

Attachments

(1 file)

There is an old weak reference implementation (i.e. not nsIWeakReference) called
nsCWeakReference, which is only used by nsListControlFrame.  It looks like this
really doesn't need to use a weak reference at all, since the frame can just
null out the event listener's back pointer from its destructor.  Patch coming up
(which will make the previous sentence make more sense)
Attached patch patchSplinter Review
- remove nsCWeakReference.*
- simplify the list control frame's event listener significantly by removing
the internal XPCOM interface and nulling out the frame pointer when the frame
goes away.
- stop making nsListControlFrame claim to implement nsIDOM*Listener, and only
forward the events the frame actually cares about to the frame.
Comment on attachment 138686 [details] [diff] [review]
patch

(if either if you want to r+sr, that would be good)
Attachment #138686 - Flags: superreview?(dbaron)
Attachment #138686 - Flags: review?(bz-vacation)
Comment on attachment 138686 [details] [diff] [review]
patch

r+sr=dbaron if you use nsRefPtr<nsListEventListener> mEventListener and
simplify the casts (you'll need a one-step cast to cast to nsIDOMMouseListener*
for the registration, and can remove the nsListEventListener* casts and the
cast of the result of new).  Or, alternatively, just remove the two two-step
casts that do nothing.	If you do the former, you may want to do separate
(one-step, since nsIDOMMouseListener* -> nsIDOMEventListener* happens
automatically) casts for the (Add|Remove)EventListenerByIID calls to pass the
right interface, although that apparently doesn't matter.
Attachment #138686 - Flags: superreview?(dbaron)
Attachment #138686 - Flags: superreview+
Attachment #138686 - Flags: review?(bz-vacation)
Attachment #138686 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: