Skip to content

Commit

Permalink
Bug 1746289 - Deprecate the IPDL intr keyword and tag legacy uses i…
Browse files Browse the repository at this point in the history
…n tests. r=nika

At this point, the only remaining uses of `intr` are in test files.  To
avoid the possibility of adding any more (until such time as we deal
with the tests and can get rid of `intr` entirely), this patch requires
a `[LegacyIntr]` attribute on any declaration that uses them, and tags
all the uses in tests with that attribute.

Differential Revision: https://phabricator.services.mozilla.com/D133964
  • Loading branch information
jld committed Jan 5, 2022
1 parent 5b7b239 commit e08e750
Show file tree
Hide file tree
Showing 33 changed files with 60 additions and 52 deletions.
8 changes: 8 additions & 0 deletions ipc/ipdl/ipdl/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,17 @@ def visitMessageDecl(self, md):
"Compress": (None, "all"),
"Priority": ("normal", "input", "vsync", "mediumhigh", "control"),
"Nested": ("not", "inside_sync", "inside_cpow"),
"LegacyIntr": None,
},
)

if md.sendSemantics is INTR and "LegacyIntr" not in md.attributes:
self.error(
loc,
"intr message `%s' allowed only with [LegacyIntr]; DO NOT USE IN SHIPPING CODE",
msgname,
)

