Bug 1489301 - Part 6: Remove references to 'System' from WebIDL.py, r=bzbarsky
☠☠ backed out by 77f4c84bebf0 ☠ ☠
authorNika Layzell <nika@thelayzells.com>
Sat, 20 Oct 2018 20:48:14 -0400
changeset 490732 1c0823540b44ff83a6319a363aab6e017faddaf4
parent 490731 529524df76a62485a06367438281b9a1155b9b42
child 490733 a3fad30f081a0bcd4aeae913942fc360dbdbf30e
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersbzbarsky
bugs1489301
milestone65.0a1
Bug 1489301 - Part 6: Remove references to 'System' from WebIDL.py, r=bzbarsky 'Exposed=System' is no longer used in any webidl files, so we can kill it. Differential Revision: https://phabricator.services.mozilla.com/D9401
dom/bindings/Codegen.py
dom/bindings/Configuration.py
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -17194,17 +17194,17 @@ class GlobalGenRoots():
         # Done.
         return curr
 
     @staticmethod
     def ResolveSystemBinding(config):
         curr = CGList([], "\n")
 
         descriptors = config.getDescriptors(hasInterfaceObject=True,
-                                            isExposedInSystemGlobals=True,
+                                            isExposedInWindow=True,
                                             register=True)
         properties = [desc.name for desc in descriptors]
 
         curr.append(CGStringTable("IdString", properties, static=True))
 
         initValues = []
         for desc in descriptors:
             bindingNS = toBindingNamespace(desc.name)
@@ -17239,17 +17239,17 @@ class GlobalGenRoots():
         curr = CGNamespace.build(['mozilla', 'dom'],
                                  CGWrapper(curr, post='\n'))
         curr = CGWrapper(curr, post='\n')
 
         # Add the includes
         defineIncludes = [CGHeaders.getDeclarationFilename(desc.interface)
                           for desc in config.getDescriptors(hasInterfaceObject=True,
                                                             register=True,
-                                                            isExposedInSystemGlobals=True)]
+                                                            isExposedInWindow=True)]
         defineIncludes.append("nsThreadUtils.h")  # For NS_IsMainThread
         defineIncludes.append("js/Id.h")  # For jsid
         defineIncludes.append("mozilla/dom/WebIDLGlobalNameHash.h")
 
         curr = CGHeaders([], [], [], [], [], defineIncludes,
                          'ResolveSystemBinding', curr)
 
         # Add include guards.
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -245,18 +245,16 @@ class Configuration(DescriptorProvider):
             elif key == 'isNavigatorProperty':
                 getter = lambda x: x.interface.isNavigatorProperty()
             elif key == 'isExposedInAnyWorker':
                 getter = lambda x: x.interface.isExposedInAnyWorker()
             elif key == 'isExposedInWorkerDebugger':
                 getter = lambda x: x.interface.isExposedInWorkerDebugger()
             elif key == 'isExposedInAnyWorklet':
                 getter = lambda x: x.interface.isExposedInAnyWorklet()
-            elif key == 'isExposedInSystemGlobals':
-                getter = lambda x: x.interface.isExposedInSystemGlobals()
             elif key == 'isExposedInWindow':
                 getter = lambda x: x.interface.isExposedInWindow()
             else:
                 # Have to watch out: just closing over "key" is not enough,
                 # since we're about to mutate its value
                 getter = (lambda attrName: lambda x: getattr(x, attrName))(key)
             tofilter.append((getter, val))
         for f in tofilter:
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -506,33 +506,30 @@ class IDLExposureMixins():
 
         globalNameSetToExposureSet(scope, self._exposureGlobalNames,
                                    self.exposureSet)
 
     def isExposedInWindow(self):
         return 'Window' in self.exposureSet
 
     def isExposedOnMainThread(self):
-        return bool(self.exposureSet & {'Window', 'BackstagePass'})
+        return self.isExposedInWindow()
 
     def isExposedOffMainThread(self):
-        return bool(self.exposureSet - {'Window', 'BackstagePass'})
+        return len(self.exposureSet - {'Window'}) > 0
 
     def isExposedInAnyWorker(self):
         return len(self.getWorkerExposureSet()) > 0
 
     def isExposedInWorkerDebugger(self):
         return len(self.getWorkerDebuggerExposureSet()) > 0
 
     def isExposedInAnyWorklet(self):
         return len(self.getWorkletExposureSet()) > 0
 
-    def isExposedInSystemGlobals(self):
-        return 'BackstagePass' in self.exposureSet
-
     def isExposedInSomeButNotAllWorkers(self):
         """
         Returns true if the Exposed extended attribute for this interface
         exposes it in some worker globals but not others.  The return value does
         not depend on whether the interface is exposed in Window or System
         globals.
         """
         if not self.isExposedInAnyWorker():
@@ -6904,22 +6901,16 @@ class Parser(Tokenizer):
         self._globalScope = IDLScope(BuiltinLocation("<Global Scope>"), None, None)
 
         # To make our test harness work, pretend like we have a primary global already.
         # Note that we _don't_ set _globalScope.primaryGlobalAttr,
         # so we'll still be able to detect multiple PrimaryGlobal extended attributes.
         self._globalScope.primaryGlobalName = "FakeTestPrimaryGlobal"
         self._globalScope.addIfaceGlobalNames("FakeTestPrimaryGlobal", ["FakeTestPrimaryGlobal"])
 
-        # We also add global names for "BackstagePass", which doesn't have any
-        # corresponding interfaces. Expose all Window interfaces, as Chrome
-        # code should be able to access them, as well as System-only
-        # interfaces.
-        self._globalScope.addIfaceGlobalNames("BackstagePass", ["Window", "System"])
-
         self._installBuiltins(self._globalScope)
         self._productions = []
 
         self._filename = "<builtin>"
         self.lexer.input(Parser._builtins)
         self._filename = None
 
         self.parser.parse(lexer=self.lexer, tracking=True)