Closed Bug 1681009 Opened 4 years ago Closed 4 years ago

Replace idl nsIMutableArray usage with Array<T>

Categories

(MailNews Core :: General, task)

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: benc, Assigned: benc)

References

Details

Attachments

(2 files, 2 obsolete files)

This covers:
mailnews/search/public/nsIMsgFilter.idl
mailnews/search/public/nsIMsgSearchSession.idl
mailnews/base/public/nsIMsgDBView.idl
mailnews/extensions/mailviews/nsIMsgMailView.idl

https://searchfox.org/comm-central/search?q=nsIMutableArray&case=true&path=*.idl

Assignee: nobody → benc

The nsIMutableArray use in xpidl interfaces is especially problematic because it means that the caller can mutate the array at any time without the owner being aware of it. In practice, I only found one place which seemed to do that - saveSearchTerms. I'm not too happy with the fix I used there, but without having a bigger-picture view I don't have a feel for what would be the Right Thing(tm). So for now, it'll work and is slightly more explicit than what was already there.

Try run here:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=3f1f608aeb2283704ae5f5483b0e47fdd0bd7b6f

Attachment #9192248 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9192248 [details] [diff] [review] 1681009-remove-nsIMutableArray-use-1.patch Review of attachment 9192248 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. The suite/ changes are kind of not needed but I guess doesn't hurt either. ::: mailnews/base/src/VirtualFolderWrapper.jsm @@ +28,5 @@ > * @param aParentFolder The folder in which to create the search folder. > * @param aSearchFolders A list of nsIMsgFolders that you want to use as the > * sources for the virtual folder OR a string that is the already '|' > * delimited list of folder URIs to use. > + * @param {Array.<nsIMsgSearchTerms>} aSearchTerms - The search terms to @param {nsIMsgSearchTerms[]} ... I think is better. ::: mailnews/search/content/searchTerm.js @@ +512,5 @@ > } > > +/** > + * Save the search terms from the UI back to the actual search terms. > + * @param {Array.<nsIMsgSearchTerm>} searchTerms - Array of terms @param {nsIMsgSearchTerm[]}
Attachment #9192248 - Flags: review?(mkmelin+mozilla) → review+

(In reply to Magnus Melin [:mkmelin] from comment #2)

    • @param {Array.<nsIMsgSearchTerms>} aSearchTerms - The search terms to
      @param {nsIMsgSearchTerms[]}
      ... I think is better.

Ahh! Thanks - didn't know about that syntax. Much nicer.

Attachment #9192248 - Attachment is obsolete: true
Attachment #9192292 - Flags: review+

(oops - accidental comment)

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/4e7c4249e3b1
Remove nsIMutableArray use from nsIMsgMailView, nsIMsgFilter and nsIMsgSearchSession. r=mkmelin

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Attached patch patch (obsolete) — Splinter Review

Found an unused ref to spoil the stats ;)

Attachment #9195838 - Flags: review?(benc)
Attachment #9195838 - Attachment is obsolete: true
Attachment #9195838 - Flags: review?(benc)
Attachment #9195852 - Flags: review?(benc)
Comment on attachment 9195852 [details] [diff] [review] bug1681009_remove_stray_nsIMutableArray.patch Review of attachment 9195852 [details] [diff] [review]: ----------------------------------------------------------------- The one that got away :-) But not for long - thanks!
Attachment #9195852 - Flags: review?(benc) → review+

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/345c1cc51a98
remove stray nsIMutableArray reference in nsIMsgDBView.idl. r=benc

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: