Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Unified Diff: client/dom/scripts/databasebuilder.py

Issue 8935001: Mark VoidCallback as a [Callback] (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/dom/idl/dart/dart.idl ('k') | client/dom/wrapping_dom.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/databasebuilder.py
diff --git a/client/dom/scripts/databasebuilder.py b/client/dom/scripts/databasebuilder.py
index fd1b0c924ba7f7fec86af599f1a317be2a33f048..5132ecbf5dcab9df65655b1be67f68abff8042c1 100755
--- a/client/dom/scripts/databasebuilder.py
+++ b/client/dom/scripts/databasebuilder.py
@@ -256,12 +256,26 @@ class DatabaseBuilder(object):
recurse(interface)
return res[1:]
+ def _merge_ext_attrs(self, old_attrs, new_attrs):
+ """Merges two sets of extended attributes.
+
+ Returns: True if old_attrs has changed.
+ """
+ changed = False
+ for (name, value) in new_attrs.items():
+ if name in old_attrs and old_attrs[name] == value:
+ pass # Identical
+ else:
+ old_attrs[name] = value
+ changed = True
+ return changed
+
def _merge_nodes(self, old_list, new_list, import_options):
"""Merges two lists of nodes. Annotates nodes with the source of each
node.
Returns:
- True is the old_list has changed.
+ True if the old_list has changed.
Args:
old_list -- the list to merge into.
@@ -302,12 +316,8 @@ class DatabaseBuilder(object):
# Maybe merge annotations:
if (isinstance(old_node, IDLAttribute) or
isinstance(old_node, IDLOperation)):
- for (name, value) in new_node.ext_attrs.items():
- if name in old_node.ext_attrs and old_node.ext_attrs[name] == value:
- pass # Identical
- else:
- old_node.ext_attrs[name] = value
- changed = True
+ if self._merge_ext_attrs(old_node.ext_attrs, new_node.ext_attrs):
+ changed = True
# Remove annotations on obsolete items from the same source
if import_options.obsolete_old_declarations:
@@ -359,6 +369,9 @@ class DatabaseBuilder(object):
if merge_list('operations'):
changed = True
+ if self._merge_ext_attrs(old_interface.ext_attrs, new_interface.ext_attrs):
+ changed = True
+
# Snippets are just concatentated:
if new_interface.snippets:
old_interface.snippets.extend(
« no previous file with comments | « client/dom/idl/dart/dart.idl ('k') | client/dom/wrapping_dom.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698