Index: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
index a0a47790a96e7f346169d1d677a97245f556c1f6..a6b5ad29cf73dcd0e7237b4811bfe378f73aeb12 100644 |
--- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
+++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
@@ -233,6 +233,30 @@ if (!{{argument.name}}.isUndefinedOrNull() && !{{argument.name}}.isObject()) { |
return; |
} |
{% endif %} |
+{% if argument.is_array_buffer_view %} |
+if ({{argument.name}}{% if argument.is_flexible_array_buffer_view %}.{% else %}->{% endif %}isShared()) { |
+ {{throw_type_error(method, |
+ '"parameter %s is a view of a SharedArrayBuffer."' % |
+ (argument.index + 1)) | indent}} |
+ return; |
+} |
+{% elif argument.is_union_with_array_buffer_view %} |
+if ({{argument.name}}.isArrayBufferView() && {{argument.name}}.getAsArrayBufferView()->isShared()) { |
+ {{throw_type_error(method, |
+ '"parameter %s is a view of a SharedArrayBuffer."' % |
+ (argument.index + 1)) | indent}} |
+ return; |
+} |
+{% elif argument.is_sequence_of_union_with_array_buffer_view %} |
+for (size_t i= 0; i < {{argument.name}}.size(); ++i) { |
+ if ({{argument.name}}[i].isArrayBufferView() && {{argument.name}}[i].getAsArrayBufferView()->isShared()) { |
+ {{throw_type_error(method, |
+ '"sequence parameter %s contains a view of a SharedArrayBuffer."' % |
+ (argument.index + 1)) | indent(8)}} |
+ return; |
+ } |
+} |
+{% endif %} |
{% endmacro %} |