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

Unified Diff: Source/bindings/templates/methods.cpp

Issue 396283004: Make the MediaQueryList listener an EventListener (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index 4410a719c556bded82ba377ea8f4ed57920062ee..aee02d93b3009b85d66f003cbb80460e2c2ee44a 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -135,7 +135,7 @@ if (info.Length() > {{argument.index}} && {% if argument.is_nullable %}!isUndefi
{% if argument.is_callback_interface %}
{# FIXME: remove EventListener special case #}
{% if argument.idl_type == 'EventListener' %}
-{% if method.name == 'removeEventListener' %}
+{% if method.name == 'removeEventListener' or method.name == 'removeListener' %}
{{argument.name}} = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOnly);
{% else %}{# method.name == 'addEventListener' #}
{{argument.name}} = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOrCreate);
@@ -287,6 +287,13 @@ else
if (info.Length() >= 2 && listener && !impl->toNode())
{{hidden_dependency_action}}(info.Holder(), info[1], {{v8_class}}::eventListenerCacheIndex, info.GetIsolate());
{% endif %}
+{% if interface_name == 'MediaQueryList' and method.name in ('addListener',
haraken 2014/07/20 05:14:49 Why does the MediaQueryList need separate code fro
cbiesinger 2014/07/21 22:07:19 Done.
+ 'removeListener') %}
+{% set hidden_dependency_action = 'addHiddenValueToArray'
+ if method.name == 'addListener' else 'removeHiddenValueFromArray' %}
+if (listener)
+ {{hidden_dependency_action}}(info.Holder(), info[0], {{v8_class}}::eventListenerCacheIndex, info.GetIsolate());
+{% endif %}
{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698