gecko-dev/xpcom
Nika Layzell d4c9b9edf4 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-31 17:53:01 -04:00
..
base Bug 1451476 - [1.2] Add GeckoView page load error API. r=snorp,droeh,smaug 2018-07-31 20:43:33 +02:00
build Bug 1471347 - part 2 - store an nsCString for SharedLibrary::mBreakpadId; r=njn 2018-07-19 10:32:07 -04:00
components Bug 1477579: Follow-up: Also skip stack allocation assertion on Android. r=me DONTBUILD 2018-07-23 19:25:00 -07:00
doc
ds Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj 2018-07-31 17:52:59 -04:00
glue Backed out changeset 602bdd9d5a96 (bug 1461851) for linting failures on /checkouts/gecko/build/appini_header.py on a CLOSED TREE 2018-05-30 19:03:50 +03:00
idl-parser Bug 1474369 - Part 4: Add support for Sequence<T> types to xpidl and XPConnect, r=mccr8 2018-07-31 17:53:01 -04:00
io Bug 1479407 - nsMultiplexInputStream::AppendElement should be fallible, r=froydnj 2018-07-30 23:15:36 +02:00
libxpt/xptcall
reflect Bug 1474369 - Part 4: Add support for Sequence<T> types to xpidl and XPConnect, r=mccr8 2018-07-31 17:53:01 -04:00
rust Bug 1471726 - Part 1: Correct codegen for XPIDL arrays of JSVals, r=mccr8 2018-07-31 17:52:58 -04:00
string Bug 1207696 Part 4l - Don't record some debugging/statistics atomics, r=froydnj. 2018-07-21 14:26:58 +00:00
system Backed out changeset 602bdd9d5a96 (bug 1461851) for linting failures on /checkouts/gecko/build/appini_header.py on a CLOSED TREE 2018-05-30 19:03:50 +03:00
tests Bug 1461450 - Part 2: Add tests for AutoTArray move constructors, r=erahm 2018-07-31 17:52:59 -04:00
threads Bug 1477943 - Add a unique id per PerformanceCounter instance - r=baku,froydnj 2018-07-27 11:44:22 +02:00
typelib Bug 1471620 - Skip python-tests locally that don't run with python 3 in CI r=davehunt 2018-06-27 11:10:02 -04:00
windbgdlg
xpidl Bug 1459721 - part 7 - remove dist_idl install manifest; r=chmanchester 2018-05-15 10:05:23 -04:00
moz.build Bug 1444745 - Part 1: Clear out xptinfo and typelib to make way for the this patch, r=mccr8 2018-04-17 19:20:50 -04:00
xpcom-config.h.in
xpcom-private.h.in