Support `Array<nsID>` in XPIDL and XPConnect
Categories
(Core :: XPConnect, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
This will allow simplifying callers which currently use [array]
for this purpose, including nsIClassInfo::GetInterfaces
.
Assignee | ||
Comment 1•6 years ago
|
||
Currently the [ref] and [ptr] types share the same underlying
implementation. This is unfortunate, and can cause correctness problems
with outparam refs (as an example).
By using the same tools used to allow other larger objects (such as
jsid, nsTArray, and nsString) to be stored directly in the nsXPTCVariant
object, this patch directly stores the nsID in the nsXPTCVariant object
when calling from JS into C++.
Using this new strategy avoids an nsID* allocation every time we pass
one over XPConnect, and should also allow us to simplify callers.
In addition, some special casing is added to xpidl to make it possible
to use the nsid reference type objects directly inside of Array<T>,
which will allow us to remove [array] nsIIDPtr
callers.
Assignee | ||
Comment 2•6 years ago
|
||
This is a follow-up to the previous part, which actually changes one of
these callers to use Array<nsIIDRef> instead of [array] nsIIDPtr.
From doing this patch, it seems like we should consider changing
the type nsIIDRef
to instead simply be nsIID
, and treat it more like
the AString
types from the POV of XPIDL. nsIIDPtr
would then
continue to exist for backwards compatibility, but we can probably
remove almost all current consumers over time.
Depends on D19175
Updated•6 years ago
|
Updated•6 years ago
|
Comment 4•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9b2bfb8871c9
https://hg.mozilla.org/mozilla-central/rev/b4258349e68b
Description
•