diff options
Diffstat (limited to 'ipc/ipdl/test/ipdl/ok')
74 files changed, 860 insertions, 0 deletions
diff --git a/ipc/ipdl/test/ipdl/ok/MutRecHeader1.ipdlh b/ipc/ipdl/test/ipdl/ok/MutRecHeader1.ipdlh new file mode 100644 index 0000000000..56135b2197 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/MutRecHeader1.ipdlh @@ -0,0 +1,34 @@ +include MutRecHeader2; + +/* MutRecHeader1 (H1) includes MutRecHeader2 (H2), and uses a struct from H2. + H2 includes MutRecHeader3 (H3). + H3 includes H1. + +When type checking H1, GatherDecls::visitInclude will recursively +cause us to first check H2, which in turn will cause us to first check +H3. + +H3 only includes H1, so when we check it, we do not have any +declarations from H2 in the context. There used to be code in +GatherDecls::visitTranslationUnit that would, as part of the "second +pass", check the validity of all included structures. This would check +Struct1, and fail, because Struct2 is not declared. + +Fundamentally, it doesn't make sense to check anything declared in an +included file in the context of the file that included it. + +Note that this error did not show up when either H2 or H3 was +checked. This is because in those cases we are not in the middle of +checking H1 when we check H3, so we end up fully checking H1 before we +get to the end of checking H3. This means the "visited" tag gets put +on Struct1 before we get to the end of that troublesome block of code +in visitTranslationUnit, and visitStructDecl doesn't do anything if +that tag is set, so we don't end up actually checking H1 in the +context of H3. + +*/ + +struct Struct1 +{ + Struct2 b; +}; diff --git a/ipc/ipdl/test/ipdl/ok/MutRecHeader2.ipdlh b/ipc/ipdl/test/ipdl/ok/MutRecHeader2.ipdlh new file mode 100644 index 0000000000..142979dc45 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/MutRecHeader2.ipdlh @@ -0,0 +1,8 @@ +include MutRecHeader3; + +// See MutRecHeader1.ipdlh for explanation. + +struct Struct2 +{ + bool b; +}; diff --git a/ipc/ipdl/test/ipdl/ok/MutRecHeader3.ipdlh b/ipc/ipdl/test/ipdl/ok/MutRecHeader3.ipdlh new file mode 100644 index 0000000000..2e303ae444 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/MutRecHeader3.ipdlh @@ -0,0 +1,8 @@ +include MutRecHeader1; + +// See MutRecHeader1.ipdlh for explanation. + +struct Struct3 +{ + bool b; +}; diff --git a/ipc/ipdl/test/ipdl/ok/MyTypes.ipdlh b/ipc/ipdl/test/ipdl/ok/MyTypes.ipdlh new file mode 100644 index 0000000000..9e33d71c51 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/MyTypes.ipdlh @@ -0,0 +1,6 @@ +include protocol PMyManaged; + +struct MyActorPair { + PMyManaged actor1; + nullable PMyManaged actor2; +}; diff --git a/ipc/ipdl/test/ipdl/ok/PAsyncReturn.ipdl b/ipc/ipdl/test/ipdl/ok/PAsyncReturn.ipdl new file mode 100644 index 0000000000..5deae9216b --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PAsyncReturn.ipdl @@ -0,0 +1,9 @@ +// Async messages are not allowed to return values. + +//error: asynchronous message `Msg' declares return values + +[ChildProc=any] +protocol PAsyncReturn { +child: + async Msg() returns(int32_t aNumber); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PDelete.ipdl b/ipc/ipdl/test/ipdl/ok/PDelete.ipdl new file mode 100644 index 0000000000..006c73dc0d --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PDelete.ipdl @@ -0,0 +1,9 @@ +include protocol PDeleteSub; + +[ChildProc=any] +sync protocol PDelete { + manages PDeleteSub; + +child: + async PDeleteSub(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PDeleteSub.ipdl b/ipc/ipdl/test/ipdl/ok/PDeleteSub.ipdl new file mode 100644 index 0000000000..12b4c677eb --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PDeleteSub.ipdl @@ -0,0 +1,10 @@ +include protocol PDelete; + +sync protocol PDeleteSub { + manager PDelete; + +parent: + sync __delete__(int x) returns (double d); + +}; + diff --git a/ipc/ipdl/test/ipdl/ok/PEndpointDecl.ipdl b/ipc/ipdl/test/ipdl/ok/PEndpointDecl.ipdl new file mode 100644 index 0000000000..f8fe51864a --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PEndpointDecl.ipdl @@ -0,0 +1,19 @@ + +// Basic test that Endpoint types are declared for protocols, within +// that protocol. + +struct Whatever { + Endpoint<PEndpointDeclParent> par; + Endpoint<PEndpointDeclChild> chi; +}; + +namespace mozilla { + +[ChildProc=any] +protocol PEndpointDecl { + child: + async Message(Endpoint<PEndpointDeclParent> aEndpointParent, + Endpoint<PEndpointDeclChild> aEndpointChild); +}; + +} diff --git a/ipc/ipdl/test/ipdl/ok/PEndpointUse.ipdl b/ipc/ipdl/test/ipdl/ok/PEndpointUse.ipdl new file mode 100644 index 0000000000..8fde19c8e5 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PEndpointUse.ipdl @@ -0,0 +1,10 @@ +include protocol PEndpointDecl; + +// Basic test that Endpoint types are declared for included protocols. + +[ChildProc=any] +protocol PEndpointUse { + child: + async Message(Endpoint<PEndpointDeclParent> aEndpointParent, + Endpoint<PEndpointDeclChild> aEndpointChild); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PExtendedAttrMultipleAttributes.ipdl b/ipc/ipdl/test/ipdl/ok/PExtendedAttrMultipleAttributes.ipdl new file mode 100644 index 0000000000..ce49ed8d2a --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PExtendedAttrMultipleAttributes.ipdl @@ -0,0 +1,5 @@ +[NestedUpTo=inside_sync, NeedsOtherPid, ChildProc=any] +async protocol PExtendedAttrMultipleAttributes { +parent: + async Msg(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PLazySend.ipdl b/ipc/ipdl/test/ipdl/ok/PLazySend.ipdl new file mode 100644 index 0000000000..e67b35a153 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PLazySend.ipdl @@ -0,0 +1,7 @@ +[ChildProc=any] +protocol PLazySend { +child: + [LazySend] async foo(); +parent: + [LazySend] async bar() returns (bool baz); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PManagedEndpointDecl.ipdl b/ipc/ipdl/test/ipdl/ok/PManagedEndpointDecl.ipdl new file mode 100644 index 0000000000..13eb10fcc4 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PManagedEndpointDecl.ipdl @@ -0,0 +1,23 @@ +include protocol PManagedEndpointManager; + +// Basic test that ManagedEndpoint types are declared for protocols, within +// that protocol. + +struct ManagedWhatever { + ManagedEndpoint<PManagedEndpointDeclParent> par; + ManagedEndpoint<PManagedEndpointDeclChild> chi; +}; + +namespace mozilla { + +protocol PManagedEndpointDecl { + manager PManagedEndpointManager; + +child: + async Message(ManagedEndpoint<PManagedEndpointDeclParent> aEndpointParent, + ManagedEndpoint<PManagedEndpointDeclChild> aEndpointChild); + + async __delete__(); +}; + +} diff --git a/ipc/ipdl/test/ipdl/ok/PManagedEndpointManager.ipdl b/ipc/ipdl/test/ipdl/ok/PManagedEndpointManager.ipdl new file mode 100644 index 0000000000..2ae381c72b --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PManagedEndpointManager.ipdl @@ -0,0 +1,15 @@ +include protocol PManagedEndpointDecl; + +namespace mozilla { + +[ChildProc=any] +protocol PManagedEndpointManager { + manages PManagedEndpointDecl; + +child: + async Message(ManagedEndpoint<PManagedEndpointDeclParent> aEndpointParent, + ManagedEndpoint<PManagedEndpointDeclChild> aEndpointChild); +}; + +} + diff --git a/ipc/ipdl/test/ipdl/ok/PManualDealloc.ipdl b/ipc/ipdl/test/ipdl/ok/PManualDealloc.ipdl new file mode 100644 index 0000000000..53660762ad --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PManualDealloc.ipdl @@ -0,0 +1,8 @@ +include protocol PManualDealloc_manager; + +[ManualDealloc] async protocol PManualDealloc { + manager PManualDealloc_manager; + +child: + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PManualDealloc_manager.ipdl b/ipc/ipdl/test/ipdl/ok/PManualDealloc_manager.ipdl new file mode 100644 index 0000000000..d425a6781f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PManualDealloc_manager.ipdl @@ -0,0 +1,8 @@ +include protocol PManualDealloc; + +// [ManualDealloc] types must have a manager, as all toplevel protocols are +// refcounted. +[ChildProc=any] +async protocol PManualDealloc_manager { + manages PManualDealloc; +}; diff --git a/ipc/ipdl/test/ipdl/ok/PMessageTainted.ipdl b/ipc/ipdl/test/ipdl/ok/PMessageTainted.ipdl new file mode 100644 index 0000000000..deb10fb7ac --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PMessageTainted.ipdl @@ -0,0 +1,5 @@ +[ChildProc=any] +intr protocol PMessageTainted { +child: + [Tainted] async foo(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PMessageTaintedWithPassback.ipdl b/ipc/ipdl/test/ipdl/ok/PMessageTaintedWithPassback.ipdl new file mode 100644 index 0000000000..8db2c8b742 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PMessageTaintedWithPassback.ipdl @@ -0,0 +1,5 @@ +[ChildProc=any] +intr protocol PMessageTaintedWithPassback { +child: + [Tainted] async foo([NoTaint=passback] int id); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PMyManaged.ipdl b/ipc/ipdl/test/ipdl/ok/PMyManaged.ipdl new file mode 100644 index 0000000000..d6ddb34bf8 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PMyManaged.ipdl @@ -0,0 +1,13 @@ +include protocol PMyManager; + +namespace mozilla { +namespace myns { + +protocol PMyManaged { + manager PMyManager; + child: + async __delete__(Shmem aShmem); +}; + +} // namespace myns +} // namespace mozilla diff --git a/ipc/ipdl/test/ipdl/ok/PMyManager.ipdl b/ipc/ipdl/test/ipdl/ok/PMyManager.ipdl new file mode 100644 index 0000000000..4ed2706ffd --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PMyManager.ipdl @@ -0,0 +1,31 @@ +include protocol PMyManaged; +include MyTypes; // for MyActorPair + +using MyActorEnum from "mozilla/myns/MyActorUtils.h"; +using mozilla::myns::MyData from "mozilla/MyDataTypes.h"; +[MoveOnly] using class mozilla::myns::MyOtherData from "mozilla/MyDataTypes.h"; +[RefCounted] using class mozilla::myns::MyThirdData from "mozilla/MyDataTypes.h"; + +namespace mozilla { +namespace myns { + +[Comparable] union MyUnion { + float; + MyOtherData; +}; + +[ChildProc=any] +sync protocol PMyManager { + manages PMyManaged; + parent: + async __delete__(nsString aNote); + sync SomeMsg(MyActorPair? aActors, MyData[] aMyData) + returns (int32_t x, int32_t y, MyUnion aUnion); + async PMyManaged(); + both: + [Tainted] async AnotherMsg(MyActorEnum aEnum, int32_t aNumber) + returns (MyOtherData aOtherData); +}; + +} // namespace myns +} // namespace mozilla diff --git a/ipc/ipdl/test/ipdl/ok/PNested.ipdl b/ipc/ipdl/test/ipdl/ok/PNested.ipdl new file mode 100644 index 0000000000..94865bca6b --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PNested.ipdl @@ -0,0 +1,8 @@ +[NestedUpTo=inside_cpow, ChildProc=any] +sync protocol PNested { +parent: + [Nested=not] async NotNested(); + [Nested=inside_sync] sync InsideSync(); + [Nested=inside_cpow] async InsideCpow(); + [Nested=inside_cpow] sync InsideCpowSync(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PNullable.ipdl b/ipc/ipdl/test/ipdl/ok/PNullable.ipdl new file mode 100644 index 0000000000..b7b21ff885 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PNullable.ipdl @@ -0,0 +1,22 @@ +[RefCounted] using class nsIURI from "nsIURI.h"; + +union Union { + nullable PNullable; + nullable PNullable[]; + nullable PNullable?; + nullable nsIURI; + nullable nsIURI[]; + nullable nsIURI?; +}; + +[ChildProc=any] +protocol PNullable { +child: + async Msg(nullable PNullable n); + async Msg2(nullable PNullable[] N); + async Msg3(nullable PNullable? n); + async Msg4(nullable nsIURI u); + async Msg5(nullable nsIURI[] u); + async Msg6(nullable nsIURI? u); + async Msg7(Union u); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PSideImpl.ipdl b/ipc/ipdl/test/ipdl/ok/PSideImpl.ipdl new file mode 100644 index 0000000000..4ebb1b8ec3 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PSideImpl.ipdl @@ -0,0 +1,5 @@ +[ParentImpl=virtual, ChildImpl="mozilla::FooBarImpl", ChildProc=any] +async protocol PSideImpl { + parent: + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PStruct.ipdl b/ipc/ipdl/test/ipdl/ok/PStruct.ipdl new file mode 100644 index 0000000000..f76f7db98f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PStruct.ipdl @@ -0,0 +1,11 @@ +struct S { + int i; + double d; +}; + +[ChildProc=any] +sync protocol PStruct { +parent: + sync test(S s) returns (S ss); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PStructComparable.ipdl b/ipc/ipdl/test/ipdl/ok/PStructComparable.ipdl new file mode 100644 index 0000000000..89576368ec --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PStructComparable.ipdl @@ -0,0 +1,11 @@ +[Comparable] struct S { + int i; + double d; +}; + +[ChildProc=any] +sync protocol PStructComparable { +parent: + sync test(S s) returns (S ss); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PSyncSyncManagee.ipdl b/ipc/ipdl/test/ipdl/ok/PSyncSyncManagee.ipdl new file mode 100644 index 0000000000..458f0c83c0 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PSyncSyncManagee.ipdl @@ -0,0 +1,7 @@ +include protocol PSyncSyncManager; + +sync protocol PSyncSyncManagee { + manager PSyncSyncManager; +child: + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PSyncSyncManager.ipdl b/ipc/ipdl/test/ipdl/ok/PSyncSyncManager.ipdl new file mode 100644 index 0000000000..d3fc236ff8 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PSyncSyncManager.ipdl @@ -0,0 +1,12 @@ +include protocol PSyncSyncManagee; + +/* The main reason for this test is that it would have caught a bug + * in the Rust IPDL parser that was treating "sync" like "async" in the + * nested case. + */ +[NestedUpTo=not, ChildProc=any] +sync protocol PSyncSyncManager { + manages PSyncSyncManagee; +parent: + async PSyncSyncManagee(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PUniquePtrBasic.ipdl b/ipc/ipdl/test/ipdl/ok/PUniquePtrBasic.ipdl new file mode 100644 index 0000000000..097dd04684 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PUniquePtrBasic.ipdl @@ -0,0 +1,5 @@ +[ChildProc=any] +protocol PUniquePtrBasic { +child: + async Msg(UniquePtr<int> maybe); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PUniquePtrOfActors.ipdl b/ipc/ipdl/test/ipdl/ok/PUniquePtrOfActors.ipdl new file mode 100644 index 0000000000..24631db712 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PUniquePtrOfActors.ipdl @@ -0,0 +1,11 @@ +include protocol PUniquePtrOfActorsSub; + +[ChildProc=any] +protocol PUniquePtrOfActors { + manages PUniquePtrOfActorsSub; + +child: + async Msg(UniquePtr<PUniquePtrOfActorsSub> p); + + async PUniquePtrOfActorsSub(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PUniquePtrOfActorsSub.ipdl b/ipc/ipdl/test/ipdl/ok/PUniquePtrOfActorsSub.ipdl new file mode 100644 index 0000000000..a60c8e475f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PUniquePtrOfActorsSub.ipdl @@ -0,0 +1,7 @@ +include protocol PUniquePtrOfActors; + +protocol PUniquePtrOfActorsSub { + manager PUniquePtrOfActors; + +child: async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PUniquePtrRecUnion.ipdl b/ipc/ipdl/test/ipdl/ok/PUniquePtrRecUnion.ipdl new file mode 100644 index 0000000000..40ac466b40 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PUniquePtrRecUnion.ipdl @@ -0,0 +1,22 @@ +union X { + int; + Y[]; + UniquePtr<Y>; +}; + +union Y { + X; + Z; +}; + +union Z { + double; + X; +}; + +[ChildProc=any] +protocol PUniquePtrRecUnion { +child: + async Test(X x, Y y, Z z); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PUniquePtrUnion.ipdl b/ipc/ipdl/test/ipdl/ok/PUniquePtrUnion.ipdl new file mode 100644 index 0000000000..de4529c639 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PUniquePtrUnion.ipdl @@ -0,0 +1,11 @@ +union UniquePtrUnion { + int[]; + int; + double; +}; + +[ChildProc=any] +sync protocol PUniquePtrUnion { +parent: + async Msg(UniquePtrUnion u, UniquePtr<UniquePtrUnion> au) returns (UniquePtrUnion r); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PVirtualSendImpl.ipdl b/ipc/ipdl/test/ipdl/ok/PVirtualSendImpl.ipdl new file mode 100644 index 0000000000..ff09108965 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PVirtualSendImpl.ipdl @@ -0,0 +1,6 @@ +[ChildProc=any] +async protocol PVirtualSendImpl +{ +child: + [VirtualSendImpl] async MockableFoo(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pactorparam.ipdl b/ipc/ipdl/test/ipdl/ok/Pactorparam.ipdl new file mode 100644 index 0000000000..bb7bb85518 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pactorparam.ipdl @@ -0,0 +1,6 @@ +[ChildProc=any] +protocol Pactorparam { + +child: async Msg(Pactorparam p); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pactorreturn.ipdl b/ipc/ipdl/test/ipdl/ok/Pactorreturn.ipdl new file mode 100644 index 0000000000..4e8e53a9d6 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pactorreturn.ipdl @@ -0,0 +1,7 @@ +[ChildProc=any] +sync protocol Pactorreturn { + +parent: + sync Msg(Pactorreturn p) returns (Pactorreturn r); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Parray_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/Parray_Basic.ipdl new file mode 100644 index 0000000000..7ce682f154 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Parray_Basic.ipdl @@ -0,0 +1,5 @@ +[ChildProc=any] +protocol Parray_Basic { +child: + async Msg(int[] array); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Parray_OfActors.ipdl b/ipc/ipdl/test/ipdl/ok/Parray_OfActors.ipdl new file mode 100644 index 0000000000..170f4e902a --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Parray_OfActors.ipdl @@ -0,0 +1,11 @@ +include protocol Parray_OfActorsSub; + +[ChildProc=any] +protocol Parray_OfActors { + manages Parray_OfActorsSub; + +child: + async Msg(Parray_OfActorsSub[] p); + + async Parray_OfActorsSub(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Parray_OfActorsSub.ipdl b/ipc/ipdl/test/ipdl/ok/Parray_OfActorsSub.ipdl new file mode 100644 index 0000000000..6769e98abb --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Parray_OfActorsSub.ipdl @@ -0,0 +1,7 @@ +include protocol Parray_OfActors; + +protocol Parray_OfActorsSub { + manager Parray_OfActors; + +child: async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Parray_Union.ipdl b/ipc/ipdl/test/ipdl/ok/Parray_Union.ipdl new file mode 100644 index 0000000000..2733d5fc04 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Parray_Union.ipdl @@ -0,0 +1,11 @@ +union Union { + int[]; + int; + double; +}; + +[ChildProc=any] +sync protocol Parray_Union { +parent: + sync Msg(Union u, Union[] au) returns (Union r); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PbasicUsing.ipdl b/ipc/ipdl/test/ipdl/ok/PbasicUsing.ipdl new file mode 100644 index 0000000000..94d57b08d0 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PbasicUsing.ipdl @@ -0,0 +1,51 @@ +using SomeType from "SomeFile.h"; +using class SomeClass from "SomeFile.h"; +using struct SomeStruct from "SomeFile.h"; + +[RefCounted] using SomeRefcountedType from "SomeFile.h"; +[RefCounted] using class SomeRefcountedClass from "SomeFile.h"; +[RefCounted] using struct SomeRefcountedStruct from "SomeFile.h"; + +[MoveOnly] using SomeMoveonlyType from "SomeFile.h"; +[MoveOnly] using class SomeMoveonlyClass from "SomeFile.h"; +[MoveOnly] using struct SomeMoveonlyStruct from "SomeFile.h"; + +[RefCounted, MoveOnly] using SomeRefcountedMoveonlyType from "SomeFile.h"; +[RefCounted, MoveOnly] using class SomeRefcountedMoveonlyClass from "SomeFile.h"; +[RefCounted, MoveOnly] using struct SomeRefcountedMoveonlyStruct from "SomeFile.h"; + +[MoveOnly=data] using SomeMoveonlyDataType from "SomeFile.h"; +[MoveOnly=data] using class SomeMoveonlyDataClass from "SomeFile.h"; +[MoveOnly=data] using struct SomeMoveonlyDataStruct from "SomeFile.h"; + +[MoveOnly=send] using SomeMoveonlySendType from "SomeFile.h"; +[MoveOnly=send] using class SomeMoveonlySendClass from "SomeFile.h"; +[MoveOnly=send] using struct SomeMoveonlySendStruct from "SomeFile.h"; + +union SomeUnion +{ + SomeType; + SomeClass; + SomeStruct; + SomeRefcountedType; + SomeRefcountedClass; + SomeRefcountedStruct; + SomeMoveonlyType; + SomeMoveonlyClass; + SomeMoveonlyStruct; + SomeRefcountedMoveonlyType; + SomeRefcountedMoveonlyClass; + SomeRefcountedMoveonlyStruct; + SomeMoveonlyDataType; + SomeMoveonlyDataClass; + SomeMoveonlyDataStruct; + SomeMoveonlySendType; + SomeMoveonlySendClass; + SomeMoveonlySendStruct; +}; + +[ChildProc=any] +protocol PbasicUsing { +child: + async Msg(SomeUnion foo); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pbuiltins.ipdl b/ipc/ipdl/test/ipdl/ok/Pbuiltins.ipdl new file mode 100644 index 0000000000..3cd023a0b6 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pbuiltins.ipdl @@ -0,0 +1,22 @@ +[ChildProc=any] +protocol Pbuiltins { + + // sanity-check that "essential" builtins are being declared + +child: async Msg(bool b, + char c, + int i, + long l, + + float f, + double d, + + int8_t i8t, + uint8_t u8t, + int16_t i16t, + uint16_t u16t, + int32_t i32t, + uint32_t u32t, + int64_t i64t, + uint64_t u64t); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pbytebuf.ipdl b/ipc/ipdl/test/ipdl/ok/Pbytebuf.ipdl new file mode 100644 index 0000000000..a0ceac937f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pbytebuf.ipdl @@ -0,0 +1,14 @@ +union Foo { + int; + ByteBuf; +}; + +[ChildProc=any] +intr protocol Pbytebuf { +parent: + async Msg(ByteBuf s, Foo f); + sync SyncMsg(ByteBuf s, Foo f) + returns (ByteBuf t, Foo g); + [LegacyIntr] intr InterruptMsg(ByteBuf s, Foo f) + returns (ByteBuf t, Foo g); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pempty.ipdl b/ipc/ipdl/test/ipdl/ok/Pempty.ipdl new file mode 100644 index 0000000000..4ab603dbc8 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pempty.ipdl @@ -0,0 +1,4 @@ +[ChildProc=any] +protocol Pempty { +child: async Msg(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PemptyStruct.ipdl b/ipc/ipdl/test/ipdl/ok/PemptyStruct.ipdl new file mode 100644 index 0000000000..a3317cb872 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PemptyStruct.ipdl @@ -0,0 +1,4 @@ +struct empty { }; + +[ChildProc=any] +protocol PemptyStruct { child: async __delete__(); }; diff --git a/ipc/ipdl/test/ipdl/ok/PheaderProto.ipdl b/ipc/ipdl/test/ipdl/ok/PheaderProto.ipdl new file mode 100644 index 0000000000..5c9af7c3f9 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PheaderProto.ipdl @@ -0,0 +1,11 @@ +include header; + +namespace c { + +[ChildProc=any] +protocol PheaderProto { +child: + async __delete__(foo a, baz b, Inner1 c, Inner2 d, X x); +}; + +} diff --git a/ipc/ipdl/test/ipdl/ok/PintrProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/PintrProtocol.ipdl new file mode 100644 index 0000000000..4b663327e6 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PintrProtocol.ipdl @@ -0,0 +1,14 @@ +[ChildProc=any] +intr protocol PintrProtocol { + + // sanity check of Interrupt protocols +child: + async AsyncMsg(); + +parent: + sync SyncMsg(int i) returns (int r); + +both: + [LegacyIntr] intr InterruptMsg(int x) returns (int y); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pjetpack.ipdl b/ipc/ipdl/test/ipdl/ok/Pjetpack.ipdl new file mode 100644 index 0000000000..7744f59f8f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pjetpack.ipdl @@ -0,0 +1,6 @@ +[ChildProc=any] +sync protocol Pjetpack { +child: + async __delete__(); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmanageSelf.ipdl b/ipc/ipdl/test/ipdl/ok/PmanageSelf.ipdl new file mode 100644 index 0000000000..992f374a58 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmanageSelf.ipdl @@ -0,0 +1,10 @@ +include protocol PmanageSelf_Toplevel; + +protocol PmanageSelf { + manager PmanageSelf_Toplevel or PmanageSelf; + manages PmanageSelf; + +child: + async PmanageSelf(); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmanageSelf_Toplevel.ipdl b/ipc/ipdl/test/ipdl/ok/PmanageSelf_Toplevel.ipdl new file mode 100644 index 0000000000..15be35f838 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmanageSelf_Toplevel.ipdl @@ -0,0 +1,10 @@ +include protocol PmanageSelf; + +[ChildProc=any] +protocol PmanageSelf_Toplevel { + manages PmanageSelf; + +child: + async PmanageSelf(); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmanagedProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/PmanagedProtocol.ipdl new file mode 100644 index 0000000000..cab07d06e7 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmanagedProtocol.ipdl @@ -0,0 +1,8 @@ +include protocol PmanagerProtocol; + +protocol PmanagedProtocol { + manager PmanagerProtocol; + +child: + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmanagerProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/PmanagerProtocol.ipdl new file mode 100644 index 0000000000..28483426d3 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmanagerProtocol.ipdl @@ -0,0 +1,12 @@ +include protocol PmanagedProtocol; + +// sanity check of managed/manager protocols + +[ChildProc=any] +protocol PmanagerProtocol { + manages PmanagedProtocol; + +parent: + async PmanagedProtocol(int i); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pmaybe_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/Pmaybe_Basic.ipdl new file mode 100644 index 0000000000..52243d5ca3 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pmaybe_Basic.ipdl @@ -0,0 +1,5 @@ +[ChildProc=any] +protocol Pmaybe_Basic { +child: + async Msg(int? maybe); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pmaybe_OfActors.ipdl b/ipc/ipdl/test/ipdl/ok/Pmaybe_OfActors.ipdl new file mode 100644 index 0000000000..2252c32827 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pmaybe_OfActors.ipdl @@ -0,0 +1,11 @@ +include protocol Pmaybe_OfActorsSub; + +[ChildProc=any] +protocol Pmaybe_OfActors { + manages Pmaybe_OfActorsSub; + +child: + async Msg(Pmaybe_OfActorsSub? p); + + async Pmaybe_OfActorsSub(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pmaybe_OfActorsSub.ipdl b/ipc/ipdl/test/ipdl/ok/Pmaybe_OfActorsSub.ipdl new file mode 100644 index 0000000000..6a4759953f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pmaybe_OfActorsSub.ipdl @@ -0,0 +1,7 @@ +include protocol Pmaybe_OfActors; + +protocol Pmaybe_OfActorsSub { + manager Pmaybe_OfActors; + +child: async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pmaybe_Union.ipdl b/ipc/ipdl/test/ipdl/ok/Pmaybe_Union.ipdl new file mode 100644 index 0000000000..5701b08fd9 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pmaybe_Union.ipdl @@ -0,0 +1,11 @@ +union MaybeUnion { + int[]; + int; + double; +}; + +[ChildProc=any] +sync protocol Pmaybe_Union { +parent: + async Msg(MaybeUnion u, MaybeUnion? au) returns (MaybeUnion r); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pmedia.ipdl b/ipc/ipdl/test/ipdl/ok/Pmedia.ipdl new file mode 100644 index 0000000000..e0f95d2a34 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pmedia.ipdl @@ -0,0 +1,6 @@ +[ChildProc=any] +sync protocol Pmedia { +child: + async __delete__(); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmessageCompress.ipdl b/ipc/ipdl/test/ipdl/ok/PmessageCompress.ipdl new file mode 100644 index 0000000000..7e14c888dd --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmessageCompress.ipdl @@ -0,0 +1,6 @@ +[ChildProc=any] +intr protocol PmessageCompress { +child: + [Compress] async foo(); + [Compress=all] async bar(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmultiManaged.ipdl b/ipc/ipdl/test/ipdl/ok/PmultiManaged.ipdl new file mode 100644 index 0000000000..d8c47fc9e3 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmultiManaged.ipdl @@ -0,0 +1,9 @@ +include protocol PmultiManager1; +include protocol PmultiManager2; + +protocol PmultiManaged { + manager PmultiManager1 or PmultiManager2; + +child: + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmultiManager1.ipdl b/ipc/ipdl/test/ipdl/ok/PmultiManager1.ipdl new file mode 100644 index 0000000000..ec38412422 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmultiManager1.ipdl @@ -0,0 +1,9 @@ +include protocol PmultiManaged; + +[ChildProc=any] +protocol PmultiManager1 { + manages PmultiManaged; + +child: + async PmultiManaged(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmultiManager2.ipdl b/ipc/ipdl/test/ipdl/ok/PmultiManager2.ipdl new file mode 100644 index 0000000000..b8295fd057 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmultiManager2.ipdl @@ -0,0 +1,9 @@ +include protocol PmultiManaged; + +[ChildProc=any] +protocol PmultiManager2 { + manages PmultiManaged; + +child: + async PmultiManaged(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmultipleUsingCxxTypes.ipdl b/ipc/ipdl/test/ipdl/ok/PmultipleUsingCxxTypes.ipdl new file mode 100644 index 0000000000..5d5ae5e9a8 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmultipleUsingCxxTypes.ipdl @@ -0,0 +1,8 @@ +using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; +using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; + +[ChildProc=any] +protocol PmultipleUsingCxxTypes { +child: + async Msg(void_t foo); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmutualRecStructUnion.ipdl b/ipc/ipdl/test/ipdl/ok/PmutualRecStructUnion.ipdl new file mode 100644 index 0000000000..b28df7969b --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmutualRecStructUnion.ipdl @@ -0,0 +1,22 @@ +struct X { + int i; + Y[] y; +}; + +union Y { + double; + X; + Z; +}; + +struct Z { + X x; + Y y; +}; + +[ChildProc=any] +protocol PmutualRecStructUnion { +child: + async Test(X x, Y y, Z z); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PmutualRecUnion.ipdl b/ipc/ipdl/test/ipdl/ok/PmutualRecUnion.ipdl new file mode 100644 index 0000000000..73c869278f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PmutualRecUnion.ipdl @@ -0,0 +1,22 @@ +union X { + int; + Y[]; + Y?; +}; + +union Y { + X; + Z; +}; + +union Z { + double; + X; +}; + +[ChildProc=any] +protocol PmutualRecUnion { +child: + async Test(X x, Y y, Z z); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pnamespace_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/Pnamespace_Basic.ipdl new file mode 100644 index 0000000000..3b2f2fa27f --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pnamespace_Basic.ipdl @@ -0,0 +1,13 @@ +namespace basic { + +// sanity check of namespaced protocols + +[ChildProc=any] +protocol Pnamespace_Basic { + +child: + async Msg(); + +}; + +} // namespace basic diff --git a/ipc/ipdl/test/ipdl/ok/PnoRedeclCrossMessage.ipdl b/ipc/ipdl/test/ipdl/ok/PnoRedeclCrossMessage.ipdl new file mode 100644 index 0000000000..30c7179e8c --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PnoRedeclCrossMessage.ipdl @@ -0,0 +1,10 @@ +[ChildProc=any] +protocol PnoRedeclCrossMessage { + + // each message has its own scope for param/return names + +child: + async Msg1(int f); + async Msg2(int f); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pplugin.ipdl b/ipc/ipdl/test/ipdl/ok/Pplugin.ipdl new file mode 100644 index 0000000000..f7d9352a08 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pplugin.ipdl @@ -0,0 +1,6 @@ +[ChildProc=any] +intr protocol Pplugin { +child: + async __delete__(); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Prio.ipdl b/ipc/ipdl/test/ipdl/ok/Prio.ipdl new file mode 100644 index 0000000000..fdda57f784 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Prio.ipdl @@ -0,0 +1,12 @@ +[ChildProc=any] +async protocol Prio +{ +child: + [Priority=normal] async NormalPrio(); + [Priority=vsync] async VsyncPrio(); + [Priority=input] async InputPrio(); + [Priority=mediumhigh] async MediumHighPrio(); + [Priority=control] async ControlPrio(); + [ReplyPriority=control] async ControlPrioReturns() returns (bool aValue); + [Priority=normal, ReplyPriority=control] async NormalControlPrioReturns() returns (bool aValue); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PselfRecUnion.ipdl b/ipc/ipdl/test/ipdl/ok/PselfRecUnion.ipdl new file mode 100644 index 0000000000..9d5e3de487 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PselfRecUnion.ipdl @@ -0,0 +1,12 @@ +union R { + int; + double; + R; +}; + +[ChildProc=any] +protocol PselfRecUnion { +child: + async Test(R r); + async __delete__(); +}; diff --git a/ipc/ipdl/test/ipdl/ok/Pshmem.ipdl b/ipc/ipdl/test/ipdl/ok/Pshmem.ipdl new file mode 100644 index 0000000000..a46e777d8c --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Pshmem.ipdl @@ -0,0 +1,14 @@ +union Foo { + int; + Shmem; +}; + +[ChildProc=any] +intr protocol Pshmem { +parent: + async Msg(Shmem s, Foo f); + sync SyncMsg(Shmem s, Foo f) + returns (Shmem t, Foo g); + [LegacyIntr] intr InterruptMsg(Shmem s, Foo f) + returns (Shmem t, Foo g); +}; diff --git a/ipc/ipdl/test/ipdl/ok/PsyncProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/PsyncProtocol.ipdl new file mode 100644 index 0000000000..f73be554e4 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PsyncProtocol.ipdl @@ -0,0 +1,12 @@ +[ChildProc=any] +sync protocol PsyncProtocol { + + // sanity check of sync protocols + +child: + async AsyncMsg(); + +parent: + sync SyncMsg() returns (int i); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/PthreeDirections.ipdl b/ipc/ipdl/test/ipdl/ok/PthreeDirections.ipdl new file mode 100644 index 0000000000..6474ca5d0d --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/PthreeDirections.ipdl @@ -0,0 +1,14 @@ +[ChildProc=any] +protocol PthreeDirections { + + // sanity check that the three direction specifiers are being accepted +child: + async ChildMsg(); + +parent: + async ParentMsg(); + +both: + async BothMsg(); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Punion_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/Punion_Basic.ipdl new file mode 100644 index 0000000000..a049d52e75 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Punion_Basic.ipdl @@ -0,0 +1,12 @@ +union Basic { + int; + double; +}; + +[ChildProc=any] +sync protocol Punion_Basic { + +parent: + sync Msg(Basic p) returns (Basic r); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Punion_Comparable.ipdl b/ipc/ipdl/test/ipdl/ok/Punion_Comparable.ipdl new file mode 100644 index 0000000000..05b26f32aa --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Punion_Comparable.ipdl @@ -0,0 +1,12 @@ +[Comparable] union Basic { + int; + double; +}; + +[ChildProc=any] +sync protocol Punion_Comparable { + +parent: + sync Msg(Basic p) returns (Basic r); + +}; diff --git a/ipc/ipdl/test/ipdl/ok/Punion_Namespaced.ipdl b/ipc/ipdl/test/ipdl/ok/Punion_Namespaced.ipdl new file mode 100644 index 0000000000..4108dfd4df --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/Punion_Namespaced.ipdl @@ -0,0 +1,19 @@ +namespace kitties { + +union Socks { + int; + double; +}; + +} // namespace kitties + + +namespace puppies { + +[ChildProc=any] +protocol Punion_Namespaced { +child: + async Msg(Socks s); +}; + +} // namespace puppies diff --git a/ipc/ipdl/test/ipdl/ok/header.ipdlh b/ipc/ipdl/test/ipdl/ok/header.ipdlh new file mode 100644 index 0000000000..fc3f8c8279 --- /dev/null +++ b/ipc/ipdl/test/ipdl/ok/header.ipdlh @@ -0,0 +1,15 @@ +using foo from "foo.h"; +using bar::baz from "foo.h"; + +struct Outer { }; + +namespace a { struct Inner1 { }; } + +namespace b { struct Inner2 { }; } + +namespace c { +union X { + int32_t; + float; +}; +} |