author | Boris Zbarsky <bzbarsky@mit.edu> |
Fri, 08 Jul 2016 00:37:54 -0400 | |
changeset 304176 | 2de33eb0bb321a55cd66168d2440281b5420d466 |
parent 304175 | 64424f160c3a9c5c8daa38bdc9414146c44f03c4 |
child 304177 | 4c5ea0b7a3d109be6e8f20e623c3530205432f63 |
push id | 30414 |
push user | cbook@mozilla.com |
push date | Fri, 08 Jul 2016 09:59:01 +0000 |
treeherder | mozilla-central@45682df2d2d4 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | khuey |
bugs | 1257037 |
milestone | 50.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
|
--- a/dom/bindings/Configuration.py +++ b/dom/bindings/Configuration.py @@ -4,22 +4,40 @@ from WebIDL import IDLImplementsStatement import os from collections import defaultdict autogenerated_comment = "/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n" -class Configuration: +class DescriptorProvider: + """ + A way of getting descriptors for interface names + """ + def __init__(self, config, workers): + self.config = config + self.workers = workers + + def getDescriptor(self, interfaceName): + """ + Gets the appropriate descriptor for the given interface name given the + context of the current descriptor. This selects the appropriate + implementation for cases like workers. + """ + return self.config.getDescriptor(interfaceName, self.workers) + + +class Configuration(DescriptorProvider): """ Represents global configuration state based on IDL parse data and the configuration file. """ def __init__(self, filename, parseData, generatedEvents=[]): + DescriptorProvider.__init__(self, self, False) # Read the configuration file. glbl = {} execfile(filename, glbl) config = glbl['DOMInterfaces'] # Build descriptors for all the interfaces we have in the parse data. # This allows callers to specify a subset of interfaces by filtering @@ -299,33 +317,16 @@ class Configuration: return DescriptorProvider(self, workers) class NoSuchDescriptorError(TypeError): def __init__(self, str): TypeError.__init__(self, str) -class DescriptorProvider: - """ - A way of getting descriptors for interface names - """ - def __init__(self, config, workers): - self.config = config - self.workers = workers - - def getDescriptor(self, interfaceName): - """ - Gets the appropriate descriptor for the given interface name given the - context of the current descriptor. This selects the appropriate - implementation for cases like workers. - """ - return self.config.getDescriptor(interfaceName, self.workers) - - def methodReturnsJSObject(method): assert method.isMethod() if method.returnsPromise(): return True for signature in method.signatures(): returnType = signature[0] if returnType.isObject() or returnType.isSpiderMonkeyInterface():