Last Comment Bug 394166 - Remove Utility Function usage, create using XPCOM in mailnews
: Remove Utility Function usage, create using XPCOM in mailnews
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Nick Kreeger
:
Mentors:
http://developer.mozilla.org/en/docs/...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-29 07:24 PDT by Nick Kreeger
Modified: 2012-12-06 11:12 PST (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
IMAP Fix V1 (15.14 KB, patch)
2007-12-07 15:48 PST, Nick Kreeger
mozilla: superreview+
Details | Diff | Splinter Review
Checkin Patch Version [Checked In] (15.05 KB, patch)
2007-12-21 17:02 PST, Nick Kreeger
no flags Details | Diff | Splinter Review

Description Nick Kreeger 2007-08-29 07:24:15 PDT
To help with the push to frozen linkage, mailnews needs to get rid of utility function calls for creating objects.

For example, there are many occurrences of |NS_NewISupportsArray|. Instead we should be using |do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID)|.

I suppose the best way to tackle this it to do it the same way we did the |nsXPIDL*| string removal, one at a time.
Comment 1 Nick Kreeger 2007-12-07 15:48:37 PST
Created attachment 292162 [details] [diff] [review]
IMAP Fix V1

Here is the cleanup of all the classes in mailnews/imap that use the utility function.
Comment 2 David :Bienvenu 2007-12-07 16:04:55 PST
Comment on attachment 292162 [details] [diff] [review]
IMAP Fix V1

thx, Nick. One nit - I'm going to go out on a limb and say that things like this:

+        NS_ENSURE_TRUE(m_allFolders, NS_ERROR_FAILURE);

should return NS_ERROR_OUT_OF_MEMORY instead, or pass in &rv to do_CreateInstance and NS_ENSURE_SUCCESS(rv, rv) to be sure to get the right error code.
Comment 3 Nick Kreeger 2007-12-21 17:02:21 PST
Created attachment 294304 [details] [diff] [review]
Checkin Patch Version [Checked In]

This patch addresses David's comments about getting the nsresult value to return in the NS_ERROR_FAILURE() calls.
Comment 4 Nick Kreeger 2007-12-25 15:22:50 PST
Comment on attachment 294304 [details] [diff] [review]
Checkin Patch Version [Checked In]

Checked into trunk.
Comment 5 neil@parkwaycc.co.uk 2007-12-25 16:21:18 PST
Actually nsISupportsArray is deprecated, and we should be looking into replacing it with nsI(Mutable)Array where possible.
Comment 6 :aceman 2012-02-29 13:48:54 PST
Should this stay open? The patch is marked checked in.
Comment 7 Ludovic Hirlimann [:Usul] 2012-03-09 01:30:45 PST
Nick why didn't you close the bug ?
Comment 8 Wayne Mery (:wsmwk, NI for questions) 2012-12-06 10:38:24 PST
(In reply to neil@parkwaycc.co.uk from comment #5)
> Actually nsISupportsArray is deprecated, and we should be looking into
> replacing it with nsI(Mutable)Array where possible.

Is anything more needed?  If yes, should we close this and do meta with new bugs for "removal, one at a time"?

http://mxr.mozilla.org/comm-central/search?find=%2Fmailnews%2Fbase%2F&string=NS_NewISupportsArray ?
Comment 9 Wayne Mery (:wsmwk, NI for questions) 2012-12-06 10:45:34 PST
(In reply to Wayne Mery (:wsmwk) from comment #8)
> (In reply to neil@parkwaycc.co.uk from comment #5)
> > Actually nsISupportsArray is deprecated, and we should be looking into
> > replacing it with nsI(Mutable)Array where possible.

i.e. bug 394167.  which still has a couple unresolved bugs blocking it
Comment 10 Wayne Mery (:wsmwk, NI for questions) 2012-12-06 10:52:15 PST
mike, comment 8  (since everyone else punts)
Comment 11 Mike Conley (:mconley) - (Needinfo me!) 2012-12-06 10:56:35 PST
My opinion: the goal of this bug is no longer valid, since, as Neil rightly points out, nsISupportsArray is deprecated in favour of nsIMutableArray.

Switching us over to nsIMutableArray seems to be tracked in bug 394167.

My position is to close this bug.
Comment 12 Wayne Mery (:wsmwk, NI for questions) 2012-12-06 11:12:41 PST
Using FIXED since it had one patch

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