If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Eliminate nsCWeakReference

RESOLVED FIXED

Status

()

Core
Layout: Form Controls
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: Brian Ryner (not reading), Assigned: Brian Ryner (not reading))

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

14 years ago
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)
(Assignee)

Comment 1

14 years ago
Created attachment 138686 [details] [diff] [review]
patch

- 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.
(Assignee)

Comment 2

14 years ago
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+
(Assignee)

Comment 4

14 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.