Closed
Bug 434493
Opened 16 years ago
Closed 16 years ago
Drop more instances of nsISupportsArray in mailnews.
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(3 files)
47.80 KB,
patch
|
Bienvenu
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
48.64 KB,
patch
|
Details | Diff | Splinter Review | |
515 bytes,
patch
|
Bienvenu
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
Here are some more instances of nsISupportsArray that are easy to fix because they are stand-alone: nsMsgSearchSession nsMsgDBFolder nsMsgDatabase nsMsgImapProtocol nsMsgComposeProgress is not used by anything, so this patch cvs removes it (which does mean we get rid of some nsISupportsArray instances of grep).
Attachment #321590 -
Flags: superreview?(bienvenu)
Attachment #321590 -
Flags: review?(bienvenu)
Assignee | ||
Comment 1•16 years ago
|
||
Comment 2•16 years ago
|
||
Comment on attachment 321590 [details] [diff] [review] The fix (diff -w) this looks like nice cleanup! some nits - can you use the prevailing brace style in nsMsgSearchSession, instead of K&R? e.g., + nsCOMPtr<nsIMsgSearchNotify> listener; + while (iter.HasMore()) { Here, do you mean the member variables like m_hasPendingMoves? + // Nothing to do, so don't change the local variables. + if (numFolders == 0) + return NS_OK; + not bailing out on error with the nsMsgDatabase notify methods is a change in behavior - errors should be rare, and it's probably better to not to bail out - I guess we'll see :-)
Attachment #321590 -
Flags: superreview?(bienvenu)
Attachment #321590 -
Flags: superreview+
Attachment #321590 -
Flags: review?(bienvenu)
Attachment #321590 -
Flags: review+
Assignee | ||
Comment 3•16 years ago
|
||
(In reply to comment #2) > Here, do you mean the member variables like m_hasPendingMoves? > + // Nothing to do, so don't change the local variables. > + if (numFolders == 0) > + return NS_OK; > + Yes, I've done s/local/member/ in that comment. I checked the patch again, if AddMove only created the array if something was going to be added to it. So I think this is equivalent code. > not bailing out on error with the nsMsgDatabase notify methods is a change in > behavior - errors should be rare, and it's probably better to not to bail out - > I guess we'll see :-) Yes, I think I was slightly worried about extensions doing the wrong things and messing us up. If we are really relying on the order of listeners being called there its probably going to be an issue anyway. I'll check the patch in with these comments addressed.
Assignee | ||
Updated•16 years ago
|
Attachment #321591 -
Attachment description: The fix (full patch) → [checked in] The fix (full patch)
Assignee | ||
Comment 4•16 years ago
|
||
Patch checked in.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Target Milestone: --- → mozilla1.9
Comment 5•16 years ago
|
||
Note: since you know the nsCOMArray is never going to have more than kNumHdrsToXfer elements you could reserve space for it i.e. nsMsgImapHdrXferInfo::nsMsgImapHdrXferInfo() : m_hdrInfos(kNumHdrsToXfer) { m_nextFreeHdrInfo = 0; } The other alternative would be an nsAutoTArray<nsCOMPtr<nsIImapHeaderInfo>, 10>
Comment 6•16 years ago
|
||
Unfortunately this patch broke my unit test for search that I was preparing for bug 217034. Previously, I was able start a test search with something like: searchSession.search(null) with a null window. But the new test at line 268 of nsMsgSearchSession.cpp: m_msgWindowWeak = do_GetWeakReference(aWindow, &rv); if (NS_FAILED(rv)) return rv; now fails the search with a null window. Is this really necessary? The code elsewhere seems to ignore null windows.
Assignee | ||
Comment 7•16 years ago
|
||
(In reply to comment #6) > Unfortunately this patch broke my unit test for search that I was preparing for > bug 217034. ... > Is this really necessary? The code elsewhere seems to ignore null windows. No it isn't necessary, sorry, that was my error. I know you've included it in the patch for bug 217034, but I'd like to back it out via this bug as I'm probably not going to get to review yours until Monday/Tuesday and I don't know if it'll have caused other regressions or not.
Assignee | ||
Comment 8•16 years ago
|
||
David, please see comments 6/7.
Attachment #322253 -
Flags: superreview?(bienvenu)
Attachment #322253 -
Flags: review?(bienvenu)
Updated•16 years ago
|
Attachment #322253 -
Flags: superreview?(bienvenu)
Attachment #322253 -
Flags: superreview+
Attachment #322253 -
Flags: review?(bienvenu)
Attachment #322253 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Attachment #322253 -
Attachment description: Drop/Backout the unneeded check → [checked in] Drop/Backout the unneeded check
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•