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

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

Issue 1125683002: Avoid nearly identical toImplArray() and toImplHeapArray() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « Source/bindings/core/v8/V8BindingTest.cpp ('k') | Source/bindings/tests/results/core/UnionTypesCore.cpp » ('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 5e8a45aad46f67fd4d5df1ced2e418bff463a361..b442b56cf28a22fd8261446c1274d8198ef56c07 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -590,14 +590,14 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value,
this_cpp_type = None
ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', native_array_element_type.gc_type)
expression_format = '(to{ref_ptr_type}NativeArray<{native_array_element_type}, V8{native_array_element_type}>({v8_value}, {index}, {isolate}, exceptionState))'
- elif native_array_element_type.is_dictionary:
- ref_ptr_type = None
- this_cpp_type = native_array_element_type.cpp_type
- expression_format = 'toImplHeapArray<{cpp_type}>({v8_value}, {index}, {isolate}, exceptionState)'
else:
ref_ptr_type = None
this_cpp_type = native_array_element_type.cpp_type
- expression_format = 'toImplArray<{cpp_type}>({v8_value}, {index}, {isolate}, exceptionState)'
+ if native_array_element_type.is_dictionary:
+ vector_type = 'HeapVector'
+ else:
+ vector_type = 'Vector'
+ expression_format = 'toImplArray<%s<{cpp_type}>>({v8_value}, {index}, {isolate}, exceptionState)' % vector_type
expression = expression_format.format(native_array_element_type=native_array_element_type.name, cpp_type=this_cpp_type, index=index, ref_ptr_type=ref_ptr_type, v8_value=v8_value, isolate=isolate)
return expression
« no previous file with comments | « Source/bindings/core/v8/V8BindingTest.cpp ('k') | Source/bindings/tests/results/core/UnionTypesCore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698