Support WindowProxy return values in bindings

unscopable
This commit is contained in:
Jansen Jan 2016-05-17 23:46:04 +02:00
parent 3acb9540ff
commit fda011923e
11 changed files with 69 additions and 61 deletions

View file

@ -1695,7 +1695,7 @@ class CGImports(CGWrapper):
"""
Generates the appropriate import/use statements.
"""
def __init__(self, child, descriptors, callbacks, imports, ignored_warnings=None):
def __init__(self, child, descriptors, callbacks, imports, config, ignored_warnings=None):
"""
Adds a set of imports.
"""
@ -1756,7 +1756,11 @@ class CGImports(CGWrapper):
for c in callbacks:
types += relatedTypesForSignatures(c)
imports += ['dom::types::%s' % getIdentifier(t).name for t in types if isImportable(t)]
descriptorProvider = config.getDescriptorProvider()
for t in types:
if isImportable(t):
descriptor = descriptorProvider.getDescriptor(getIdentifier(t).name)
imports += ['%s' % descriptor.path]
statements = []
if len(ignored_warnings) > 0:
@ -2090,7 +2094,7 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
# Sort unionStructs by key, retrieve value
unionStructs = (i[1] for i in sorted(unionStructs.items(), key=operator.itemgetter(0)))
return CGImports(CGList(unionStructs, "\n\n"), [], [], imports, ignored_warnings=[])
return CGImports(CGList(unionStructs, "\n\n"), [], [], imports, config, ignored_warnings=[])
class Argument():
@ -5460,7 +5464,8 @@ class CGBindingRoot(CGThing):
# (hence hasInterfaceObject=False).
descriptors.extend(config.getDescriptors(webIDLFile=webIDLFile,
hasInterfaceObject=False,
isCallback=False))
isCallback=False,
register=True))
dictionaries = config.getDictionaries(webIDLFile=webIDLFile)
@ -5588,6 +5593,7 @@ class CGBindingRoot(CGThing):
'dom::bindings::str::{ByteString, DOMString, USVString}',
'dom::bindings::trace::RootedVec',
'dom::bindings::weakref::{DOM_WEAK_SLOT, WeakBox, WeakReferenceable}',
'dom::browsingcontext::BrowsingContext',
'mem::heap_size_of_raw_self_and_children',
'libc',
'util::prefs',
@ -5602,7 +5608,7 @@ class CGBindingRoot(CGThing):
'std::rc::Rc',
'std::default::Default',
'std::ffi::CString',
])
], config)
# Add the auto-generated comment.
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)
@ -6278,7 +6284,7 @@ class GlobalGenRoots():
'dom::bindings::codegen',
'dom::bindings::codegen::PrototypeList::Proxies',
'libc',
], ignored_warnings=[])
], config, ignored_warnings=[])
@staticmethod
def InterfaceTypes(config):