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

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

Issue 9310119: Add ImplementedBy attribute for operations merged from [Supplemental=XXX] interfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months 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 | « no previous file | no next file » | 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 a08857464747d67e97ced21e6485c02dffb7b26f..4003e124681b8af7d320e63c4d05c363af24c6d2 100755
--- a/client/dom/scripts/databasebuilder.py
+++ b/client/dom/scripts/databasebuilder.py
@@ -447,19 +447,29 @@ class DatabaseBuilder(object):
# Step 3: Merge in supplemental interfaces
for interface, module_name, import_options in self._imported_interfaces:
- if interface.is_supplemental:
- target_name = interface.ext_attrs['Supplemental']
- if target_name:
- # [Supplemental=DOMWindow] - merge into DOMWindow.
- target = target_name
- else:
- # [Supplemental] - merge into existing inteface with same name.
- target = interface.id
- if self._database.HasInterface(target):
- old_interface = self._database.GetInterface(target)
- self._merge_interfaces(old_interface, interface, import_options)
- else:
- raise Exception("Supplemental target '%s' not found", target)
+ if not interface.is_supplemental:
+ continue
+
+ target_name = interface.ext_attrs['Supplemental'] or interface.id
+ if not self._database.HasInterface(target_name):
+ raise Exception("Supplemental target '%s' not found", target_name)
+ target_interface = self._database.GetInterface(target_name)
+ self._merge_interfaces(target_interface, interface, import_options)
+
+ if target_name == interface.id:
+ # [Supplemental] - merged into existing inteface with same name.
+ continue
+
+ # [Supplemental=DOMWindow] - merged into DOMWindow. Mark operations and
+ # attributes as [ImplementedBy=Interface]
+ attributes = set([attribute.id for attribute in interface.attributes])
+ for attribute in target_interface.attributes:
+ if attribute.id in attributes:
+ attribute.ext_attrs['ImplementedBy'] = interface.id
+ operations = set([operation.id for operation in interface.operations])
+ for operation in target_interface.operations:
+ if operation.id in operations:
sra1 2012/02/06 18:14:36 Is it possible that foo(int) is implemented by I1
+ operation.ext_attrs['ImplementedBy'] = interface.id
# Step 4: Resolve 'implements' statements
for impl_stmt, import_options in self._impl_stmts:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698