| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 for method in interface.operations] | 105 for method in interface.operations] |
| 106 generate_overloads(methods) | 106 generate_overloads(methods) |
| 107 for method in methods: | 107 for method in methods: |
| 108 method['do_generate_method_configuration'] = ( | 108 method['do_generate_method_configuration'] = ( |
| 109 method['do_not_check_signature'] and | 109 method['do_not_check_signature'] and |
| 110 not method['per_context_enabled_function_name'] and | 110 not method['per_context_enabled_function_name'] and |
| 111 # For overloaded methods, only generate one accessor | 111 # For overloaded methods, only generate one accessor |
| 112 ('overload_index' not in method or method['overload_index'] == 1)) | 112 ('overload_index' not in method or method['overload_index'] == 1)) |
| 113 | 113 |
| 114 template_contents.update({ | 114 template_contents.update({ |
| 115 'has_origin_safe_method_setter': any( |
| 116 method['is_check_security_for_frame'] and not method['is_read_only'] |
| 117 for method in methods), |
| 115 'has_method_configuration': any(method['do_generate_method_configuration
'] for method in methods), | 118 'has_method_configuration': any(method['do_generate_method_configuration
'] for method in methods), |
| 116 'has_per_context_enabled_methods': any(method['per_context_enabled_funct
ion_name'] for method in methods), | 119 'has_per_context_enabled_methods': any(method['per_context_enabled_funct
ion_name'] for method in methods), |
| 117 'methods': methods, | 120 'methods': methods, |
| 118 }) | 121 }) |
| 119 | 122 |
| 120 return template_contents | 123 return template_contents |
| 121 | 124 |
| 122 | 125 |
| 123 # [DeprecateAs], [Reflect], [RuntimeEnabled] | 126 # [DeprecateAs], [Reflect], [RuntimeEnabled] |
| 124 def generate_constant(constant): | 127 def generate_constant(constant): |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 '%s->IsString()' % cpp_value, | 242 '%s->IsString()' % cpp_value, |
| 240 '%s->IsObject()' % cpp_value]) | 243 '%s->IsObject()' % cpp_value]) |
| 241 if v8_types.array_or_sequence_type(idl_type): | 244 if v8_types.array_or_sequence_type(idl_type): |
| 242 return '%s->IsArray()' % cpp_value | 245 return '%s->IsArray()' % cpp_value |
| 243 if v8_types.is_wrapper_type(idl_type): | 246 if v8_types.is_wrapper_type(idl_type): |
| 244 type_check = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate(),
worldType(info.GetIsolate()))'.format(idl_type=idl_type, cpp_value=cpp_value) | 247 type_check = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate(),
worldType(info.GetIsolate()))'.format(idl_type=idl_type, cpp_value=cpp_value) |
| 245 if argument['is_nullable']: | 248 if argument['is_nullable']: |
| 246 type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check]) | 249 type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check]) |
| 247 return type_check | 250 return type_check |
| 248 return None | 251 return None |
| OLD | NEW |