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

Unified Diff: third_party/WebKit/Source/bindings/templates/union_container.cpp

Issue 1996903002: [Binding] Delete hasInstance() from ArrayBuffer related interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/templates/union_container.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/union_container.cpp b/third_party/WebKit/Source/bindings/templates/union_container.cpp
index 920d223c1e320bd9f7dc59047cdf5313b882cdd8..e9467d44f5e3651d30efe2a165ffe7d6d6d117b7 100644
--- a/third_party/WebKit/Source/bindings/templates/union_container.cpp
+++ b/third_party/WebKit/Source/bindings/templates/union_container.cpp
@@ -10,6 +10,13 @@ if (V8{{member.type_name}}::hasInstance(v8Value, isolate)) {
return;
}
{% endmacro %}
+{% macro assign_and_return_if_isinstance(member) %}
bashi 2016/05/20 08:32:46 drive-by: I'd prefer to add |is_instance_expressio
peria 2016/05/20 09:26:16 Done.
+if (v8Value->Is{{member.type_name}}()) {
+ {{member.cpp_local_type}} cppValue = V8{{member.type_name}}::toImpl(v8::Local<v8::Object>::Cast(v8Value));
+ impl.set{{member.type_name}}(cppValue);
+ return;
+}
+{% endmacro %}
{% for filename in cpp_includes %}
#include "{{filename}}"
{% endfor %}
@@ -80,13 +87,13 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
{% endfor %}
{# 8. ArrayBuffer #}
{% if array_buffer_type %}
- {{assign_and_return_if_hasinstance(array_buffer_type) | indent}}
+ {{assign_and_return_if_isinstance(array_buffer_type) | indent}}
{% endif %}
{# 9., 10. ArrayBufferView #}
{# FIXME: Individual typed arrays (e.g. Uint8Array) aren't supported yet. #}
{% if array_buffer_view_type %}
- {{assign_and_return_if_hasinstance(array_buffer_view_type) | indent}}
+ {{assign_and_return_if_isinstance(array_buffer_view_type) | indent}}
{% endif %}
{% if dictionary_type %}

Powered by Google App Engine
This is Rietveld 408576698