Bug 1600605, add support for mediumhigh priority ipdl messages, r=jld
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 13 Dec 2019 22:38:15 +0000
changeset 507127 676f10cc111d3b53ab4e3e09b022305d47789536
parent 507126 ca0c893ca9f3422401ca17a44a6694052b8356c7
child 507128 8f5ffa8c4b68c5ddcf00ec2ccca134db72dbea47
push id36923
push userccoroiu@mozilla.com
push dateMon, 16 Dec 2019 21:47:33 +0000
treeherdermozilla-central@c238b47d7d57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1600605
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1600605, add support for mediumhigh priority ipdl messages, r=jld Differential Revision: https://phabricator.services.mozilla.com/D57013
ipc/chromium/src/chrome/common/ipc_message.h
ipc/glue/MessageChannel.cpp
ipc/ipdl/ipdl/ast.py
ipc/ipdl/ipdl/lower.py
ipc/ipdl/ipdl/parser.py
ipc/ipdl/sync-messages.ini
ipc/ipdl/test/cxx/PTestPriority.ipdl
ipc/ipdl/test/ipdl/ok/Prio.ipdl
--- a/ipc/chromium/src/chrome/common/ipc_message.h
+++ b/ipc/chromium/src/chrome/common/ipc_message.h
@@ -60,16 +60,17 @@ class Message : public Pickle {
     NESTED_INSIDE_SYNC = 2,
     NESTED_INSIDE_CPOW = 3
   };
 
   enum PriorityValue {
     NORMAL_PRIORITY = 0,
     INPUT_PRIORITY = 1,
     HIGH_PRIORITY = 2,
+    MEDIUMHIGH_PRIORITY = 3,
   };
 
   enum MessageCompression {
     COMPRESSION_NONE,
     COMPRESSION_ENABLED,
     COMPRESSION_ALL
   };
 
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -2067,16 +2067,19 @@ MessageChannel::MessageTask::GetPriority
       *aPriority = PRIORITY_NORMAL;
       break;
     case Message::INPUT_PRIORITY:
       *aPriority = PRIORITY_INPUT;
       break;
     case Message::HIGH_PRIORITY:
       *aPriority = PRIORITY_HIGH;
       break;
+    case Message::MEDIUMHIGH_PRIORITY:
+      *aPriority = PRIORITY_MEDIUMHIGH;
+      break;
     default:
       MOZ_ASSERT(false);
       break;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/ipc/ipdl/ipdl/ast.py
+++ b/ipc/ipdl/ipdl/ast.py
@@ -4,17 +4,17 @@
 
 NOT_NESTED = 1
 INSIDE_SYNC_NESTED = 2
 INSIDE_CPOW_NESTED = 3
 
 NORMAL_PRIORITY = 1
 INPUT_PRIORITY = 2
 HIGH_PRIORITY = 3
-
+MEDIUMHIGH_PRIORITY = 4
 
 class Visitor:
     def defaultVisit(self, node):
         raise Exception("INTERNAL ERROR: no visitor for node type `%s'" %
                         (node.__class__.__name__))
 
     def visitTranslationUnit(self, tu):
         for cxxInc in tu.cxxIncludes:
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -1794,18 +1794,20 @@ def _generateMessageConstructor(md, segm
     else:
         assert nested == ipdl.ast.INSIDE_CPOW_NESTED
         nestedEnum = 'NESTED_INSIDE_CPOW'
 
     if prio == ipdl.ast.NORMAL_PRIORITY:
         prioEnum = 'NORMAL_PRIORITY'
     elif prio == ipdl.ast.INPUT_PRIORITY:
         prioEnum = 'INPUT_PRIORITY'
+    elif prio == ipdl.ast.HIGH_PRIORITY:
+        prioEnum = 'HIGH_PRIORITY'
     else:
-        prioEnum = 'HIGH_PRIORITY'
+        prioEnum = 'MEDIUMHIGH_PRIORITY'
 
     if md.decl.type.isSync():
         syncEnum = 'SYNC'
     else:
         syncEnum = 'ASYNC'
 
     if md.decl.type.isInterrupt():
         interruptEnum = 'INTERRUPT'
--- a/ipc/ipdl/ipdl/parser.py
+++ b/ipc/ipdl/ipdl/parser.py
@@ -558,19 +558,20 @@ def p_Nested(p):
 
     p[0] = {'nested': kinds[p[1]]}
 
 
 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]]}
 
 
 def p_SendQualifier(p):
     """SendQualifier : NESTED '(' Nested ')'
                      | PRIO '(' Priority ')'"""
     p[0] = p[3]
--- a/ipc/ipdl/sync-messages.ini
+++ b/ipc/ipdl/sync-messages.ini
@@ -136,16 +136,18 @@ description =
 [PTestLatency::Synchro2]
 description =
 [PTestNestedLoops::R]
 description =
 [PTestPriority::PMsg2]
 description =
 [PTestPriority::PMsg4]
 description =
+[PTestPriority::PMsg6]
+description =
 [PTestRPC::Test1_Start]
 description =
 [PTestRPC::Test1_InnerEvent]
 description =
 [PTestRPC::Test2_OutOfOrder]
 description =
 [PTestRPC::Test1_InnerQuery]
 description =
--- a/ipc/ipdl/test/cxx/PTestPriority.ipdl
+++ b/ipc/ipdl/test/cxx/PTestPriority.ipdl
@@ -2,16 +2,19 @@ namespace mozilla {
 namespace _ipdltest {
 
 sync protocol PTestPriority {
 parent:
     prio(input) async PMsg1();
     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
 } // namespace mozilla
--- a/ipc/ipdl/test/ipdl/ok/Prio.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/Prio.ipdl
@@ -1,7 +1,8 @@
 async protocol Prio
 {
 child:
   prio(normal) async NormalPrio();
   prio(high) async HighPrio();
   prio(input) async InputPrio();
+  prio(mediumhigh) async MediumHighPrio();
 };