OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 def filter_method_configuration(methods, interface_is_partial): | 80 def filter_method_configuration(methods, interface_is_partial): |
81 return [method for method in methods if | 81 return [method for method in methods if |
82 method_is_visible(method, interface_is_partial) and | 82 method_is_visible(method, interface_is_partial) and |
83 method['should_be_exposed_to_script'] and | 83 method['should_be_exposed_to_script'] and |
84 not method['origin_trial_feature_name'] and | 84 not method['origin_trial_feature_name'] and |
85 not conditionally_exposed(method) and | 85 not conditionally_exposed(method) and |
86 not custom_registration(method)] | 86 not custom_registration(method)] |
87 | 87 |
88 | 88 |
89 def method_for_origin_trial_feature(methods, feature_name, interface_is_partial)
: | |
90 """Filters the list of methods, and returns those defined for the named orig
in trial feature.""" | |
91 return [method for method in methods if | |
92 method_is_visible(method, interface_is_partial) and | |
93 method['should_be_exposed_to_script'] and | |
94 method['origin_trial_feature_name'] == feature_name and | |
95 not conditionally_exposed(method) and | |
96 not custom_registration(method)] | |
97 | |
98 | |
99 def method_filters(): | 89 def method_filters(): |
100 return {'conditionally_exposed': filter_conditionally_exposed, | 90 return {'conditionally_exposed': filter_conditionally_exposed, |
101 'custom_registration': filter_custom_registration, | 91 'custom_registration': filter_custom_registration, |
102 'has_method_configuration': filter_method_configuration, | 92 'has_method_configuration': filter_method_configuration} |
103 'method_for_origin_trial_feature': method_for_origin_trial_feature} | |
104 | 93 |
105 | 94 |
106 def use_local_result(method): | 95 def use_local_result(method): |
107 extended_attributes = method.extended_attributes | 96 extended_attributes = method.extended_attributes |
108 idl_type = method.idl_type | 97 idl_type = method.idl_type |
109 return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or | 98 return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or |
110 'ImplementedInPrivateScript' in extended_attributes or | 99 'ImplementedInPrivateScript' in extended_attributes or |
111 'NewObject' in extended_attributes or | 100 'NewObject' in extended_attributes or |
112 'RaisesException' in extended_attributes or | 101 'RaisesException' in extended_attributes or |
113 idl_type.is_union_type or | 102 idl_type.is_union_type or |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return method.idl_type and method.idl_type.name == 'Promise' | 497 return method.idl_type and method.idl_type.name == 'Promise' |
509 | 498 |
510 IdlOperation.returns_promise = property(method_returns_promise) | 499 IdlOperation.returns_promise = property(method_returns_promise) |
511 | 500 |
512 | 501 |
513 def argument_conversion_needs_exception_state(method, argument): | 502 def argument_conversion_needs_exception_state(method, argument): |
514 idl_type = argument.idl_type | 503 idl_type = argument.idl_type |
515 return (idl_type.v8_conversion_needs_exception_state or | 504 return (idl_type.v8_conversion_needs_exception_state or |
516 argument.is_variadic or | 505 argument.is_variadic or |
517 (method.returns_promise and idl_type.is_string_type)) | 506 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |