gecko-dev/js/xpconnect
Nika Layzell b47aabdb25 Bug 1474369 - Part 4: Add support for Sequence<T> types to xpidl and XPConnect, r=mccr8
Summary:
This patch adds support for the `Sequence<T>` type. This is largely a
straightforward type propagation patch, but there are a few notable things:

 1. We allow `[iid_is(x)] Sequence<nsQIResult>`, so Sequence can be Dependent.

 2. `Sequence<T>` is reflected into C++ as a `nsTArray<T>`, which is different
    than WebIDL's `mozilla::dom::Sequence<T>` type. This decision was made for
    general ergonomics reasons, as `nsTArray<T>` is more prevailent throughout
    the codebase, and lengths in this case cannot be controlled by content, as
    XPConnect is only exposed to Chrome JS.

 3. Owned pointers in `Sequence<T>` are not reflected as their owned
    counterparts. For example, `Sequence<nsISupports>` is reflected as
    `nsTArray<nsISupports*>` rather than `nsTArray<RefPtr<nsISupports>>`. This
    was done to avoid depending on `RefPtr<T>` and `T*` having the same
    in-memory representation, however if that is considered an acceptable
    dependency, it would be nice to support that.

 4. We also don't reflect singly-owned pointers as their owned counterparts. For
    example, `nsTArray<nsIIDPtr>` would be reflected as `nsTArray<nsIID*>`
    rather than `nsTArray<mozilla::UniquePtr<nsIID>>`. If we are willing to
    depend on `mozilla::UniquePtr<T>`'s in-memory representation, we could also
    do this, however.

 5. There are no restrictions on what types can appear inside of a `Sequence<T>`
    or what can appear inside an `[array] T`. We may want to add restrictions
    either at the xpidl level or in XPConnect.

Depends On D2109

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2110
2018-07-25 15:37:50 -04:00
..
crashtests Bug 1446668: Remove setUserData crashtests. r=smaug 2018-03-18 01:53:13 +01:00
idl Bug 1465287 Part 7 - Add IPDL and IDL for record/replay directives and fatal errors, r=mccr8. 2018-07-22 11:51:55 +00:00
loader Bug 1465294 Part 9 - Avoid triggering unhandled recording divergences in XPConnect, r=mccr8. 2018-07-24 15:44:35 +00:00
public Bug 1453011 - Remove PostCreatePrototype. r=bz. 2018-03-22 11:31:05 +01:00
shell bug 1255485 - Remove NSDISTMODE=copy from Makefiles. r=nalexander 2017-11-22 15:30:06 -05:00
src Bug 1474369 - Part 4: Add support for Sequence<T> types to xpidl and XPConnect, r=mccr8 2018-07-25 15:37:50 -04:00
tests Bug 1471726 - Part 2: Add basic tests for jsval array codegen, r=mccr8 2018-07-25 15:37:38 -04:00
wrappers Bug 1473865 part 4 - Use xpc::WindowOrNull instead of xpc::WindowGlobalOrNull in a few places. r=bz 2018-07-12 16:17:44 +02:00
moz.build Bug 1400406 - js/xpconnect/moz.build contains a reference to a non-existent directory. r=gps 2017-09-15 14:35:15 -07:00