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

Unified Diff: Source/bindings/scripts/v8_types.py

Issue 1159403005: bindings: Use IDL dictionary to implement FontFaceSetLoadEventInit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | « no previous file | Source/bindings/tests/idls/core/TestDictionary.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index eacb50e2bcbd3f91d39a3365078d182faadc20f7..faf823798c0f21195dd2767f081d0b37347b5a86 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -922,8 +922,22 @@ def union_literal_cpp_value(idl_type, idl_literal):
return '%s::from%s(%s)' % (idl_type.name, member_type.name,
member_type.literal_cpp_value(idl_literal))
+
+def array_or_sequence_literal_cpp_value(idl_type, idl_literal):
+ # Only support empty arrays.
+ if idl_literal.value == '[]':
+ element_type = idl_type.element_type
+ ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', element_type.gc_type)
+ inner_type = cpp_template_type(ref_ptr_type, element_type.name)
+ vector_type = cpp_ptr_type('Vector', 'HeapVector',
+ element_type.gc_type)
+ return cpp_template_type(vector_type, inner_type) + '()'
+ raise ValueError('Unsupported literal type: ' + idl_literal.idl_type)
+
+
IdlType.literal_cpp_value = literal_cpp_value
IdlUnionType.literal_cpp_value = union_literal_cpp_value
+IdlArrayOrSequenceType.literal_cpp_value = array_or_sequence_literal_cpp_value
################################################################################
« no previous file with comments | « no previous file | Source/bindings/tests/idls/core/TestDictionary.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698