Chromium Code Reviews| Index: lib/dom/scripts/databasebuilder.py |
| diff --git a/lib/dom/scripts/databasebuilder.py b/lib/dom/scripts/databasebuilder.py |
| index 9ad31bf0783f4c0e29c4940d1717f78a9868b426..de4c7548708e0cb62717c0b26895009c34684e0a 100755 |
| --- a/lib/dom/scripts/databasebuilder.py |
| +++ b/lib/dom/scripts/databasebuilder.py |
| @@ -121,35 +121,14 @@ class DatabaseBuilder(object): |
| new_attributes.append(setter_attr) |
| interface.attributes = new_attributes |
| - # Remove optional annotations from legacy optional arguments. |
| + # Add 'Optional' attribute to whitelisted arguments. |
| for op in interface.operations: |
| for i in range(0, len(op.arguments)): |
|
Anton Muhin
2012/06/04 14:43:13
it looks like for argument in op.arguments is now
podivilov
2012/06/04 15:12:02
Done.
|
| argument = op.arguments[i] |
| - |
| in_optional_whitelist = (interface.id, op.id, argument.id) in optional_argument_whitelist |
| if in_optional_whitelist or set(['Optional', 'Callback']).issubset(argument.ext_attrs.keys()): |
| - argument.is_optional = True |
| argument.ext_attrs['Optional'] = None |
| argument.ext_attrs['RequiredCppParameter'] = None |
| - continue |
| - |
| - if 'Optional' in argument.ext_attrs: |
| - optional_value = argument.ext_attrs['Optional'] |
| - if optional_value: |
| - argument.is_optional = False |
| - del argument.ext_attrs['Optional'] |
| - |
| - # split operations with optional args into multiple operations |
| - new_ops = [] |
| - for op in interface.operations: |
| - for i in range(0, len(op.arguments)): |
| - if op.arguments[i].is_optional: |
| - op.arguments[i].is_optional = False |
| - new_op = copy.deepcopy(op) |
| - new_op.arguments = new_op.arguments[:i] |
| - new_ops.append(new_op) |
| - new_ops.append(op) |
| - interface.operations = new_ops |
| def _rename_types(self, idl_file, import_options): |
| """Rename interface and type names with names provided in the |