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

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

Issue 713403004: IDL: Generic Dictionary support in union types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/scripts/v8_union.py » ('j') | Source/bindings/templates/union.cpp » ('J')
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 d116ffa41822861da917b2b67ab96c90f56666b2..5b7eac40f1914cc62ba2ce2cb19bb3944aaf53ee 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -728,6 +728,9 @@ def v8_conversion_type(idl_type, extended_attributes):
raise 'Unrecognized TreatReturnedNullStringAs value: "%s"' % treat_returned_null_string_as
if idl_type.is_basic_type or base_idl_type == 'ScriptValue':
return base_idl_type
+ # Generic dictionary type
+ if base_idl_type == 'Dictionary':
+ return 'Dictionary'
# Data type with potential additional includes
add_includes_for_type(idl_type)
@@ -767,6 +770,8 @@ V8_SET_RETURN_VALUE = {
'DOMWrapperForMainWorld': 'v8SetReturnValueForMainWorld(info, WTF::getPtr({cpp_value}))',
'DOMWrapperFast': 'v8SetReturnValueFast(info, WTF::getPtr({cpp_value}), {script_wrappable})',
'DOMWrapperDefault': 'v8SetReturnValue(info, {cpp_value})',
+ # Generic dictionary type
+ 'Dictionary': 'v8SetReturnValue(info, {cpp_value})',
# Union types or dictionaries
'DictionaryOrUnion': 'v8SetReturnValue(info, result)',
}
@@ -824,6 +829,7 @@ CPP_VALUE_TO_V8_VALUE = {
'StringOrNull': '{cpp_value}.isNull() ? v8::Handle<v8::Value>(v8::Null({isolate})) : v8String({isolate}, {cpp_value})',
'StringOrUndefined': '{cpp_value}.isNull() ? v8Undefined() : v8String({isolate}, {cpp_value})',
# Special cases
+ 'Dictionary': '{cpp_value}.v8Value()',
'EventHandler': '{cpp_value} ? v8::Handle<v8::Value>(V8AbstractEventListener::cast({cpp_value})->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null({isolate}))',
'ScriptValue': '{cpp_value}.v8Value()',
'SerializedScriptValue': '{cpp_value} ? {cpp_value}->deserialize() : v8::Handle<v8::Value>(v8::Null({isolate}))',
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_union.py » ('j') | Source/bindings/templates/union.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698