Replace idl nsIArray usage with Array<T> in nsIMsgSend
Categories
(MailNews Core :: General, task)
Tracking
(thunderbird_esr78 wontfix, thunderbird83 wontfix, thunderbird84 wontfix)
People
(Reporter: benc, Assigned: benc)
References
Details
(Keywords: leave-open)
Attachments
(3 files, 3 obsolete files)
11.16 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
22.59 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
12.49 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
mailnews/compose/public/nsIMsgSend.idl
Comment 1•4 years ago
|
||
Could be worth doing this soon to make it easier for bug 1211292.
Assignee | ||
Comment 2•4 years ago
|
||
I'm doing this now, but I'm a little confused about the aAttachments
param of nsIMsgSend.createRFC822Message()
. The comments say:
@param aAttachments Array of nsIMsgAttachmentData
But it seems to be used in code as already-loaded attachments: an array of nsIMsgAttachedFile
objects.
Know which one it should be?
There's also the aEmbeddedObjects
param which can contain (I think) either mozilla::dom::Element
or nsIMsgEmbeddedImageData
objects (I think the latter is for Outlook import support...).
I was going to go with:
in Array<nsISupports> aEmbeddedObjects
And keep the existing runtime QIs to distinguish each object. But I'm open to better suggestions :-)
Comment 3•4 years ago
|
||
(In reply to Ben Campbell from comment #2)
But it seems to be used in code as already-loaded attachments: an array of
nsIMsgAttachedFile
objects.
Know which one it should be?
I'd trust the code and not the comment.
There's also the
aEmbeddedObjects
param which can contain (I think) eithermozilla::dom::Element
ornsIMsgEmbeddedImageData
objects (I think the latter is for Outlook import support...).
Maybe it's always Array<nsIMsgEmbeddedImageData>?
If not, it would be nicer if we can figure out things or split it of so it's not Array<nsISupports>. It's rather an ugly API so maybe we want to change it not to force that strange parameter on everyone...
Assignee | ||
Comment 4•4 years ago
|
||
A little more intrusive than I'd like, but here it is.
(In reply to Magnus Melin [:mkmelin] from comment #3)
There's also the
aEmbeddedObjects
param which can contain (I think) eithermozilla::dom::Element
ornsIMsgEmbeddedImageData
objects (I think the latter is for Outlook import support...).Maybe it's always Array<nsIMsgEmbeddedImageData>?
No, there are definitely code paths which shove Elements in there. I've left it as Array<nsISupports> for now - so should behave just like the previous version. I Don't know enough about what it's actually trying to do to have a good take on improvements.
But yeah, some API refinement is probably in order.
Try run here (have to head out this afternoon, so won't be around to see it finish - keep an eye on the windows build, as there's some win32-only MAPI code I haven't yet compiled locally):
Assignee | ||
Comment 5•4 years ago
|
||
Doh. Minor windows-specific fix
and try run:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=82fd8eecbd79716336bf34abbcdcea34b332eac7
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
nit fixes and get-it-building-on-windows fix.
And a not-quite-finished-but-looking-much-better try run:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=4c9c69efe0c18ad3722a3a7b3dbcc2f6026bb0e9
Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #6)
Comment on attachment 9176457 [details] [diff] [review]
::: mailnews/compose/src/nsMsgCompose.cpp
@@ +1186,4 @@rv = mMsgSend->CreateAndSendMessage( m_composeHTML ? m_editor.get() : nullptr, identity, accountKey, m_compFields, false, false, (nsMsgDeliverMode)deliverMode, nullptr,
m_composeHTML ? TEXT_HTML : TEXT_PLAIN, bodyString, {}, {}, m_window,
can't these continue to be nullptr instead of empty array?
No - those function params are references now rather than pointers (ie nsTArray<>&
). I think that's good and reduces the ambiguity I've seen in a few places (ie "is a null array treated the same as an empty one, or does it signify something special?")
Assignee | ||
Comment 9•4 years ago
|
||
Holding off on landing this - it seems to break one of the mochitests. Something to do with pasting html with embedded images...
./mach mochitest --headless --log-mach - comm/mail/test/browser/composition/browser_blockedContent.js
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Ben Campbell from comment #9)
Holding off on landing this - it seems to break one of the mochitests. Something to do with pasting html with embedded images...
Haven't forgotten this - just having lots of trouble running the mochitests locally at the moment... (think it might be debug build running too slow and causing timeouts, so will try on a release build. byebye debugger :- )
Assignee | ||
Comment 11•4 years ago
•
|
||
[edit - remove doublepost]
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 12•4 years ago
|
||
Just removing a little leftover dead code. Simplify the nsIArray-removal slightly.
Comment 13•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 14•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4829ad0bcb0b
Remove dead code in nsMsgComposeAndSend (left over from changes in Bug 1211292). r=mkmelin
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 15•4 years ago
|
||
Taking very small steps with this one - I had a lot of trouble minor mochitest breakages last time I tried.
Try run for this one - there's one mochitest orange, but I'm not sure if it's the fault of this patch or not (it's marked as intermittent fail). I could do with a second opinion:
Disregard the r? if you think the fail is due to this patch!
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
Assignee | ||
Comment 18•4 years ago
|
||
This one wraps up the remaining nsIArray use in createRFC822Message (both in nsIMsgSend and nsIImportService). There's still some internal nsIArray use which could be cleaned up (the nsMsgComposeAndSend initialisation is a bit tangled), but this fixes up the interfaces at least.
try run here:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=814aafed6ad863ea9863db41948d4f0fe08380a4
Comment 19•4 years ago
|
||
Updated•4 years ago
|
Comment 20•4 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/520c2bc1321e
Remove nsIArray use from nsIMsgSend and nsIImportService. r=mkmelin
Comment 21•4 years ago
|
||
Not strictly this bug, but can we now just move createRFC822Message to nsIImportService, since it's only import that's using it?
Comment 22•4 years ago
|
||
Oh, see bug 1680189.
Assignee | ||
Updated•4 years ago
|
Description
•