michael@0: namespace mozilla { michael@0: namespace _ipdltest { michael@0: michael@0: intr protocol PTestRaceDeferral { michael@0: parent: michael@0: intr Lose(); michael@0: michael@0: child: michael@0: async StartRace(); michael@0: intr Win(); michael@0: intr Rpc(); michael@0: async __delete__(); michael@0: michael@0: // Test that messages deferred due to race resolution are michael@0: // re-considered when the winner makes later RPCs michael@0: michael@0: // IPDL's type system can't express this protocol because the race michael@0: // resolution causes state to diverge for multiple steps, so we'll michael@0: // leave it "stateless" michael@0: /* michael@0: state START: michael@0: send StartRace goto DEFER; michael@0: state DEFER: michael@0: call Win goto PARENT; michael@0: answer Lose goto CHILD; michael@0: michael@0: state PARENT: michael@0: // 'Lose' is received here but deferred michael@0: call Rpc goto PARENT_LOSE; michael@0: state PARENT_LOSE: michael@0: // Calling 'Rpc' undefers 'Lose', and it wins the "race" with 'Rpc' michael@0: answer Lose goto DONE; michael@0: michael@0: state CHILD: michael@0: call Win goto CHILD_RPC; michael@0: state CHILD_RPC: michael@0: call Rpc goto DONE; michael@0: michael@0: state DONE: michael@0: send __delete__; michael@0: */ michael@0: }; michael@0: michael@0: } // namespace _ipdltest michael@0: } // namespace mozilla