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

Unified Diff: bindings/scripts/v8_dictionary.py

Issue 2786203002: Roll 50: Copied IDLs, PYTHON scripts from WebKit removed deleted files in WebCore (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bindings/scripts/v8_callback_interface.py ('k') | bindings/scripts/v8_interface.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bindings/scripts/v8_dictionary.py
diff --git a/bindings/scripts/v8_dictionary.py b/bindings/scripts/v8_dictionary.py
index 36129b552e2688af954c900efa4b5596a7391b66..dde7e1ce6ae3ebc43eb9d3c9506c7df6f5dc133a 100644
--- a/bindings/scripts/v8_dictionary.py
+++ b/bindings/scripts/v8_dictionary.py
@@ -60,6 +60,9 @@ def dictionary_context(dictionary, interfaces_info):
'members': [member_context(dictionary, member)
for member in sorted(dictionary.members,
key=operator.attrgetter('name'))],
+ 'required_member_names': sorted([member.name
+ for member in dictionary.members
+ if member.is_required]),
'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in dictionary.extended_attributes,
'v8_class': v8_types.v8_type(cpp_class),
'v8_original_class': v8_types.v8_type(dictionary.name),
@@ -99,6 +102,7 @@ def member_context(dictionary, member):
cpp_default_value, v8_default_value = default_values()
cpp_name = v8_utilities.cpp_name(member)
+ is_deprecated_dictionary = unwrapped_idl_type.name == 'Dictionary'
return {
'cpp_default_value': cpp_default_value,
@@ -113,11 +117,12 @@ def member_context(dictionary, member):
'enum_values': unwrapped_idl_type.enum_values,
'has_method_name': has_method_name_for_dictionary_member(member),
'idl_type': idl_type.base_type,
- 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dictionary,
+ 'is_interface_type': idl_type.is_interface_type and not (idl_type.is_dictionary_type or is_deprecated_dictionary),
'is_nullable': idl_type.is_nullable,
- 'is_object': unwrapped_idl_type.name == 'Object',
+ 'is_object': unwrapped_idl_type.name == 'Object' or is_deprecated_dictionary,
'is_required': member.is_required,
'name': member.name,
+ 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(member), # [RuntimeEnabled]
'setter_name': setter_name_for_dictionary_member(member),
'null_setter_name': null_setter_name_for_dictionary_member(member),
'v8_default_value': v8_default_value,
@@ -177,6 +182,8 @@ def member_impl_context(member, interfaces_info, header_includes):
return '!m_%s.isNull()' % cpp_name
elif idl_type.name in ['Any', 'Object']:
return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(cpp_name)
+ elif idl_type.name == 'Dictionary':
+ return '!m_%s.isUndefinedOrNull()' % cpp_name
else:
return 'm_%s' % cpp_name
« no previous file with comments | « bindings/scripts/v8_callback_interface.py ('k') | bindings/scripts/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698