Replace idl nsIArray usage with Array<T> in mailnews/base/public/
Categories
(MailNews Core :: General, task)
Tracking
(thunderbird_esr78 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | wontfix |
People
(Reporter: benc, Assigned: benc)
References
Details
(Keywords: leave-open)
Attachments
(18 files, 5 obsolete files)
48.49 KB,
patch
|
mkmelin
:
review+
pmorris
:
review+
|
Details | Diff | Splinter Review |
47.45 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
36.10 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
8.49 KB,
patch
|
benc
:
review+
|
Details | Diff | Splinter Review |
33.96 KB,
patch
|
benc
:
review+
|
Details | Diff | Splinter Review |
54.54 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
10.14 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
20.56 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
20.92 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
13.46 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
13.92 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
51.54 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
24.64 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
17.18 KB,
patch
|
benc
:
review+
|
Details | Diff | Splinter Review |
3.00 KB,
patch
|
benc
:
review+
|
Details | Diff | Splinter Review |
88.86 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
15.02 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
147.92 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
This covers:
mailnews/base/public/nsIMsgFolderNotificationService.idl
mailnews/base/public/nsIMsgCopyService.idl
mailnews/base/public/nsIMsgPluggableStore.idl
mailnews/base/public/nsIMsgFolderListener.idl
mailnews/base/public/nsIMsgFolder.idl
mailnews/base/public/nsIMsgFolderCompactor.idl
mailnews/base/public/nsIMsgAccount.idl
mailnews/base/public/nsIMsgAccountManager.idl
Assignee | ||
Comment 1•5 years ago
•
|
||
mailnews/base/public/nsIMsgAccountManager.idl deserved its own Bug - see Bug 1614846.
Assignee | ||
Comment 2•5 years ago
|
||
This one converts nsIMsgAccount.identities
.
Try build:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&selectedJob=296033067&revision=8177d78bfc385d1c5ae617427cf75dd2814f731f
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/588fc64ebcb0
Remove nsIArray usage in nsIMsgAccount. r=mkmelin,pmorris DONTBUILD
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
This one kept spilling out, so in the end I converted a bunch of related interfaces in different .idl files rather than a whole .idl file at once. The ones affected here are:
nsIMsgFolderListener.msgsDeleted()
nsIMsgFolderNotificationService.notifyMsgsDeleted()
nsIMsgPluggableStore.deleteMessages()
nsIMsgPluggableStore.changeFlags()
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
Try build here.
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=7766f7b3f76d48648ec41face1c8aa552a70ea51
There's a bunch of orange, but I don't think they're related to this patch. Still maybe better to hold off a little and get a clear try run?
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/e7ab0d2b7290
Remove nsIArray use in nsIMsgFolderListener.msgsClassified(). r=mkmelin
Updated•5 years ago
|
Assignee | ||
Comment 13•5 years ago
|
||
Assignee | ||
Comment 14•5 years ago
|
||
try run looks good:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=2a80729d78acd29d0f52c58049c04ba4dd4e3ad9
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
Assignee | ||
Comment 17•5 years ago
|
||
Assignee | ||
Comment 18•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 19•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/bc7e17995e19
Remove nsIArray use from nsIMsgPluggableStore.changeKeywords(). r=mkmelin
https://hg.mozilla.org/comm-central/rev/1f1357f245c1
Remove nsIArray usage for msgsMoveCopyCompleted notification. r=mkmelin DONTBUILD
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 20•5 years ago
|
||
Assignee | ||
Comment 21•5 years ago
•
|
||
Replaces nsIMsgFolder.ListDescendants() with nsIMsgFolder.descendants (which is simpler and clearer - ListDescendants() appended to the passed-in array).
These two descendants-related patches are covered by this try run:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=39de08a7f5f31704ce13b59d4615391944a3b6aa
(There's a third patch in there for nsIFolderCompactor, but I'll hold back until these two are clear)
Comment 22•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 23•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/61ac6bd14371
Remove nsIArray usage from nsIMsgFolder.descendants. r=mkmelin
https://hg.mozilla.org/comm-central/rev/e16540d657cc
Remove redundant nsIMsgFolder.ListDescendants(). r=mkmelin DONTBUILD
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 24•4 years ago
|
||
The logic in nsFolderCompactState::CompactFolders()
was a little tricky to follow, but I've tried to clarify it a bit in the patch. Basically there are three cases:
- folders only
- folders and offline folders (the offline folders are saved in
m_offlineFolderArray
and a newnsFolderCompactState
instance is spawned to process them when the other folders have finished).
-offline folders only (m_compactingOfflineFolders
is set to true )
Assignee | ||
Comment 25•4 years ago
|
||
Oh, forgot to add: the nsIMsgFolderCompactor
patch was included in the previous try run: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=39de08a7f5f31704ce13b59d4615391944a3b6aa
Comment 26•4 years ago
|
||
Updated•4 years ago
|
Comment 27•4 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/2db662df8f37
Remove nsIArray usage from nsIMsgFolderCompactor. r=mkmelin
Updated•4 years ago
|
Assignee | ||
Comment 28•4 years ago
|
||
Try run here, which looks good:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=8fbecff076633fa09255c5b66355be20b0be5a7f
This one took a whole heap of debugging. It broke lots of tests, and I'm not entirely sure what change got it working. I was looking at the wrong bug a lot of the time - turns out I'd triggered a pre-existing issue where copying an empty folder never finished (nsMsgLocalMailFolder::CopyFolderAcrossServer()
was notifying on the wrong folder). I think somewhere while I was being misled on that one, I accidentally fixed whatever it was I'd broken. Sigh.
Long story short: Keep an eye out, the nsIMessageCopyService code seems to have some fragility to it...
Comment 29•4 years ago
|
||
Assignee | ||
Comment 30•4 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #29)
::: mailnews/base/src/nsMsgCopyService.cpp
@@ +486,4 @@nsCOMPtr<nsIMsgFolder> curFolder;
nsCOMPtr<nsISupports> support;
- MOZ_ASSERT(folders.Length() == 1); // Can only copy one folder.
Why are we passing in an array then?
I had enough grief with this patch that I figured that could be handled in another bug (I've just written it up - Bug 1643208).
At the very least this should throw a runtime error instead - it's
accessible from js.
Good point. New patch returns NS_ERROR_INVALID_ARG if the array isn't just a single folder.
Assignee | ||
Comment 31•4 years ago
|
||
This one is pretty self contained and shouldn't clash with other patches in this series.
Try run looks OK:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=d2a5f0935ad717696232a205b90fff053fbd0fc0
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 32•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4f8d3dff196e
Remove nsIArray use from nsIMsgCopyService.copyFolders. r=mkmelin
https://hg.mozilla.org/comm-central/rev/c74497b57d8c
Remove nsIArray usage from nsIMsgPluggableMailStore.copyMessages. r=mkmelin
Assignee | ||
Comment 33•4 years ago
|
||
Try run here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=73c001bd8ef0ffb66925a4a5809c2d3b478c54ad
Comment 34•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 35•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/d146b4e2061c
Remove nsIArray usage from nsIMsgFolder.getFoldersWithFlags(). r=mkmelin
Updated•4 years ago
|
Assignee | ||
Comment 36•4 years ago
|
||
Try run here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=b36d20f09a11e8a3af3076d85ba00c5da913613b
(I originally thought it was breaking a mochitest, but there's another try run without this patch which does the same)
Comment 37•4 years ago
|
||
Assignee | ||
Comment 38•4 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #37)
isn't this still needed, if one pass in null from js?
No, on the C++ side it's a nsTArray<> reference now, so you can't pass in null (well, obviously you still pass null
in from JS, but I'd guess the bindings either throw an error or pass it on as an empty array to the C++ side).
Anyway, there is only one JS use, and it always passes in an array containing exactly one message.
Assignee | ||
Updated•4 years ago
|
Comment 39•4 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/93610e507d37
Remove nsIArray use in nsIMsgFolder markMessagesRead, markMessagesFlagged, setLabelForMessages, setJunkScoreForMessages. r=mkmelin
Updated•4 years ago
|
Comment 40•4 years ago
|
||
Ah yes, passing in null will just give
NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY: Cannot convert primitive JavaScript value into an array
Assignee | ||
Comment 41•4 years ago
|
||
The try run has a couple of fails, but I think they were already there without this patch...
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=ffc2c3fa4e6f227629fb66cdb6c4b0e3ab70840a
Comment 42•4 years ago
|
||
Updated•4 years ago
|
Comment 43•4 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/4f1fac782b47
nsIArray removal in nsIMsgFolder addKeywordsToMessages()/removeKeywordsFromMessages(). r=mkmelin DONTBUILD
Updated•4 years ago
|
Assignee | ||
Comment 44•4 years ago
|
||
This one is for nsIMsgFolder.deleteSubFolders()
. Took the opportunity to change it into deleteSubFolder()
as it only ever worked for single folders and it streamlines the code a little.
try run here (don't think this broke anything new, but I'm not 100% sure):
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=0c31b8e2116ffb1e4496385005617a0c7e8c799d
Comment 45•4 years ago
|
||
Assignee | ||
Comment 46•4 years ago
|
||
Take 2 - this version replaces nsIMsgFolder.deleteSubFolders()
with nsIMsgFolder.deleteSelf()
.
Try run here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=d27c52674486c244e419e1c6ff2f2170ba351c7d
One reply-in-advance:
nsImapMailFolder::RemoveSubFolder
(now nsImapMailFolder::RemoveLocalSelf()
) used to call DeleteStorage()
twice, so the one I removed here was redundant. The other DeleteStorage()
call is under nsMsgDBFolder::DeleteSelf().
Comment 47•4 years ago
|
||
Assignee | ||
Comment 48•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 49•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/d4333da4784f
nsIArray removal in nsIMsgFolder.deleteSubFolders(). r=mkmelin
Updated•4 years ago
|
Comment 50•4 years ago
|
||
Just mopping up a few cases of unneeded interface nsIArray referencing
Assignee | ||
Updated•4 years ago
|
Comment 51•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 52•4 years ago
•
|
||
This one's quite a chunky big one, I'm afraid...
Gets rid of the nsIArray use in nsIMsgCopyService.
Try run seems good, I think:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=91f439e3a63896745a69be77a3b8682edab35d3d
Comment 53•4 years ago
|
||
Comment 54•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 55•4 years ago
|
||
Another nice simple one (hopefully!)
try run here (I think it looks OK - second opinion welcome!):
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=2392be12ee6621b7f8d5eca187bb311c7b2d361e
Comment 56•4 years ago
|
||
Comment 57•4 years ago
|
||
Updated•4 years ago
|
Comment 58•4 years ago
|
||
Comment 59•4 years ago
|
||
Ah, that should have been followup for bug 1674645.
Assignee | ||
Comment 60•4 years ago
|
||
Hopefully the last one in this bug!
There's still some internal nsIArray/nsIMutableArray use, but I'll take stock off all that in another bug once the IDL files are all dealt with.
Comment 61•4 years ago
|
||
Updated•4 years ago
|
Comment 62•4 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/c2ddbcc4f197
Remove nsIArray usage from nsIMsgFolder. r=mkmelin
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 63•3 years ago
|
||
So, which version is the earliest one with this change committed?
Description
•