Closed Bug 233481 Opened 22 years ago Closed 21 years ago

change nsAutoCompleteMdbResult to use nsCOMArray<nsIMdbRow> instead of nsVoidArray

Categories

(Firefox :: Address Bar, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: patrick, Assigned: patrick)

Details

(Whiteboard: fixed0.9)

Attachments

(1 file, 1 obsolete file)

This bug is inspired by bug 221484 and bug 233479. I noticed that the internal usage of MdbResult is a void array, so references to nsIMdbRow objects are not held. This seems dangerous; what if a row were to be deleted while the MdbResult was still in use? Coming up is a patch to change this from nsVoidArray to nsCOMArray<nsIMdbRow>. This removes all the static casts. Is there a reason why we are not refcounting these objects?
Attachment #140915 - Flags: review?(bryner)
Comment on attachment 140915 [details] [diff] [review] patch to remove casts in nsAutoCompleteMdbResult.cpp I can't find anything in the ownership model that would otherwise guarantee that the row pointers would remain valid, so r=me.
Attachment #140915 - Flags: review?(bryner) → review+
Attachment #140915 - Flags: superreview?(firefox)
Attachment #140915 - Flags: superreview?(firefox) → superreview+
Whiteboard: checkin0.9
patrick, this patch no longer applies cleanly, can you update to tip and attach an updated patch?
Whiteboard: checkin0.9
updated for changes to RemoveRowAt. builds cleanly for me on win32.
Attachment #140915 - Attachment is obsolete: true
Comment on attachment 149524 [details] [diff] [review] updated patch to remove casts in nsAutoCompleteMdbResult.cpp this is a tiny change (see GetRowAt) for this previously r+sr patch. I'm not sure if this even needs r+sr, but I'll ask just in case.
Attachment #149524 - Flags: superreview?(firefox)
Attachment #149524 - Flags: review?(firefox)
Comment on attachment 149524 [details] [diff] [review] updated patch to remove casts in nsAutoCompleteMdbResult.cpp not necessary in this case, the patch didn't change substantially, its just bitrot I'll check this in during my next batch of checkins.
Attachment #149524 - Flags: superreview?(firefox)
Attachment #149524 - Flags: review?(firefox)
Whiteboard: checkin0.9
fixed branch and trunk
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Whiteboard: checkin0.9 → fixed0.9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: