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

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

Issue 1029093003: [WIP] IDL: Add limited serializer support and use for RTCIceCandidate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use V8ObjectBuilder in modules/crypto Created 5 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
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 646d7fc450cb5cbf9be10319993338d7071568d4..c2f8312c743f818c09b512c94d686fa76ea02e8f 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -92,6 +92,7 @@ CPP_TYPE_SAME_AS_IDL_TYPE = set([
'float',
'long long',
'unsigned long long',
+ 'V8ObjectBuilder',
])
CPP_INT_TYPES = set([
'byte',
@@ -223,11 +224,15 @@ def cpp_type_initializer(idl_type):
if base_idl_type == 'boolean':
return ' = false'
if (base_idl_type in NON_WRAPPER_TYPES or
- base_idl_type in CPP_SPECIAL_CONVERSION_RULES or
- base_idl_type == 'any' or
- idl_type.is_string_type or
- idl_type.is_enum):
+ base_idl_type in CPP_SPECIAL_CONVERSION_RULES or
+ base_idl_type == 'any' or
+ idl_type.is_string_type or
+ idl_type.is_enum or
+ idl_type.is_dictionary or
+ idl_type.is_union_type):
return ''
+ if base_idl_type == 'V8ObjectBuilder':
+ return '(info.GetIsolate())'
return ' = nullptr'
@@ -363,6 +368,7 @@ INCLUDES_FOR_TYPE = {
'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h',
'bindings/core/v8/SerializedScriptValueFactory.h']),
'ScriptValue': set(['bindings/core/v8/ScriptValue.h']),
+ 'V8ObjectBuilder': set(['bindings/core/v8/V8ObjectBuilder.h']),
}
@@ -661,7 +667,7 @@ def use_output_parameter_for_result(idl_type):
"""True when methods/getters which return the given idl_type should
take the output argument.
"""
- return idl_type.is_dictionary or idl_type.is_union_type
+ return idl_type.is_dictionary or idl_type.is_union_type or idl_type.base_type == 'V8ObjectBuilder'
IdlTypeBase.use_output_parameter_for_result = property(use_output_parameter_for_result)
@@ -800,6 +806,8 @@ V8_SET_RETURN_VALUE = {
'NullableDictionary': 'v8SetReturnValue(info, result.get())',
# Union types or dictionaries
'DictionaryOrUnion': 'v8SetReturnValue(info, result)',
+ # Special container used for toJSON() resulting from serializer definitions.
+ 'V8ObjectBuilder': 'v8SetReturnValue(info, result.v8Value())',
}

Powered by Google App Engine
This is Rietveld 408576698