Discussion:
IPDL has a native array type
Chris Jones
2009-10-19 19:03:15 UTC
Permalink
Probably worth posting here, to make sure everyone writing IPDL
protocols knows about it.

Last week I added a native array type to IPDL, so that instead of
writing specifications like

include "nsTArray";
using nsTArray<nsCString>;
protocol Foo {
child: Msg(nsTArray<nsCString> args);
};

one can now write

protocol Foo {
child: Msg(nsCString[] args);
};

Because the native IPDL array type plays well with IPDL actor types and
unions (which nsTArray does *not*), and because the syntax is simpler, I
don't hesitate to say that nsTArray should be banned from protocols.

Cheers,
Chris
Chris Jones
2009-10-19 19:04:53 UTC
Permalink
Post by Chris Jones
Probably worth posting here, to make sure everyone writing IPDL
protocols knows about it.
Last week I added a native array type to IPDL, so that instead of
writing specifications like
include "nsTArray";
using nsTArray<nsCString>;
protocol Foo {
child: Msg(nsTArray<nsCString> args);
};
one can now write
protocol Foo {
child: Msg(nsCString[] args);
};
Because the native IPDL array type plays well with IPDL actor types and
unions (which nsTArray does *not*), and because the syntax is simpler, I
don't hesitate to say that nsTArray should be banned from protocols.
Oops --- I forgot to add that the IPDL array type "compiles down" to
nsTArray in C++. So if you have a protocol that currently uses
nsTArray, you should be able to switch to native IPDL arrays without
changing any of your C++ code.

Cheers,
Chris

Loading...