Consider removing [array] use in xpidl in Thunderbird
Categories
(Thunderbird :: General, task)
Tracking
(Not tracked)
People
(Reporter: bzbarsky, Unassigned)
References
(Blocks 1 open bug)
Details
We'd generally like to remove [array] from xpconnect. See bug 1509981.
The replacement is the Array type. So for example, an API like getSubjects() in nsIActivity.idl would change from:
void getSubjects(out unsigned long length, [retval, array,
size_is(length)] out nsIVariant aSubjects);
to
Array<nsIVariant> getSubjects();
C++ callers would need to change to use nsTArray for the array. JS callers can mostly not change much; in this specific case the aCount
argument and setting its .value
can go away in nsActivity.js, and JS callers can stop passing the {}
argument they ignore.
It looks like there are a few uses in mail/, a bunch in mailnews/, and a bunch in calendar/. I don't know whether those need separate bugs.
Reporter | ||
Comment 1•6 years ago
|
||
Oh, one other heads-up: you can't do Array<string>
or Array<wstring>
. Generally you would do Array<ACString>
, Array<AUTF8String>
, or Array<AString>
depending on the semantics you want.
Reporter | ||
Updated•6 years ago
|
Comment 2•6 years ago
|
||
Thanks for the heads-up. We'll deal with it in the 69 cycle.
I guess we're looking at all these:
https://searchfox.org/comm-central/search?q=retval%2C+array%2C+size_is&case=false®exp=false&path=
Reporter | ||
Comment 3•6 years ago
|
||
All those, yes but also, for example, these: https://searchfox.org/comm-central/search?q=array%2C+size_is%28aCount%29%2C+retval&path= (the annotations are in a different order).
And also the non-retvals: https://searchfox.org/comm-central/search?q=%5Barray%2C+size_is(aCount)%5D&case=false®exp=false&path= (plus maybe other names for the size).
What I've been querying for on the m-c side are lines in .idl files that contain both "array" and '['. I've also considered just instrumenting the xpidl parser to spit out the list of things involved; if that would be useful I can probably post a patch for that.
Comment 4•6 years ago
|
||
Aceman or Ben, can I get you interested in this. Otherwise Magnus needs to assign someone before this ends up in big bustage.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
I'm looking at the ldap ones now then I'll move onto the other C++ ones.
(can look into the JS ones too after that if needed)
Updated•5 years ago
|
Comment 6•5 years ago
|
||
This is now done!
Comment 7•5 years ago
|
||
Right. Strangely M-C aren't done yet. If you click on the links in comment #2 and comment #3, you'll see four IDL files in M-C which still use the old syntax.
Description
•