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