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

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

Issue 563703002: Oilpan: Enable oilpan for callback classes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 36b7f56c33a81d02999b11f1f766eb6369cbd714..1d9471034afb5256293289003c60baad9f22e673 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -84,16 +84,12 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
{######################################}
{% macro generate_argument_var_declaration(argument) %}
-{% if argument.is_callback_interface %}
{# FIXME: remove EventListener special case #}
{% if argument.idl_type == 'EventListener' %}
RefPtr<{{argument.idl_type}}> {{argument.name}}
{%- else %}
-OwnPtrWillBeRawPtr<{{argument.idl_type}}> {{argument.name}} = nullptr;
-{%- endif %}{# argument.idl_type == 'EventListener' #}
-{%- else %}
{{argument.cpp_type}} {{argument.name}}
-{%- endif %}
+{%- endif %}{# argument.idl_type == 'EventListener' #}
{% endmacro %}
@@ -140,7 +136,7 @@ if (info.Length() > {{argument.index}} && {% if argument.is_nullable %}!isUndefi
{# Callback functions must be functions:
http://www.w3.org/TR/WebIDL/#es-callback-function #}
{% if argument.is_optional %}
-if (info.Length() > {{argument.index}} && !isUndefinedOrNull(info[{{argument.index}}])) {
+if (!isUndefinedOrNull(info[{{argument.index}}])) {
if (!info[{{argument.index}}]->IsFunction()) {
{{throw_type_error(method,
'"The callback provided as parameter %s is not a function."' %
@@ -148,6 +144,8 @@ if (info.Length() > {{argument.index}} && !isUndefinedOrNull(info[{{argument.ind
return;
}
{{argument.name}} = V8{{argument.idl_type}}::create(v8::Handle<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::current(info.GetIsolate()));
+} else {
+ {{argument.name}} = nullptr;
}
{% else %}{# argument.is_optional #}
if (info.Length() <= {{argument.index}} || !{% if argument.is_nullable %}(info[{{argument.index}}]->IsFunction() || info[{{argument.index}}]->IsNull()){% else %}info[{{argument.index}}]->IsFunction(){% endif %}) {
« no previous file with comments | « Source/bindings/templates/callback_interface.h ('k') | Source/bindings/tests/results/core/V8TestCallbackInterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698