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

Unified Diff: Source/bindings/scripts/interface_dependency_resolver.py

Issue 971783002: IDL: Remove last traces of [TypeChecking=Unrestricted] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
Index: Source/bindings/scripts/interface_dependency_resolver.py
diff --git a/Source/bindings/scripts/interface_dependency_resolver.py b/Source/bindings/scripts/interface_dependency_resolver.py
index 0db1ca18328fd4551dcad32a81f5a54c1055dca0..f755d878ae24d6bf1de1b00a1751673e7fd550b1 100644
--- a/Source/bindings/scripts/interface_dependency_resolver.py
+++ b/Source/bindings/scripts/interface_dependency_resolver.py
@@ -44,16 +44,12 @@ from utilities import idl_filename_to_component, is_valid_component_dependency
# Note that this moves the extended attribute from the interface to the member,
# which changes the semantics and yields different code than the same extended
# attribute on the main interface.
-#
-# Paired with the extended attribute name is its value type; needed to be able
-# to correctly merge interface-level occurrences with ones that may
-# be present on the method/attribute/constant.
-DEPENDENCY_EXTENDED_ATTRIBUTES = {
- 'Conditional': 'string',
- 'PerContextEnabled': 'string',
- 'RuntimeEnabled': 'string',
- 'TypeChecking': 'list',
-}
+DEPENDENCY_EXTENDED_ATTRIBUTES = frozenset([
+ 'Conditional',
+ 'PerContextEnabled',
+ 'RuntimeEnabled',
+ 'TypeChecking',
+])
class InterfaceDependencyResolver(object):
@@ -248,7 +244,7 @@ def transfer_extended_attributes(dependency_interface, dependency_interface_base
merged_extended_attributes = dict(
(key, value)
for key, value in dependency_interface.extended_attributes.iteritems()
- if key in DEPENDENCY_EXTENDED_ATTRIBUTES.keys())
+ if key in DEPENDENCY_EXTENDED_ATTRIBUTES)
# A partial interface's members are implemented as static member functions
# in a separate C++ class. This class name is stored in
@@ -280,20 +276,8 @@ def transfer_extended_attributes(dependency_interface, dependency_interface_base
'ImplementedAs', dependency_interface_basename))
def update_attributes(attributes, extras):
- def to_list(x):
- if type(x) is list:
- return x
- else:
- return [x]
-
for key, value in extras.items():
- if key in attributes:
- # Interface-level extended attributes do not take precedence
- # over same attribute at the method/attribute/const-level.
- # If the attribute value is a list, the two are combined.
- if DEPENDENCY_EXTENDED_ATTRIBUTES[key] == 'list':
- attributes[key] = to_list(attributes[key]) + to_list(value)
- else:
+ if key not in attributes:
attributes[key] = value
for attribute in dependency_interface.attributes:

Powered by Google App Engine
This is Rietveld 408576698