Chromium Code Reviews| Index: Source/build/scripts/make_element_factory.py |
| diff --git a/Source/build/scripts/make_element_factory.py b/Source/build/scripts/make_element_factory.py |
| index 017e47d0aaaefb53343f44445f0cce0fa5baaf11..4ca2fc10c4b81d16a92799999d0792e5b1e313ee 100755 |
| --- a/Source/build/scripts/make_element_factory.py |
| +++ b/Source/build/scripts/make_element_factory.py |
| @@ -69,10 +69,19 @@ class MakeElementFactoryWriter(MakeQualifiedNamesWriter): |
| fallback_interface = self.tags_in_file.parameters['fallbackInterfaceName'].strip('"') |
| fallback_js_interface = self.tags_in_file.parameters['fallbackJSInterfaceName'].strip('"') or fallback_interface |
| - for tag in self._template_context['tags']: |
| + interface_counts = {} |
| + tags = self._template_context['tags'] |
| + for tag in tags: |
| tag['has_js_interface'] = self._has_js_interface(tag) |
| tag['js_interface'] = self._js_interface(tag) |
| tag['interface'] = self._interface(tag) |
| + if tag['interface'] not in interface_counts: |
| + interface_counts[tag['interface']] = 1 |
| + else: |
| + interface_counts[tag['interface']] += 1 |
|
abarth-chromium
2013/11/09 01:54:50
There's some fancier Pythony way of doing this.
adamk
2013/11/11 20:33:28
Found two ways to do this. defaultdict seems to be
|
| + |
| + for tag in tags: |
| + tag['multipleTagNames'] = interface_counts[tag['interface']] > 1 |
| self._template_context.update({ |
| 'fallback_interface': fallback_interface, |