Closed Bug 1312144 Opened 8 years ago Closed 8 years ago

Remove nsISupportsArray usage from xpfe

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: erahm, Assigned: erahm)

References

Details

Attachments

(2 files)

nsISupportsArray is deprecated. We shoudl switch usage in xpfe over to nsIMutableArray. Filing in xpcom as we're just switching types and I couldn't find an xpfe component.

MozReview-Commit-ID: JT585Zg4iJY
Attachment #8803577 - Flags: review?(nfroyd)
This swaps out nsIMutableArray for nsISupportsArray.

MozReview-Commit-ID: 9iZynpMcq6A
Attachment #8803578 - Flags: review?(nfroyd)
Comment on attachment 8803577 [details] [diff] [review]
Part 0: Cleanup formatting

Review of attachment 8803577 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me; the diff is pretty unreadable. :(

::: xpfe/components/directory/nsDirectoryViewer.cpp
@@ +911,5 @@
>  nsHTTPIndex::FireTimer(nsITimer* aTimer, void* aClosure)
>  {
>    nsHTTPIndex *httpIndex = static_cast<nsHTTPIndex *>(aClosure);
> +  if (!httpIndex)
> +    return;

If we're going to change it, we might as well add braces.  Or are you trying to stick with local style here?
Attachment #8803577 - Flags: review?(nfroyd) → review+
Comment on attachment 8803578 [details] [diff] [review]
Part 1: Stop using nsISupportsArray in nsDirectoryViewer

Review of attachment 8803578 [details] [diff] [review]:
-----------------------------------------------------------------

I feel like these should really be nsCOMArray<nsIRDFResource>, but whatever.
Attachment #8803578 - Flags: review?(nfroyd) → review+
(In reply to Nathan Froyd [:froydnj] from comment #3)
> Comment on attachment 8803577 [details] [diff] [review]
> Part 0: Cleanup formatting
> 
> Review of attachment 8803577 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> rs=me; the diff is pretty unreadable. :(
> 
> ::: xpfe/components/directory/nsDirectoryViewer.cpp
> @@ +911,5 @@
> >  nsHTTPIndex::FireTimer(nsITimer* aTimer, void* aClosure)
> >  {
> >    nsHTTPIndex *httpIndex = static_cast<nsHTTPIndex *>(aClosure);
> > +  if (!httpIndex)
> > +    return;
> 
> If we're going to change it, we might as well add braces.  Or are you trying
> to stick with local style here?

More or less sticking with the style, the cleanup was basically highlighting to function in vim and hitting '=' (reindent selection). Then I broke the ifs onto newlines.
(In reply to Nathan Froyd [:froydnj] from comment #4)
> Comment on attachment 8803578 [details] [diff] [review]
> Part 1: Stop using nsISupportsArray in nsDirectoryViewer
> 
> Review of attachment 8803578 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I feel like these should really be nsCOMArray<nsIRDFResource>, but whatever.

My sentiments exactly. I don't think it's worth the effort to change this code too much (and there's logic that seems to count on the array itself being nullptr, so it'd have to be a nsCOMArray*).
https://hg.mozilla.org/integration/mozilla-inbound/rev/70280cfa7c118cf4bd686b55ece44534d3128d5b
Bug 1312144 - Part 0: Cleanup formatting. r=froydnj

https://hg.mozilla.org/integration/mozilla-inbound/rev/3eb7745dd704c2596eea71a2da5a08695828e012
Bug 1312144 - Part 1: Stop using nsISupportsArray in nsDirectoryViewer. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/70280cfa7c11
https://hg.mozilla.org/mozilla-central/rev/3eb7745dd704
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: