Bug 1336919 - Add a sync message whitelist and check it in IPDL compile phase. r=billm
authorKan-Ru Chen <kanru@kanru.info>
Tue, 14 Feb 2017 17:32:31 +0800
changeset 372850 03531a4a9327fe350cc4a27c0c7799c106b8bfcc
parent 372849 b0cbe51520865de381809966b309ecefeba78f22
child 372851 6910cab30bdd58270b39e7cf041c022c2aba6a2c
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1336919
milestone54.0a1
Bug 1336919 - Add a sync message whitelist and check it in IPDL compile phase. r=billm MozReview-Commit-ID: ENFkBzpGo2j
ipc/ipdl/Makefile.in
ipc/ipdl/ipdl.py
ipc/ipdl/ipdl/__init__.py
ipc/ipdl/ipdl/checker.py
ipc/ipdl/sync-messages.ini
ipc/ipdl/test/ipdl/Makefile.in
ipc/ipdl/test/ipdl/error/asyncMessageListed.ipdl
ipc/ipdl/test/ipdl/error/unknownIntrMessage.ipdl
ipc/ipdl/test/ipdl/error/unknownSyncMessage.ipdl
ipc/ipdl/test/ipdl/sync-messages.ini
--- a/ipc/ipdl/Makefile.in
+++ b/ipc/ipdl/Makefile.in
@@ -14,16 +14,17 @@ include $(topsrcdir)/config/rules.mk
 
 
 # NB: the IPDL compiler manages .ipdl-->.h/.cpp dependencies itself,
 # which is why we don't have explicit .h/.cpp targets here
 ipdl: $(ALL_IPDLSRCS)
 	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  $(PLY_INCLUDE) \
 	  $(srcdir)/ipdl.py \
+	  --sync-msg-list=$(srcdir)/sync-messages.ini \
 	  --outheaders-dir=_ipdlheaders \
 	  --outcpp-dir=. \
 	  $(IPDLDIRS:%=-I%) \
 	  $^
 
 .PHONY: ipdl
 
 export:: ipdl
--- a/ipc/ipdl/ipdl.py
+++ b/ipc/ipdl/ipdl.py
@@ -2,47 +2,50 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import optparse, os, re, sys
 from cStringIO import StringIO
 from mozbuild.pythonutil import iter_modules_in_path
 import mozpack.path as mozpath
 import itertools
+from ConfigParser import RawConfigParser
 
 import ipdl
 
 def log(minv, fmt, *args):
     if _verbosity >= minv:
         print fmt % args
 
 # process command line
 
 op = optparse.OptionParser(usage='ipdl.py [options] IPDLfiles...')
 op.add_option('-I', '--include', dest='includedirs', default=[ ],
               action='append',
               help='Additional directory to search for included protocol specifications')
+op.add_option('-s', '--sync-msg-list', dest='syncMsgList', default='sync-messages.ini',
+              help="Config file listing allowed sync messages")
 op.add_option('-v', '--verbose', dest='verbosity', default=1, action='count',
               help='Verbose logging (specify -vv or -vvv for very verbose logging)')
 op.add_option('-q', '--quiet', dest='verbosity', action='store_const', const=0,
               help="Suppress logging output")
 op.add_option('-d', '--outheaders-dir', dest='headersdir', default='.',
               help="""Directory into which C++ headers will be generated.
 A protocol Foo in the namespace bar will cause the headers
   dir/bar/Foo.h, dir/bar/FooParent.h, and dir/bar/FooParent.h
 to be generated""")
 op.add_option('-o', '--outcpp-dir', dest='cppdir', default='.',
               help="""Directory into which C++ sources will be generated
 A protocol Foo in the namespace bar will cause the sources
   cppdir/FooParent.cpp, cppdir/FooChild.cpp
 to be generated""")
 
-
 options, files = op.parse_args()
 _verbosity = options.verbosity
+syncMsgList = options.syncMsgList
 headersdir = options.headersdir
 cppdir = options.cppdir
 includedirs = [ os.path.abspath(incdir) for incdir in options.includedirs ]
 
 if not len(files):
     op.error("No IPDL files specified")
 
 ipcmessagestartpath = os.path.join(headersdir, 'IPCMessageStart.h')
@@ -108,16 +111,21 @@ log(2, 'Generated C++ sources will be ge
 allmessages = {}
 allprotocols = []
 
 def normalizedFilename(f):
     if f == '-':
         return '<stdin>'
     return f
 
+log(2, 'Reading sync message list')
+parser = RawConfigParser()
+parser.readfp(open(options.syncMsgList))
+syncMsgList = parser.sections()
+
 # First pass: parse and type-check all protocols
 for f in files:
     log(2, os.path.basename(f))
     filename = normalizedFilename(f)
     if f == '-':
         fd = sys.stdin
     else:
         fd = open(f)
@@ -130,16 +138,20 @@ for f in files:
         print >>sys.stderr, 'Specification could not be parsed.'
         sys.exit(1)
 
     log(2, 'checking types')
     if not ipdl.typecheck(ast):
         print >>sys.stderr, 'Specification is not well typed.'
         sys.exit(1)
 
+    if not ipdl.checkSyncMessage(ast, syncMsgList):
+        print >>sys.stderr, 'Error: New sync IPC messages must be reviewed by an IPC peer and recorded in %s' % options.syncMsgList
+        sys.exit(1)
+
     if _verbosity > 2:
         log(3, '  pretty printed code:')
         ipdl.genipdl(ast, codedir)
 
 # Second pass: generate code
 for f in files:
     # Read from parser cache
     filename = normalizedFilename(f)
--- a/ipc/ipdl/ipdl/__init__.py
+++ b/ipc/ipdl/ipdl/__init__.py
@@ -1,21 +1,22 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-__all__ = [ 'gencxx', 'genipdl', 'parse', 'typecheck', 'writeifmodified' ]
+__all__ = [ 'gencxx', 'genipdl', 'parse', 'typecheck', 'writeifmodified', 'checkSyncMessage' ]
 
 import os, sys
 from cStringIO import StringIO
 
 from ipdl.cgen import IPDLCodeGen
 from ipdl.lower import LowerToCxx, msgenums
 from ipdl.parser import Parser, ParseError
 from ipdl.type import TypeCheck
+from ipdl.checker import checkSyncMessage
 
 from ipdl.cxx.cgen import CxxCodeGen
 
 
 def parse(specstring, filename='/stdin', includedirs=[ ], errout=sys.stderr):
     '''Return an IPDL AST if parsing was successful.  Print errors to |errout|
     if it is not.'''
     # The file type and name are later enforced by the type checker.
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/ipdl/checker.py
@@ -0,0 +1,43 @@
+# vim: set ts=4 sw=4 tw=99 et:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import sys
+from ipdl.ast import Visitor, ASYNC
+
+class SyncMessageChecker(Visitor):
+    def __init__(self, syncMsgList):
+        self.syncMsgList = syncMsgList
+        self.errors = []
+
+    def prettyMsgName(self, msg):
+        return "%s::%s" % (self.currentProtocol, msg)
+
+    def errorUnknownSyncMessage(self, loc, msg):
+        self.errors.append('%s: error: Unknown sync IPC message %s' %
+                           (str(loc), msg))
+
+    def errorAsyncMessageCanRemove(self, loc, msg):
+        self.errors.append('%s: error: IPC message %s is async, can be delisted' %
+                           (str(loc), msg))
+
+    def visitProtocol(self, p):
+        self.currentProtocol = p.name
+        Visitor.visitProtocol(self, p)
+
+    def visitMessageDecl(self, md):
+        pn = self.prettyMsgName(md.name)
+        if md.sendSemantics is not ASYNC and pn not in self.syncMsgList:
+            self.errorUnknownSyncMessage(md.loc, pn)
+        if md.sendSemantics is ASYNC and pn in self.syncMsgList:
+            self.errorAsyncMessageCanRemove(md.loc, pn)
+
+def checkSyncMessage(tu, syncMsgList, errout=sys.stderr):
+    checker = SyncMessageChecker(syncMsgList)
+    tu.accept(checker)
+    if len(checker.errors):
+        for error in checker.errors:
+            print >>errout, error
+        return False
+    return True
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/sync-messages.ini
@@ -0,0 +1,1013 @@
+#############################################################
+#                                                           #
+# Any changes to this file must be reviewed by an IPC peer. #
+#                                                           #
+#############################################################
+
+# C++ unit tests
+[PTestBadActorSub::__delete__]
+description =
+[PTestCancel::Test1_1]
+description =
+[PTestCancel::Test2_2]
+description =
+[PTestCancel::Test2_1]
+description =
+[PTestCancel::Test3_1]
+description =
+[PTestCancel::Test3_2]
+description =
+[PTestCancel::CheckChild]
+description =
+[PTestCancel::CheckParent]
+description =
+[PTestCrashCleanup::DIEDIEDIE]
+description =
+[PTestDataStructures::Test1]
+description =
+[PTestDataStructures::Test2]
+description =
+[PTestDataStructures::Test3]
+description =
+[PTestDataStructures::Test4]
+description =
+[PTestDataStructures::Test5]
+description =
+[PTestDataStructures::Test6]
+description =
+[PTestDataStructures::Test7_0]
+description =
+[PTestDataStructures::Test7]
+description =
+[PTestDataStructures::Test8]
+description =
+[PTestDataStructures::Test9]
+description =
+[PTestDataStructures::Test10]
+description =
+[PTestDataStructures::Test11]
+description =
+[PTestDataStructures::Test12]
+description =
+[PTestDataStructures::Test13]
+description =
+[PTestDataStructures::Test14]
+description =
+[PTestDataStructures::Test15]
+description =
+[PTestDataStructures::Test16]
+description =
+[PTestDataStructures::Test17]
+description =
+[PTestDataStructures::Test18]
+description =
+[PTestDataStructures::Dummy]
+description =
+[PTestDataStructuresSub::__delete__]
+description =
+[PTestDemon::HiPrioSyncMessage]
+description =
+[PTestDemon::SyncMessage]
+description =
+[PTestDemon::UrgentSyncMessage]
+description =
+[PTestDesc::PTestDescSub]
+description =
+[PTestDescSub::PTestDescSubsub]
+description =
+[PTestDescSubsub::__delete__]
+description =
+[PTestEndpointBridgeMainSub::HiRpc]
+description =
+[PTestEndpointBridgeMainSub::HelloSync]
+description =
+[PTestEndpointBridgeMainSub::HelloRpc]
+description =
+[PTestEndpointOpensOpened::HiRpc]
+description =
+[PTestEndpointOpensOpened::HelloSync]
+description =
+[PTestEndpointOpensOpened::HelloRpc]
+description =
+[PTestFailedCtor::PTestFailedCtorSub]
+description =
+[PTestFailedCtorSub::Sync]
+description =
+[PTestHangs::StackFrame]
+description =
+[PTestHangs::Hang]
+description =
+[PTestHighestPrio::Msg2]
+description =
+[PTestHighestPrio::Msg4]
+description =
+[PTestHighestPrio::StartInner]
+description =
+[PTestIndirectProtocolParamFirst::Test]
+description =
+[PTestInterruptErrorCleanup::Error]
+description =
+[PTestInterruptErrorCleanup::__delete__]
+description =
+[PTestInterruptRaces::Race]
+description =
+[PTestInterruptRaces::StackFrame]
+description =
+[PTestInterruptRaces::StackFrame3]
+description =
+[PTestInterruptRaces::StartRace]
+description =
+[PTestInterruptRaces::Parent]
+description =
+[PTestInterruptRaces::GetAnsweredParent]
+description =
+[PTestInterruptRaces::Child]
+description =
+[PTestInterruptShutdownRace::StartDeath]
+description =
+[PTestInterruptShutdownRace::Exit]
+description =
+[PTestJSON::Test]
+description =
+[PTestLatency::Rpc]
+description =
+[PTestLatency::Synchro]
+description =
+[PTestLatency::Synchro2]
+description =
+[PTestNestedLoops::R]
+description =
+[PTestPriority::Msg2]
+description =
+[PTestRPC::Test1_Start]
+description =
+[PTestRPC::Test1_InnerEvent]
+description =
+[PTestRPC::Test2_OutOfOrder]
+description =
+[PTestRPC::Test1_InnerQuery]
+description =
+[PTestRPC::Test1_NoReenter]
+description =
+[PTestRPC::Test2_FirstUrgent]
+description =
+[PTestRPC::Test2_SecondUrgent]
+description =
+[PTestRaceDeadlock::Lose]
+description =
+[PTestRaceDeadlock::Win]
+description =
+[PTestRaceDeadlock::Rpc]
+description =
+[PTestRaceDeferral::Lose]
+description =
+[PTestRaceDeferral::Win]
+description =
+[PTestRaceDeferral::Rpc]
+description =
+[PTestRacyInterruptReplies::R_]
+description =
+[PTestRacyInterruptReplies::_R]
+description =
+[PTestRacyReentry::E]
+description =
+[PTestRacyReentry::H]
+description =
+[PTestRacyUndefer::Race]
+description =
+[PTestRacyUndefer::Spam]
+description =
+[PTestRacyUndefer::RaceWinTwice]
+description =
+[PTestShutdown::Sync]
+description =
+[PTestShutdownSub::StackFrame]
+description =
+[PTestShutdownSub::__delete__]
+description =
+[PTestShutdownSubsub::__delete__]
+description =
+[PTestStackHooks::Sync]
+description =
+[PTestStackHooks::Rpc]
+description =
+[PTestStackHooks::StackFrame]
+description =
+[PTestSyncError::Error]
+description =
+[PTestSyncWakeup::StackFrame]
+description =
+[PTestSyncWakeup::Sync1]
+description =
+[PTestSyncWakeup::Sync2]
+description =
+[PTestUrgency::Test1]
+description =
+[PTestUrgency::Test3]
+description =
+[PTestUrgency::FinalTest_Begin]
+description =
+[PTestUrgency::Reply1]
+description =
+[PTestUrgency::Reply2]
+description =
+[PTestUrgentHangs::Test1_2]
+description =
+[PTestUrgentHangs::TestInner]
+description =
+[PTestUrgentHangs::TestInnerUrgent]
+description =
+[PTestUrgentHangs::Test1_1]
+description =
+[PTestUrgentHangs::Test1_3]
+description =
+[PTestUrgentHangs::Test2]
+description =
+[PTestUrgentHangs::Test3]
+description =
+[PTestUrgentHangs::Test4_1]
+description =
+[PTestUrgentHangs::Test5_1]
+description =
+
+# A11y code
+[PDocAccessible::State]
+description =
+[PDocAccessible::NativeState]
+description =
+[PDocAccessible::Name]
+description =
+[PDocAccessible::Value]
+description =
+[PDocAccessible::Help]
+description =
+[PDocAccessible::Description]
+description =
+[PDocAccessible::Attributes]
+description =
+[PDocAccessible::RelationByType]
+description =
+[PDocAccessible::Relations]
+description =
+[PDocAccessible::IsSearchbox]
+description =
+[PDocAccessible::LandmarkRole]
+description =
+[PDocAccessible::ARIARoleAtom]
+description =
+[PDocAccessible::GetLevelInternal]
+description =
+[PDocAccessible::CaretLineNumber]
+description =
+[PDocAccessible::CaretOffset]
+description =
+[PDocAccessible::CharacterCount]
+description =
+[PDocAccessible::SelectionCount]
+description =
+[PDocAccessible::TextSubstring]
+description =
+[PDocAccessible::GetTextAfterOffset]
+description =
+[PDocAccessible::GetTextAtOffset]
+description =
+[PDocAccessible::GetTextBeforeOffset]
+description =
+[PDocAccessible::CharAt]
+description =
+[PDocAccessible::TextAttributes]
+description =
+[PDocAccessible::DefaultTextAttributes]
+description =
+[PDocAccessible::TextBounds]
+description =
+[PDocAccessible::CharBounds]
+description =
+[PDocAccessible::OffsetAtPoint]
+description =
+[PDocAccessible::SelectionBoundsAt]
+description =
+[PDocAccessible::SetSelectionBoundsAt]
+description =
+[PDocAccessible::AddToSelection]
+description =
+[PDocAccessible::RemoveFromSelection]
+description =
+[PDocAccessible::Text]
+description =
+[PDocAccessible::ReplaceText]
+description =
+[PDocAccessible::InsertText]
+description =
+[PDocAccessible::CopyText]
+description =
+[PDocAccessible::CutText]
+description =
+[PDocAccessible::DeleteText]
+description =
+[PDocAccessible::PasteText]
+description =
+[PDocAccessible::ImagePosition]
+description =
+[PDocAccessible::ImageSize]
+description =
+[PDocAccessible::StartOffset]
+description =
+[PDocAccessible::EndOffset]
+description =
+[PDocAccessible::IsLinkValid]
+description =
+[PDocAccessible::AnchorCount]
+description =
+[PDocAccessible::AnchorURIAt]
+description =
+[PDocAccessible::AnchorAt]
+description =
+[PDocAccessible::LinkCount]
+description =
+[PDocAccessible::LinkAt]
+description =
+[PDocAccessible::LinkIndexOf]
+description =
+[PDocAccessible::LinkIndexAtOffset]
+description =
+[PDocAccessible::TableOfACell]
+description =
+[PDocAccessible::ColIdx]
+description =
+[PDocAccessible::RowIdx]
+description =
+[PDocAccessible::GetPosition]
+description =
+[PDocAccessible::ColExtent]
+description =
+[PDocAccessible::RowExtent]
+description =
+[PDocAccessible::GetColRowExtents]
+description =
+[PDocAccessible::ColHeaderCells]
+description =
+[PDocAccessible::RowHeaderCells]
+description =
+[PDocAccessible::IsCellSelected]
+description =
+[PDocAccessible::TableCaption]
+description =
+[PDocAccessible::TableSummary]
+description =
+[PDocAccessible::TableColumnCount]
+description =
+[PDocAccessible::TableRowCount]
+description =
+[PDocAccessible::TableCellAt]
+description =
+[PDocAccessible::TableCellIndexAt]
+description =
+[PDocAccessible::TableColumnIndexAt]
+description =
+[PDocAccessible::TableRowIndexAt]
+description =
+[PDocAccessible::TableRowAndColumnIndicesAt]
+description =
+[PDocAccessible::TableColumnExtentAt]
+description =
+[PDocAccessible::TableRowExtentAt]
+description =
+[PDocAccessible::TableColumnDescription]
+description =
+[PDocAccessible::TableRowDescription]
+description =
+[PDocAccessible::TableColumnSelected]
+description =
+[PDocAccessible::TableRowSelected]
+description =
+[PDocAccessible::TableCellSelected]
+description =
+[PDocAccessible::TableSelectedCellCount]
+description =
+[PDocAccessible::TableSelectedColumnCount]
+description =
+[PDocAccessible::TableSelectedRowCount]
+description =
+[PDocAccessible::TableSelectedCells]
+description =
+[PDocAccessible::TableSelectedCellIndices]
+description =
+[PDocAccessible::TableSelectedColumnIndices]
+description =
+[PDocAccessible::TableSelectedRowIndices]
+description =
+[PDocAccessible::TableSelectColumn]
+description =
+[PDocAccessible::TableSelectRow]
+description =
+[PDocAccessible::TableUnselectColumn]
+description =
+[PDocAccessible::TableUnselectRow]
+description =
+[PDocAccessible::TableIsProbablyForLayout]
+description =
+[PDocAccessible::AtkTableColumnHeader]
+description =
+[PDocAccessible::AtkTableRowHeader]
+description =
+[PDocAccessible::SelectedItems]
+description =
+[PDocAccessible::SelectedItemCount]
+description =
+[PDocAccessible::GetSelectedItem]
+description =
+[PDocAccessible::IsItemSelected]
+description =
+[PDocAccessible::AddItemToSelection]
+description =
+[PDocAccessible::RemoveItemFromSelection]
+description =
+[PDocAccessible::SelectAll]
+description =
+[PDocAccessible::UnselectAll]
+description =
+[PDocAccessible::DoAction]
+description =
+[PDocAccessible::ActionCount]
+description =
+[PDocAccessible::ActionDescriptionAt]
+description =
+[PDocAccessible::ActionNameAt]
+description =
+[PDocAccessible::AccessKey]
+description =
+[PDocAccessible::KeyboardShortcut]
+description =
+[PDocAccessible::AtkKeyBinding]
+description =
+[PDocAccessible::CurValue]
+description =
+[PDocAccessible::SetCurValue]
+description =
+[PDocAccessible::MinValue]
+description =
+[PDocAccessible::MaxValue]
+description =
+[PDocAccessible::Step]
+description =
+[PDocAccessible::FocusedChild]
+description =
+[PDocAccessible::Language]
+description =
+[PDocAccessible::DocType]
+description =
+[PDocAccessible::Title]
+description =
+[PDocAccessible::URL]
+description =
+[PDocAccessible::MimeType]
+description =
+[PDocAccessible::URLDocTypeMimeType]
+description =
+[PDocAccessible::AccessibleAtPoint]
+description =
+[PDocAccessible::Extents]
+description =
+[PDocAccessible::DOMNodeID]
+description =
+[PDocAccessible::GetWindowedPluginIAccessible]
+description =
+
+# CPOWs
+[PBrowser::RpcMessage]
+description =
+[PContent::RpcMessage]
+description =
+[PJavaScript::PreventExtensions]
+description =
+[PJavaScript::GetPropertyDescriptor]
+description =
+[PJavaScript::GetOwnPropertyDescriptor]
+description =
+[PJavaScript::DefineProperty]
+description =
+[PJavaScript::Delete]
+description =
+[PJavaScript::Has]
+description =
+[PJavaScript::HasOwn]
+description =
+[PJavaScript::Get]
+description =
+[PJavaScript::Set]
+description =
+[PJavaScript::IsExtensible]
+description =
+[PJavaScript::CallOrConstruct]
+description =
+[PJavaScript::HasInstance]
+description =
+[PJavaScript::GetBuiltinClass]
+description =
+[PJavaScript::IsArray]
+description =
+[PJavaScript::ClassName]
+description =
+[PJavaScript::GetPrototype]
+description =
+[PJavaScript::GetPrototypeIfOrdinary]
+description =
+[PJavaScript::RegExpToShared]
+description =
+[PJavaScript::GetPropertyKeys]
+description =
+[PJavaScript::InstanceOf]
+description =
+[PJavaScript::DOMInstanceOf]
+description =
+
+# Plugins
+[PPluginWidget::Create]
+description =
+[PPluginWidget::GetNativePluginPort]
+description =
+[PPluginWidget::SetNativeChildWindow]
+description =
+[PPluginInstance::__delete__]
+description =
+[PPluginInstance::CreateChildPluginWindow]
+description =
+[PPluginInstance::NPP_SetWindow]
+description =
+[PPluginInstance::NPP_GetValue_NPPVpluginWantsAllNetworkStreams]
+description =
+[PPluginInstance::NPP_GetValue_NPPVpluginNeedsXEmbed]
+description =
+[PPluginInstance::NPP_GetValue_NPPVpluginScriptableNPObject]
+description =
+[PPluginInstance::NPP_SetValue_NPNVprivateModeBool]
+description =
+[PPluginInstance::NPP_GetValue_NPPVpluginNativeAccessibleAtkPlugId]
+description =
+[PPluginInstance::NPP_SetValue_NPNVCSSZoomFactor]
+description =
+[PPluginInstance::NPP_SetValue_NPNVmuteAudioBool]
+description =
+[PPluginInstance::NPP_HandleEvent]
+description =
+[PPluginInstance::NPP_HandleEvent_Shmem]
+description =
+[PPluginInstance::NPP_HandleEvent_IOSurface]
+description =
+[PPluginInstance::Paint]
+description =
+[PPluginInstance::NPP_Destroy]
+description =
+[PPluginInstance::NPN_GetValue_NPNVWindowNPObject]
+description =
+[PPluginInstance::NPN_GetValue_NPNVPluginElementNPObject]
+description =
+[PPluginInstance::NPN_GetValue_NPNVprivateModeBool]
+description =
+[PPluginInstance::NPN_GetValue_NPNVnetscapeWindow]
+description =
+[PPluginInstance::NPN_GetValue_NPNVdocumentOrigin]
+description =
+[PPluginInstance::NPN_GetValue_DrawingModelSupport]
+description =
+[PPluginInstance::NPN_GetValue_SupportsAsyncBitmapSurface]
+description =
+[PPluginInstance::NPN_GetValue_SupportsAsyncDXGISurface]
+description =
+[PPluginInstance::NPN_GetValue_PreferredDXGIAdapter]
+description =
+[PPluginInstance::NPN_SetValue_NPPVpluginWindow]
+description =
+[PPluginInstance::NPN_SetValue_NPPVpluginTransparent]
+description =
+[PPluginInstance::NPN_SetValue_NPPVpluginUsesDOMForCursor]
+description =
+[PPluginInstance::NPN_SetValue_NPPVpluginDrawingModel]
+description =
+[PPluginInstance::NPN_SetValue_NPPVpluginEventModel]
+description =
+[PPluginInstance::NPN_SetValue_NPPVpluginIsPlayingAudio]
+description =
+[PPluginInstance::NPN_GetURL]
+description =
+[PPluginInstance::NPN_PostURL]
+description =
+[PPluginInstance::PStreamNotify]
+description =
+[PPluginInstance::RevokeCurrentDirectSurface]
+description =
+[PPluginInstance::InitDXGISurface]
+description =
+[PPluginInstance::FinalizeDXGISurface]
+description =
+[PPluginInstance::ShowDirectBitmap]
+description =
+[PPluginInstance::ShowDirectDXGISurface]
+description =
+[PPluginInstance::Show]
+description =
+[PPluginInstance::NPN_PushPopupsEnabledState]
+description =
+[PPluginInstance::NPN_PopPopupsEnabledState]
+description =
+[PPluginInstance::NPN_GetValueForURL]
+description =
+[PPluginInstance::NPN_SetValueForURL]
+description =
+[PPluginInstance::NPN_GetAuthenticationInfo]
+description =
+[PPluginInstance::NPN_ConvertPoint]
+description =
+[PPluginInstance::NegotiatedCarbon]
+description =
+[PPluginInstance::GetCompositionString]
+description =
+[PPluginInstance::NPP_NewStream]
+description =
+[PPluginInstance::PPluginStream]
+description =
+[PPluginInstance::PluginFocusChange]
+description =
+[PPluginInstance::SetPluginFocus]
+description =
+[PPluginInstance::UpdateWindow]
+description =
+[PPluginModule::ModuleSupportsAsyncRender]
+description =
+[PPluginModule::NP_GetEntryPoints]
+description =
+[PPluginModule::NP_Initialize]
+description =
+[PPluginModule::SyncNPP_New]
+description =
+[PPluginModule::NP_Shutdown]
+description =
+[PPluginModule::OptionalFunctionsSupported]
+description =
+[PPluginModule::PCrashReporter]
+description =
+[PPluginModule::ProcessSomeEvents]
+description =
+[PPluginModule::NPN_SetException]
+description =
+[PPluginModule::GetKeyState]
+description =
+[PPluginModule::NPN_SetValue_NPPVpluginRequiresAudioDeviceChanges]
+description =
+[PPluginModule::InitCrashReporter]
+description =
+[PPluginScriptableObject::NPN_Evaluate]
+description =
+[PPluginScriptableObject::Invalidate]
+description =
+[PPluginScriptableObject::HasMethod]
+description =
+[PPluginScriptableObject::Invoke]
+description =
+[PPluginScriptableObject::InvokeDefault]
+description =
+[PPluginScriptableObject::HasProperty]
+description =
+[PPluginScriptableObject::SetProperty]
+description =
+[PPluginScriptableObject::RemoveProperty]
+description =
+[PPluginScriptableObject::Enumerate]
+description =
+[PPluginScriptableObject::Construct]
+description =
+[PPluginScriptableObject::GetParentProperty]
+description =
+[PPluginScriptableObject::GetChildProperty]
+description =
+[PPluginStream::NPN_Write]
+description =
+[PPluginStream::__delete__]
+description =
+
+# The rest
+[PHeapSnapshotTempFileHelper::OpenHeapSnapshotTempFile]
+description =
+[PBlob::BlobStreamSync]
+description =
+[PBlob::WaitForSliceCreation]
+description =
+[PBlob::GetFileId]
+description =
+[PBlob::GetFilePath]
+description =
+[PBackgroundMutableFile::GetFileId]
+description =
+[PBackgroundIndexedDBUtils::GetFileReferences]
+description =
+[PBrowser::SyncMessage]
+description =
+[PBrowser::PPluginWidget]
+description =
+[PBrowser::GetWidgetNativeData]
+description =
+[PBrowser::DispatchFocusToTopLevelWindow]
+description =
+[PBrowser::NotifyIMEFocus]
+description =
+[PBrowser::NotifyIMEMouseButtonEvent]
+description =
+[PBrowser::RequestIMEToCommitComposition]
+description =
+[PBrowser::StartPluginIME]
+description =
+[PBrowser::GetInputContext]
+description =
+[PBrowser::IsParentWindowMainWidgetVisible]
+description =
+[PBrowser::GetDPI]
+description =
+[PBrowser::GetDefaultScale]
+description =
+[PBrowser::GetWidgetRounding]
+description =
+[PBrowser::GetMaxTouchPoints]
+description =
+[PBrowser::BrowserFrameOpenWindow]
+description =
+[PBrowser::RequestNativeKeyBindings]
+description =
+[PBrowser::GetTabCount]
+description =
+[PBrowser::DispatchWheelEvent]
+description =
+[PBrowser::DispatchMouseEvent]
+description =
+[PBrowser::DispatchKeyboardEvent]
+description =
+[PBrowser::EnsureLayersConnected]
+description =
+[PContent::SyncMessage]
+description =
+[PContent::CreateChildProcess]
+description =
+[PContent::BridgeToChildProcess]
+description =
+[PContent::LoadPlugin]
+description =
+[PContent::ConnectPluginBridge]
+description =
+[PContent::GetBlocklistState]
+description =
+[PContent::FindPlugins]
+description =
+[PContent::PCrashReporter]
+description =
+[PContent::NSSU2FTokenIsCompatibleVersion]
+description =
+[PContent::NSSU2FTokenIsRegistered]
+description =
+[PContent::NSSU2FTokenRegister]
+description =
+[PContent::NSSU2FTokenSign]
+description =
+[PContent::IsSecureURI]
+description =
+[PContent::PScreenManager]
+description =
+[PContent::PURLClassifier]
+description =
+[PContent::ClassifyLocal]
+description =
+[PContent::GetGfxVars]
+description =
+[PContent::ReadFontList]
+description =
+[PContent::ReadDataStorageArray]
+description =
+[PContent::ReadPermissions]
+description =
+[PContent::GetClipboard]
+description =
+[PContent::ClipboardHasType]
+description =
+[PContent::GetSystemColors]
+description =
+[PContent::GetIconForExtension]
+description =
+[PContent::GetShowPasswordSetting]
+description =
+[PContent::KeywordToURI]
+description =
+[PContent::NotifyKeywordSearchLoading]
+description =
+[PContent::AllocateLayerTreeId]
+description =
+[PContent::GetGfxInfoFeatureStatus]
+description =
+[PContent::BeginDriverCrashGuard]
+description =
+[PContent::EndDriverCrashGuard]
+description =
+[PContent::OpenAnonymousTemporaryFile]
+description =
+[PContent::KeygenProcessValue]
+description =
+[PContent::KeygenProvideContent]
+description =
+[PContent::AllocateTabId]
+description =
+[PContent::GetGraphicsDeviceInitData]
+description =
+[PContent::CreateWindow]
+description =
+[PContent::GetDeviceStorageLocation]
+description =
+[PContent::GetDeviceStorageLocations]
+description =
+[PContent::GetAndroidSystemInfo]
+description =
+[PContent::UngrabPointer]
+description =
+[PContent::RemovePermission]
+description =
+[PContent::GetA11yContentId]
+description =
+[PContentBridge::SyncMessage]
+description =
+[PScreenManager::Refresh]
+description =
+[PScreenManager::ScreenRefresh]
+description =
+[PScreenManager::GetPrimaryScreen]
+description =
+[PScreenManager::ScreenForRect]
+description =
+[PScreenManager::ScreenForBrowser]
+description =
+[PGMP::StartPlugin]
+description =
+[PGMPService::LaunchGMP]
+description =
+[PGMPService::GetGMPNodeId]
+description =
+[PGMPVideoDecoder::NeedShmem]
+description =
+[PGMPVideoEncoder::NeedShmem]
+description =
+[PVideoDecoderManager::PVideoDecoder]
+description =
+[PVideoDecoderManager::Readback]
+description =
+[PSpeechSynthesis::ReadVoicesAndState]
+description =
+[PBrowserStream::NPN_RequestRead]
+description =
+[PStorage::Preload]
+description =
+[PRemoteSpellcheckEngine::Check]
+description =
+[PRemoteSpellcheckEngine::CheckAndSuggest]
+description =
+[PRemoteSpellcheckEngine::SetDictionary]
+description =
+[PGPU::AddLayerTreeIdMapping]
+description =
+[PGPU::GetDeviceStatus]
+description =
+[PAPZCTreeManager::ReceiveMultiTouchInputEvent]
+description =
+[PAPZCTreeManager::ReceiveMouseInputEvent]
+description =
+[PAPZCTreeManager::ReceivePanGestureInputEvent]
+description =
+[PAPZCTreeManager::ReceivePinchGestureInputEvent]
+description =
+[PAPZCTreeManager::ReceiveTapGestureInputEvent]
+description =
+[PAPZCTreeManager::ReceiveScrollWheelInputEvent]
+description =
+[PAPZCTreeManager::TransformEventRefPoint]
+description =
+[PCompositorBridge::Initialize]
+description =
+[PCompositorBridge::Reset]
+description =
+[PCompositorBridge::GetCompositorOptions]
+description =
+[PCompositorBridge::GetFrameUniformity]
+description =
+[PCompositorBridge::WillClose]
+description =
+[PCompositorBridge::Pause]
+description =
+[PCompositorBridge::Resume]
+description =
+[PCompositorBridge::NotifyChildCreated]
+description =
+[PCompositorBridge::NotifyChildRecreated]
+description =
+[PCompositorBridge::MakeSnapshot]
+description =
+[PCompositorBridge::FlushRendering]
+description =
+[PCompositorBridge::StartFrameTimeRecording]
+description =
+[PCompositorBridge::StopFrameTimeRecording]
+description =
+[PCompositorBridge::PLayerTransaction]
+description =
+[PCompositorBridge::SyncWithCompositor]
+description =
+[PCompositorBridge::PWebRenderBridge]
+description =
+[PCompositorWidget::EnterPresentLock]
+description =
+[PCompositorWidget::LeavePresentLock]
+description =
+[PCompositorWidget::ClearTransparentWindow]
+description =
+[PImageBridge::WillClose]
+description =
+[PImageBridge::NewCompositable]
+description =
+[PLayerTransaction::SetTestSampleTime]
+description =
+[PLayerTransaction::LeaveTestMode]
+description =
+[PLayerTransaction::GetAnimationOpacity]
+description =
+[PLayerTransaction::GetAnimationTransform]
+description =
+[PLayerTransaction::SetAsyncScrollOffset]
+description =
+[PLayerTransaction::SetAsyncZoom]
+description =
+[PLayerTransaction::GetAPZTestData]
+description =
+[PLayerTransaction::RequestProperty]
+description =
+[PTexture::DestroySync]
+description =
+[PUiCompositorController::Pause]
+description =
+[PUiCompositorController::Resume]
+description =
+[PUiCompositorController::ResumeAndResize]
+description =
+[PWebRenderBridge::Create]
+description =
+[PWebRenderBridge::AddImage]
+description =
+[PWebRenderBridge::UpdateImage]
+description =
+[PWebRenderBridge::DeleteImage]
+description =
+[PWebRenderBridge::DPBegin]
+description =
+[PWebRenderBridge::DPSyncEnd]
+description =
+[PWebRenderBridge::DPGetSnapshot]
+description =
+[PVRManager::GetDisplays]
+description =
+[PVRManager::GetSensorState]
+description =
+[PVRManager::GetImmediateSensorState]
+description =
+[PVRManager::SetHaveEventListener]
+description =
+[PVRManager::GetControllers]
+description =
+[PHal::GetCurrentBatteryInformation]
+description =
+[PHal::GetCurrentNetworkInformation]
+description =
+[PHal::GetScreenEnabled]
+description =
+[PHal::GetKeyLightEnabled]
+description =
+[PHal::GetCpuSleepAllowed]
+description =
+[PHal::GetScreenBrightness]
+description =
+[PHal::GetTimezone]
+description =
+[PHal::GetTimezoneOffset]
+description =
+[PHal::GetWakeLockInfo]
+description =
+[PHal::GetCurrentScreenConfiguration]
+description =
+[PHal::LockScreenOrientation]
+description =
+[PHal::GetCurrentSwitchState]
+description =
+[PCookieService::GetCookieString]
+description =
+[PPrinting::ShowProgress]
+description =
+[PPrinting::SavePrintSettings]
+description =
+[PHandlerService::FillHandlerInfo]
+description =
+[PHandlerService::Exists]
+description =
+[PHandlerService::GetTypeFromExtension]
+description =
--- a/ipc/ipdl/test/ipdl/Makefile.in
+++ b/ipc/ipdl/test/ipdl/Makefile.in
@@ -8,10 +8,11 @@ OKTESTS := $(wildcard $(srcdir)/ok/*.ipd
 ERRORTESTS := $(wildcard $(srcdir)/error/*.ipdl) $(wildcard $(srcdir)/error/*.ipdlh)
 
 check::
 	@$(PYTHON) $(srcdir)/runtests.py  \
 		$(srcdir)/ok $(srcdir)/error  \
 		$(PYTHON) $(topsrcdir)/config/pythonpath.py  \
 		$(PLY_INCLUDE)  \
 		$(topsrcdir)/ipc/ipdl/ipdl.py  \
+		-s $(srcdir)/sync-messages.ini \
 		OKTESTS $(OKTESTS)  \
 		ERRORTESTS $(ERRORTESTS)
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/asyncMessageListed.ipdl
@@ -0,0 +1,4 @@
+protocol asyncMessageListed {
+parent:
+    async Msg();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/unknownIntrMessage.ipdl
@@ -0,0 +1,4 @@
+intr protocol unknownSyncMessage {
+parent:
+    intr Msg();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/unknownSyncMessage.ipdl
@@ -0,0 +1,4 @@
+sync protocol unknownSyncMessage {
+parent:
+    sync Msg();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/sync-messages.ini
@@ -0,0 +1,22 @@
+[actorreturn::Msg]
+[array_Union::Msg]
+[union_Basic::Msg]
+[Struct::test]
+[intrProtocol::SyncMsg]
+[intrProtocol::InterruptMsg]
+[shmem::SyncMsg]
+[shmem::InterruptMsg]
+[syncProtocol::SyncMsg]
+[messageVerify::__delete__]
+[messageVerify::msg3]
+[messageVerify::msg4]
+[messageVerifyTopLevel::messageVerify]
+[DeleteSub::__delete__]
+[intrMessageCompress::foo]
+[intrMessageCompress::bar]
+[syncMessageCompress::foo]
+[syncParentToChild::Msg]
+[tooWeakIntrSync::Msg]
+[tooWeakSyncAsync::Msg]
+[undeclReturnType::Msg]
+[asyncMessageListed::Msg]