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

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

Issue 561633003: IDL: Enumerations support in dictionaries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove parens Created 6 years, 3 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/scripts/v8_dictionary.py ('k') | Source/bindings/templates/dictionary_v8.h » ('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 1c2d7b8c01b00452f6edbcc376bb929b9c343d7e..fd45dddb2564a80b240e5e9e561d8d58b97cd434 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -475,6 +475,7 @@ V8_VALUE_TO_CPP_VALUE = {
def v8_conversion_needs_exception_state(idl_type):
return (idl_type.is_integer_type or
+ idl_type.is_dictionary or
idl_type.name in ('ByteString', 'ScalarValueString'))
IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state)
@@ -508,7 +509,7 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolat
'{v8_value}->Is{idl_type}() ? '
'V8{idl_type}::toImpl(v8::Handle<v8::{idl_type}>::Cast({v8_value})) : 0')
elif idl_type.is_dictionary:
- cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value})'
+ cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, exceptionState)'
else:
cpp_expression_format = (
'V8{idl_type}::toImplWithTypeCheck({isolate}, {v8_value})')
@@ -803,12 +804,13 @@ IdlType.literal_cpp_value = literal_cpp_value
def cpp_type_has_null_value(idl_type):
# - String types (String/AtomicString) represent null as a null string,
# i.e. one for which String::isNull() returns true.
+ # - Enum types, as they are implemented as Strings.
# - Wrapper types (raw pointer or RefPtr/PassRefPtr) represent null as
# a null pointer.
# - Dictionary types represent null as a null pointer. They are garbage
# collected so their type is raw pointer.
return (idl_type.is_string_type or idl_type.is_wrapper_type or
- idl_type.is_dictionary)
+ idl_type.is_enum or idl_type.is_dictionary)
IdlTypeBase.cpp_type_has_null_value = property(cpp_type_has_null_value)
« no previous file with comments | « Source/bindings/scripts/v8_dictionary.py ('k') | Source/bindings/templates/dictionary_v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698