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

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

Issue 204213002: Replace custom EventTarget toNative call with [ToNativeArg] extended attribute Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 6c2351c32ce23b20fdbf4740546d895c091e183f..6069280c4a5db2698c0108303d6e237dd5eca90f 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -336,10 +336,7 @@ V8_VALUE_TO_CPP_VALUE = {
# Interface types
'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())',
'Dictionary': 'Dictionary({v8_value}, info.GetIsolate())',
- # FIXME: EventListener is special-cased in templates instead, because
- # removeEventListener uses ListenerFindOnly (only use) instead of
- # ListenerFindOrCreate.
- # 'EventListener': 'V8EventListenerList::getEventListener({v8_value}, false, ListenerFindOrCreate/ListenerFindOnly)'
+ 'EventListener': 'V8EventListenerList::getEventListener({v8_value}, false, {arguments})',
'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::Cast({v8_value})) : 0',
'MediaQueryListListener': 'MediaQueryListListener::create(ScriptValue({v8_value}, info.GetIsolate()))',
'NodeFilter': 'toNodeFilter({v8_value}, info.GetIsolate())',
@@ -362,7 +359,9 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index):
add_includes_for_type(idl_type)
base_idl_type = idl_type.base_type
- if 'EnforceRange' in extended_attributes:
+ if 'ToNativeArg' in extended_attributes:
+ arguments = extended_attributes['ToNativeArg']
+ elif 'EnforceRange' in extended_attributes:
arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState'])
elif idl_type.is_integer_type: # NormalConversion
arguments = ', '.join([v8_value, 'exceptionState'])

Powered by Google App Engine
This is Rietveld 408576698