Bug 1257037 part 12. Simplify CGRegisterWorkerBindings now that there are no more worker descriptors. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 08 Jul 2016 00:37:55 -0400
changeset 304181 5014c7d22f2fa4e01822949e7c54467a08c16d0a
parent 304180 7b7cf5270426b8153bf86cca34152dff04cd1744
child 304182 762c289ada581c1cef856ab16b241355c2d6c7bc
push id30414
push usercbook@mozilla.com
push dateFri, 08 Jul 2016 09:59:01 +0000
treeherdermozilla-central@45682df2d2d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1257037
milestone50.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 1257037 part 12. Simplify CGRegisterWorkerBindings now that there are no more worker descriptors. r=khuey
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12946,35 +12946,20 @@ class CGDictionary(CGThing):
 class CGRegisterWorkerBindings(CGAbstractMethod):
     def __init__(self, config):
         CGAbstractMethod.__init__(self, None, 'RegisterWorkerBindings', 'bool',
                                   [Argument('JSContext*', 'aCx'),
                                    Argument('JS::Handle<JSObject*>', 'aObj')])
         self.config = config
 
     def definition_body(self):
-        # We have to be a bit careful: Some of the interfaces we want to expose
-        # in workers only have one descriptor, while others have both a worker
-        # and a non-worker descriptor.  When both are present we want the worker
-        # descriptor, but otherwise we want whatever descriptor we've got.
         descriptors = self.config.getDescriptors(hasInterfaceObject=True,
                                                  isExposedInAnyWorker=True,
                                                  register=True,
-                                                 skipGen=False,
-                                                 workers=True)
-        workerDescriptorIfaceNames = set(d.interface.identifier.name for
-                                         d in descriptors)
-        descriptors.extend(
-            filter(
-                lambda d: d.interface.identifier.name not in workerDescriptorIfaceNames,
-                self.config.getDescriptors(hasInterfaceObject=True,
-                                           isExposedInAnyWorker=True,
-                                           register=True,
-                                           skipGen=False,
-                                           workers=False)))
+                                                 skipGen=False)
         conditions = []
         for desc in descriptors:
             bindingNS = toBindingNamespace(desc.name)
             condition = "!%s::GetConstructorObject(aCx, aObj)" % bindingNS
             if desc.isExposedConditionally():
                 condition = (
                     "%s::ConstructorEnabled(aCx, aObj) && " % bindingNS
                     + condition)
@@ -12987,35 +12972,20 @@ class CGRegisterWorkerBindings(CGAbstrac
 class CGRegisterWorkerDebuggerBindings(CGAbstractMethod):
     def __init__(self, config):
         CGAbstractMethod.__init__(self, None, 'RegisterWorkerDebuggerBindings', 'bool',
                                   [Argument('JSContext*', 'aCx'),
                                    Argument('JS::Handle<JSObject*>', 'aObj')])
         self.config = config
 
     def definition_body(self):
-        # We have to be a bit careful: Some of the interfaces we want to expose
-        # in workers only have one descriptor, while others have both a worker
-        # and a non-worker descriptor.  When both are present we want the worker
-        # descriptor, but otherwise we want whatever descriptor we've got.
         descriptors = self.config.getDescriptors(hasInterfaceObject=True,
                                                  isExposedInWorkerDebugger=True,
                                                  register=True,
-                                                 skipGen=False,
-                                                 workers=True)
-        workerDescriptorIfaceNames = set(d.interface.identifier.name for
-                                         d in descriptors)
-        descriptors.extend(
-            filter(
-                lambda d: d.interface.identifier.name not in workerDescriptorIfaceNames,
-                self.config.getDescriptors(hasInterfaceObject=True,
-                                           isExposedInWorkerDebugger=True,
-                                           register=True,
-                                           skipGen=False,
-                                           workers=False)))
+                                                 skipGen=False)
         conditions = []
         for desc in descriptors:
             bindingNS = toBindingNamespace(desc.name)
             condition = "!%s::GetConstructorObject(aCx, aObj)" % bindingNS
             if desc.isExposedConditionally():
                 condition = (
                     "%s::ConstructorEnabled(aCx, aObj) && " % bindingNS
                     + condition)