diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-10 10:53:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-10 10:53:35 -0500 |
commit | 08a55e29511a2b26b7ae26ebb0b9271f80e2a7bd (patch) | |
tree | 502483f3666037c9a636a02c921ffb6e6b32897a /components/script/dom/bindings/codegen/CodegenRust.py | |
parent | 2fb8525919a72a1e1d5c873fb18a97c67c93bd95 (diff) | |
parent | fda011923eda8cc8553ab480ff6340c69b409583 (diff) | |
download | servo-08a55e29511a2b26b7ae26ebb0b9271f80e2a7bd.tar.gz servo-08a55e29511a2b26b7ae26ebb0b9271f80e2a7bd.zip |
Auto merge of #11214 - farodin91:windowproxy, r=jdm
Support WindowProxy return values in bindings
Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` does not report any errors
- [x] These changes fix #10965 (github issue number if applicable).
Either:
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11214)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index c356a7d066c..057246f05aa 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -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): |