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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.py

Issue 2732093003: bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: s/isolate->GetCurrentContext()/context/ Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 # [constructor(sequence<DOMString> arg), constructor(Dictionary arg)] 1094 # [constructor(sequence<DOMString> arg), constructor(Dictionary arg)]
1095 # interface I { ... } 1095 # interface I { ... }
1096 # (Need to check array types before objects because an array is an object) 1096 # (Need to check array types before objects because an array is an object)
1097 for idl_type, method in idl_types_methods: 1097 for idl_type, method in idl_types_methods:
1098 if idl_type.native_array_element_type: 1098 if idl_type.native_array_element_type:
1099 # (We test for Array instead of generic Object to type-check.) 1099 # (We test for Array instead of generic Object to type-check.)
1100 # FIXME: test for Object during resolution, then have type check for 1100 # FIXME: test for Object during resolution, then have type check for
1101 # Array in overloaded method: http://crbug.com/262383 1101 # Array in overloaded method: http://crbug.com/262383
1102 yield '%s->IsArray()' % cpp_value, method 1102 yield '%s->IsArray()' % cpp_value, method
1103 for idl_type, method in idl_types_methods: 1103 for idl_type, method in idl_types_methods:
1104 if idl_type.is_dictionary or idl_type.name == 'Dictionary' or idl_type.i s_callback_interface: 1104 if idl_type.is_dictionary or idl_type.name == 'Dictionary' or \
1105 idl_type.is_callback_interface or idl_type.is_record_type:
1105 # FIXME: should be '{1}->IsObject() && !{1}->IsRegExp()'.format(cpp_ value) 1106 # FIXME: should be '{1}->IsObject() && !{1}->IsRegExp()'.format(cpp_ value)
1106 # FIXME: the IsRegExp checks can be skipped if we've 1107 # FIXME: the IsRegExp checks can be skipped if we've
1107 # already generated tests for them. 1108 # already generated tests for them.
1108 yield '%s->IsObject()' % cpp_value, method 1109 yield '%s->IsObject()' % cpp_value, method
1109 1110
1110 # (Check for exact type matches before performing automatic type conversion; 1111 # (Check for exact type matches before performing automatic type conversion;
1111 # only needed if distinguishing between primitive types.) 1112 # only needed if distinguishing between primitive types.)
1112 if len([idl_type.is_primitive_type for idl_type in idl_types]) > 1: 1113 if len([idl_type.is_primitive_type for idl_type in idl_types]) > 1:
1113 # (Only needed if match in step 11, otherwise redundant.) 1114 # (Only needed if match in step 11, otherwise redundant.)
1114 if any(idl_type.is_string_type or idl_type.is_enum 1115 if any(idl_type.is_string_type or idl_type.is_enum
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 extended_attributes = deleter.extended_attributes 1373 extended_attributes = deleter.extended_attributes
1373 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1374 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1374 is_ce_reactions = 'CEReactions' in extended_attributes 1375 is_ce_reactions = 'CEReactions' in extended_attributes
1375 return { 1376 return {
1376 'is_call_with_script_state': is_call_with_script_state, 1377 'is_call_with_script_state': is_call_with_script_state,
1377 'is_ce_reactions': is_ce_reactions, 1378 'is_ce_reactions': is_ce_reactions,
1378 'is_custom': 'Custom' in extended_attributes, 1379 'is_custom': 'Custom' in extended_attributes,
1379 'is_raises_exception': 'RaisesException' in extended_attributes, 1380 'is_raises_exception': 'RaisesException' in extended_attributes,
1380 'name': cpp_name(deleter), 1381 'name': cpp_name(deleter),
1381 } 1382 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8.h ('k') | third_party/WebKit/Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698