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

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

Issue 1711783003: Remove support for TreatReturnedNullStringAs=Null|Undefined (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/Source/bindings/scripts/v8_types.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py
index 939dda0dda62e1db8eefdff1b4f1db041fc12d17..04739d2e46ae0fb02a255a9e12b9a11cd68c2554 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_types.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py
@@ -770,14 +770,7 @@ def v8_conversion_type(idl_type, extended_attributes):
if idl_type.is_string_type:
if idl_type.is_nullable:
return 'StringOrNull'
- if 'TreatReturnedNullStringAs' not in extended_attributes:
- return base_idl_type
- treat_returned_null_string_as = extended_attributes['TreatReturnedNullStringAs']
- if treat_returned_null_string_as == 'Null':
- return 'StringOrNull'
- if treat_returned_null_string_as == 'Undefined':
- return 'StringOrUndefined'
- raise 'Unrecognized TreatReturnedNullStringAs value: "%s"' % treat_returned_null_string_as
+ return base_idl_type
if idl_type.is_basic_type or base_idl_type == 'ScriptValue':
return base_idl_type
# Generic dictionary type
@@ -801,9 +794,7 @@ V8_SET_RETURN_VALUE = {
'DOMString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
'ByteString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
'USVString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
- # [TreatReturnedNullStringAs]
'StringOrNull': 'v8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())',
- 'StringOrUndefined': 'v8SetReturnValueStringOrUndefined(info, {cpp_value}, info.GetIsolate())',
'void': '',
# No special v8SetReturnValue* function (set value directly)
'float': 'v8SetReturnValue(info, {cpp_value})',
@@ -890,9 +881,7 @@ CPP_VALUE_TO_V8_VALUE = {
'double': 'v8::Number::New({isolate}, {cpp_value})',
'unrestricted double': 'v8::Number::New({isolate}, {cpp_value})',
'void': 'v8Undefined()',
- # [TreatReturnedNullStringAs]
'StringOrNull': '{cpp_value}.isNull() ? v8::Local<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::Local<v8::Value>(V8AbstractEventListener::cast({cpp_value})->getListenerObject(impl->executionContext())) : v8::Local<v8::Value>(v8::Null({isolate}))',

Powered by Google App Engine
This is Rietveld 408576698