Bug 1600605, add support for mediumhigh priority ipdl messages, r=jld

Differential Revision: https://phabricator.services.mozilla.com/D57013

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Olli Pettay 2019-12-13 22:38:15 +00:00
parent cb595530fa
commit 667df300dc
8 changed files with 17 additions and 4 deletions

View file

@ -65,6 +65,7 @@ class Message : public Pickle {
NORMAL_PRIORITY = 0,
INPUT_PRIORITY = 1,
HIGH_PRIORITY = 2,
MEDIUMHIGH_PRIORITY = 3,
};
enum MessageCompression {

View file

@ -2072,6 +2072,9 @@ MessageChannel::MessageTask::GetPriority(uint32_t* aPriority) {
case Message::HIGH_PRIORITY:
*aPriority = PRIORITY_HIGH;
break;
case Message::MEDIUMHIGH_PRIORITY:
*aPriority = PRIORITY_MEDIUMHIGH;
break;
default:
MOZ_ASSERT(false);
break;

View file

@ -9,7 +9,7 @@ INSIDE_CPOW_NESTED = 3
NORMAL_PRIORITY = 1
INPUT_PRIORITY = 2
HIGH_PRIORITY = 3
MEDIUMHIGH_PRIORITY = 4
class Visitor:
def defaultVisit(self, node):

View file

@ -1799,8 +1799,10 @@ def _generateMessageConstructor(md, segmentSize, protocol, forReply=False):
prioEnum = 'NORMAL_PRIORITY'
elif prio == ipdl.ast.INPUT_PRIORITY:
prioEnum = 'INPUT_PRIORITY'
else:
elif prio == ipdl.ast.HIGH_PRIORITY:
prioEnum = 'HIGH_PRIORITY'
else:
prioEnum = 'MEDIUMHIGH_PRIORITY'
if md.decl.type.isSync():
syncEnum = 'SYNC'

View file

@ -563,9 +563,10 @@ def p_Priority(p):
"""Priority : ID"""
kinds = {'normal': 1,
'input': 2,
'high': 3}
'high': 3,
'mediumhigh': 4}
if p[1] not in kinds:
_error(locFromTok(p, 1), "Expected normal or high for prio()")
_error(locFromTok(p, 1), "Expected normal, input, high or mediumhigh for prio()")
p[0] = {'prio': kinds[p[1]]}

View file

@ -141,6 +141,8 @@ description =
description =
[PTestPriority::PMsg4]
description =
[PTestPriority::PMsg6]
description =
[PTestRPC::Test1_Start]
description =
[PTestRPC::Test1_InnerEvent]

View file

@ -7,10 +7,13 @@ parent:
prio(input) sync PMsg2();
prio(high) async PMsg3();
prio(high) sync PMsg4();
prio(mediumhigh) async PMsg5();
prio(mediumhigh) sync PMsg6();
child:
prio(input) async CMsg1();
prio(high) async CMsg2();
prio(mediumhigh) async CMsg3();
};
} // namespace _ipdltest

View file

@ -4,4 +4,5 @@ child:
prio(normal) async NormalPrio();
prio(high) async HighPrio();
prio(input) async InputPrio();
prio(mediumhigh) async MediumHighPrio();
};