if md.sendSemantics is INTR and "Priority" in md.attributes:
self.error(loc, "intr message `%s' cannot specify [Priority]", msgname)

Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestBadActorSub.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ intr protocol PTestBadActorSub {
manager PTestBadActor;

child:
intr __delete__();
[LegacyIntr] intr __delete__();

parent:
async Ping();
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestCrashCleanup.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace _ipdltest {
// NB: needs to be RPC so that the parent blocks on the child's crash.
intr protocol PTestCrashCleanup {
child:
intr DIEDIEDIE();
[LegacyIntr] intr DIEDIEDIE();
async __delete__();
};

Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestDesc.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace _ipdltest {
intr protocol PTestDesc {
manages PTestDescSub;
child:
intr PTestDescSub(nullable PTestDescSubsub dummy);
[LegacyIntr] intr PTestDescSub(nullable PTestDescSubsub dummy);

async Test(PTestDescSubsub a);

Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestDescSub.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ intr protocol PTestDescSub {
child:
async __delete__();

intr PTestDescSubsub();
[LegacyIntr] intr PTestDescSubsub();
};

}
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestDescSubsub.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ intr protocol PTestDescSubsub {
manager PTestDescSub;

child:
intr __delete__();
[LegacyIntr] intr __delete__();
};

}
Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestEndpointBridgeMainSub.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ namespace _ipdltest {
intr protocol PTestEndpointBridgeMainSub {
child:
async Hi();
intr HiRpc();
[LegacyIntr] intr HiRpc();

parent:
async Hello();
sync HelloSync();
intr HelloRpc();
[LegacyIntr] intr HelloRpc();
};


Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestEndpointOpensOpened.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ namespace _ipdltest2 {
intr protocol PTestEndpointOpensOpened {
child:
async Hi();
intr HiRpc();
[LegacyIntr] intr HiRpc();

parent:
async Hello();
sync HelloSync();
intr HelloRpc();
[LegacyIntr] intr HelloRpc();
async __delete__();
};

Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestFailedCtor.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace _ipdltest {
intr protocol PTestFailedCtor {
manages PTestFailedCtorSub;
child:
intr PTestFailedCtorSub();
[LegacyIntr] intr PTestFailedCtorSub();
async __delete__();
};

Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestHangs.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ namespace _ipdltest {

intr protocol PTestHangs {
both:
intr StackFrame();
[LegacyIntr] intr StackFrame();

parent:
async Nonce();

child:
async Start();
intr Hang();
[LegacyIntr] intr Hang();
async __delete__();
};

Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestInterruptErrorCleanup.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ namespace _ipdltest {

intr protocol PTestInterruptErrorCleanup {
child:
intr Error();
intr __delete__();
[LegacyIntr] intr Error();
[LegacyIntr] intr __delete__();
};

} // namespace _ipdltest
Expand Down
10 changes: 5 additions & 5 deletions ipc/ipdl/test/cxx/PTestInterruptRaces.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ namespace _ipdltest {

intr protocol PTestInterruptRaces {
both:
intr Race() returns (bool hasReply);
intr StackFrame() returns ();
intr StackFrame3() returns ();
[LegacyIntr] intr Race() returns (bool hasReply);
[LegacyIntr] intr StackFrame() returns ();
[LegacyIntr] intr StackFrame3() returns ();

parent:
sync StartRace();
intr Parent();
[LegacyIntr] intr Parent();
sync GetAnsweredParent() returns (bool answeredParent);

child:
async Start();
async Wakeup();
async Wakeup3();
intr Child();
[LegacyIntr] intr Child();
async __delete__();
};

Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestInterruptShutdownRace.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parent:

child:
async Start();
intr Exit();
[LegacyIntr] intr Exit();
async __delete__();
};

Expand Down
6 changes: 3 additions & 3 deletions ipc/ipdl/test/cxx/PTestLatency.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ child:
async __delete__();
async Ping();
async Ping5();
intr Rpc();
[LegacyIntr] intr Rpc();
async Spam();
intr Synchro();
[LegacyIntr] intr Synchro();
[Compress] async CompressedSpam(uint32_t seqno);
intr Synchro2() returns (uint32_t lastSeqno,
[LegacyIntr] intr Synchro2() returns (uint32_t lastSeqno,
uint32_t numMessagesDispatched);

parent:
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestNestedLoops.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ intr protocol PTestNestedLoops {

child:
async Start();
intr R();
[LegacyIntr] intr R();
async __delete__();

parent:
Expand Down
6 changes: 3 additions & 3 deletions ipc/ipdl/test/cxx/PTestRaceDeadlock.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ both:
async StartRace();

parent:
intr Lose();
[LegacyIntr] intr Lose();

child:
intr Win();
intr Rpc();
[LegacyIntr] intr Win();
[LegacyIntr] intr Rpc();
async __delete__();

/* Tests that race resolution does not cause deadlocks */
Expand Down
6 changes: 3 additions & 3 deletions ipc/ipdl/test/cxx/PTestRaceDeferral.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ namespace _ipdltest {

intr protocol PTestRaceDeferral {
parent:
intr Lose();
[LegacyIntr] intr Lose();

child:
async StartRace();
intr Win();
intr Rpc();
[LegacyIntr] intr Win();
[LegacyIntr] intr Rpc();
async __delete__();

// Test that messages deferred due to race resolution are
Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestRacyInterruptReplies.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ namespace _ipdltest {

intr protocol PTestRacyInterruptReplies {
child:
intr R_() returns (int replyNum);
[LegacyIntr] intr R_() returns (int replyNum);
async _A();
async ChildTest();
async __delete__();

parent:
intr _R() returns (int replyNum);
[LegacyIntr] intr _R() returns (int replyNum);
async A_();
};

Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestRacyReentry.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ namespace _ipdltest {
intr protocol PTestRacyReentry {

parent:
intr E();
[LegacyIntr] intr E();
async __delete__();

child:
async Start();

async N();
intr H();
[LegacyIntr] intr H();
};


Expand Down
6 changes: 3 additions & 3 deletions ipc/ipdl/test/cxx/PTestRacyUndefer.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ child:
async AwakenSpam();
async AwakenRaceWinTwice();

intr Race();
[LegacyIntr] intr Race();

async __delete__();

parent:

intr Spam();
intr RaceWinTwice();
[LegacyIntr] intr Spam();
[LegacyIntr] intr RaceWinTwice();

async Done();
};
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestShutdownSub.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ intr protocol PTestShutdownSub {
manages PTestShutdownSubsub;

both:
intr StackFrame();
[LegacyIntr] intr StackFrame();

parent:
async PTestShutdownSubsub(bool expectParentDeleted);
Expand Down
4 changes: 2 additions & 2 deletions ipc/ipdl/test/cxx/PTestStackHooks.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ child:
parent:
async Async();
sync Sync();
intr Rpc();
[LegacyIntr] intr Rpc();

both:
intr StackFrame();
[LegacyIntr] intr StackFrame();

parent:
async __delete__();
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/cxx/PTestSyncWakeup.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace _ipdltest {

intr protocol PTestSyncWakeup {
both:
intr StackFrame();
[LegacyIntr] intr StackFrame();

child:
async Start();
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/error/PIntrNested.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

intr protocol PIntrNested {
child:
[Nested=inside_sync] intr Msg();
[Nested=inside_sync, LegacyIntr] intr Msg();
};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/error/PIntrNestedProtocol.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

[NestedUpTo=inside_sync] intr protocol PIntrNestedProtocol {
child:
intr Msg();
[LegacyIntr] intr Msg();
};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/error/PIntrPriority.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

intr protocol PIntrPriority {
child:
[Priority=vsync] intr Msg();
[Priority=vsync, LegacyIntr] intr Msg();
};
4 changes: 2 additions & 2 deletions ipc/ipdl/test/ipdl/error/intrMessageCompress.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

intr protocol intrMessageCompress {
parent:
[Compress] intr foo();
[Compress, LegacyIntr] intr foo();
child:
[Compress] intr bar();
[Compress, LegacyIntr] intr bar();
};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/error/tooWeakIntrAsync.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ protocol tooWeakIntrAsync {

// it's an error to declare an async protocol with an intr message

parent: intr Msg();
parent: [LegacyIntr] intr Msg();

};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/error/tooWeakIntrSync.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ sync protocol tooWeakIntrSync {

// it's an error to declare a sync protocol with an interrupt message
parent:
intr Msg();
[LegacyIntr] intr Msg();
};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/error/unknownIntrMessage.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

intr protocol unknownIntrMessage {
parent:
intr Msg();
[LegacyIntr] intr Msg();
};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/ok/Pbytebuf.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ parent:
async Msg(ByteBuf s, Foo f);
sync SyncMsg(ByteBuf s, Foo f)
returns (ByteBuf t, Foo g);
intr InterruptMsg(ByteBuf s, Foo f)
[LegacyIntr] intr InterruptMsg(ByteBuf s, Foo f)
returns (ByteBuf t, Foo g);
};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/ok/PintrProtocol.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ parent:
sync SyncMsg(int i) returns (int r);

both:
intr InterruptMsg(int x) returns (int y);
[LegacyIntr] intr InterruptMsg(int x) returns (int y);

};
2 changes: 1 addition & 1 deletion ipc/ipdl/test/ipdl/ok/Pshmem.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ parent:
async Msg(Shmem s, Foo f);
sync SyncMsg(Shmem s, Foo f)
returns (Shmem t, Foo g);
intr InterruptMsg(Shmem s, Foo f)
[LegacyIntr] intr InterruptMsg(Shmem s, Foo f)
returns (Shmem t, Foo g);
};

0 comments on commit e08e750

Please sign in to comment.