Bug 1708042, add support for 'control' priority in ipdl, r=jld,ipc-reviewers

Depends on D115404

Differential Revision: https://phabricator.services.mozilla.com/D115405
This commit is contained in:
Olli Pettay 2021-05-21 15:46:46 +00:00
Родитель 19f47e75ab
Коммит e5eb74b09d
8 изменённых файлов: 25 добавлений и 12 удалений

Просмотреть файл

@ -63,6 +63,7 @@ class Message : public Pickle {
INPUT_PRIORITY = 1,
VSYNC_PRIORITY = 2,
MEDIUMHIGH_PRIORITY = 3,
CONTROL_PRIORITY = 4,
};
enum MessageCompression {
@ -96,17 +97,16 @@ class Message : public Pickle {
enum {
NESTED_MASK = 0x0003,
PRIO_MASK = 0x000C,
SYNC_BIT = 0x0010,
REPLY_BIT = 0x0020,
REPLY_ERROR_BIT = 0x0040,
INTERRUPT_BIT = 0x0080,
COMPRESS_BIT = 0x0100,
COMPRESSALL_BIT = 0x0200,
COMPRESS_MASK = 0x0300,
CONSTRUCTOR_BIT = 0x0400,
PRIO_MASK = 0x001C,
SYNC_BIT = 0x0020,
REPLY_BIT = 0x0040,
REPLY_ERROR_BIT = 0x0080,
INTERRUPT_BIT = 0x0100,
COMPRESS_BIT = 0x0200,
COMPRESSALL_BIT = 0x0400,
CONSTRUCTOR_BIT = 0x0800,
#ifdef MOZ_TASK_TRACER
TASKTRACER_BIT = 0x0800,
TASKTRACER_BIT = 0x1000,
#endif
};

Просмотреть файл

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

Просмотреть файл

@ -13,6 +13,7 @@ NORMAL_PRIORITY = 1
INPUT_PRIORITY = 2
VSYNC_PRIORITY = 3
MEDIUMHIGH_PRIORITY = 4
CONTROL_PRIORITY = 5
class Visitor:
@ -351,6 +352,7 @@ class MessageDecl(Node):
"input": INPUT_PRIORITY,
"vsync": VSYNC_PRIORITY,
"mediumhigh": MEDIUMHIGH_PRIORITY,
"control": CONTROL_PRIORITY,
}[self.attributes["Priority"].value]

Просмотреть файл

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

Просмотреть файл

@ -1249,7 +1249,7 @@ class GatherDecls(TcheckVisitor):
{
"Tainted": None,
"Compress": (None, "all"),
"Priority": ("normal", "input", "vsync", "mediumhigh"),
"Priority": ("normal", "input", "vsync", "mediumhigh", "control"),
"Nested": ("not", "inside_sync", "inside_cpow"),
},
)

Просмотреть файл

@ -148,6 +148,8 @@ description = Only used by C++ unit tests
description = Only used by C++ unit tests
[PTestPriority::PMsg6]
description = Only used by C++ unit tests
[PTestPriority::PMsg8]
description = Only used by C++ unit tests
[PTestRPC::Test1_Start]
description = Only used by C++ unit tests
[PTestRPC::Test1_InnerEvent]

Просмотреть файл

@ -9,11 +9,14 @@ parent:
[Priority=vsync] sync PMsg4();
[Priority=mediumhigh] async PMsg5();
[Priority=mediumhigh] sync PMsg6();
[Priority=control] async PMsg7();
[Priority=control] sync PMsg8();
child:
[Priority=input] async CMsg1();
[Priority=vsync] async CMsg2();
[Priority=mediumhigh] async CMsg3();
[Priority=control] async CMsg4();
};
} // namespace _ipdltest

Просмотреть файл

@ -5,4 +5,5 @@ child:
[Priority=vsync] async VsyncPrio();
[Priority=input] async InputPrio();
[Priority=mediumhigh] async MediumHighPrio();
[Priority=control] async ControlPrio();
};