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

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

Issue 563793002: Use conversion helpers in V8Binding.cpp for [Clamp] method arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index e1d73963463751836406deff71f1519bdf7ad7dd..5f7f0bb8d783867550a371075da1ce216a8dc010 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -91,9 +91,6 @@ RefPtr<{{argument.idl_type}}> {{argument.name}}
{%- else %}
OwnPtrWillBeRawPtr<{{argument.idl_type}}> {{argument.name}} = nullptr;
{%- endif %}{# argument.idl_type == 'EventListener' #}
-{%- elif argument.is_clamp %}{# argument.is_callback_interface #}
-{# NaN is treated as 0: http://www.w3.org/TR/WebIDL/#es-type-mapping #}
-{{argument.cpp_type}} {{argument.name}} = 0
{%- else %}
{{argument.cpp_type}} {{argument.name}}
{%- endif %}
@@ -162,18 +159,6 @@ if (info.Length() <= {{argument.index}} || !{% if argument.is_nullable %}(info[{
{{argument.name}} = {% if argument.is_nullable %}info[{{argument.index}}]->IsNull() ? nullptr : {% endif %}V8{{argument.idl_type}}::create(v8::Handle<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::current(info.GetIsolate()));
{% endif %}{# argument.is_optional #}
{% endif %}{# argument.idl_type == 'EventListener' #}
-{% elif argument.is_clamp %}{# argument.is_callback_interface #}
-{# NaN is treated as 0: http://www.w3.org/TR/WebIDL/#es-type-mapping #}
-double {{argument.name}}NativeValue;
-{% if method.idl_type == 'Promise' %}
-TONATIVE_VOID_PROMISE_INTERNAL({{argument.name}}NativeValue, info[{{argument.index}}]->NumberValue(), info);
-{% else %}
-TONATIVE_VOID_INTERNAL({{argument.name}}NativeValue, info[{{argument.index}}]->NumberValue());
-{% endif %}
-if (!std::isnan({{argument.name}}NativeValue))
- {# IDL type is used for clamping, for the right bounds, since different
- IDL integer types have same internal C++ type (int or unsigned) #}
- {{argument.name}} = clampTo<{{argument.idl_type}}>({{argument.name}}NativeValue);
{% elif argument.idl_type == 'SerializedScriptValue' %}
{{argument.name}} = SerializedScriptValue::create(info[{{argument.index}}], 0, 0, exceptionState, info.GetIsolate());
if (exceptionState.hadException()) {
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698