Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
index 071566fd2b3cb1cc3ca06fe3814a234d2287002c..3ac02e4407c9ab53e566dc101e60272ad4bc0972 100644 |
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
@@ -62,6 +62,7 @@ |
#include "core/dom/DOMArrayBufferBase.h" |
#include "core/dom/Document.h" |
#include "core/dom/FlexibleArrayBufferView.h" |
+#include "core/dom/NotShared.h" |
#include "core/dom/TagCollection.h" |
#include "core/dom/custom/V0CustomElementProcessingStack.h" |
#include "core/frame/Deprecation.h" |
@@ -997,7 +998,9 @@ static void float32ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c |
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestObject", "float32ArrayAttribute"); |
// Prepare the value to be set. |
- DOMFloat32Array* cppValue = v8Value->IsFloat32Array() ? V8Float32Array::toImpl(v8::Local<v8::Float32Array>::Cast(v8Value)) : 0; |
+ NotShared<DOMFloat32Array> cppValue = toNotShared<NotShared<DOMFloat32Array>>(info.GetIsolate(), v8Value, exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
// Type check per: http://heycam.github.io/webidl/#es-interface |
if (!cppValue) { |
@@ -1023,7 +1026,9 @@ static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con |
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestObject", "uint8ArrayAttribute"); |
// Prepare the value to be set. |
- DOMUint8Array* cppValue = v8Value->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local<v8::Uint8Array>::Cast(v8Value)) : 0; |
+ NotShared<DOMUint8Array> cppValue = toNotShared<NotShared<DOMUint8Array>>(info.GetIsolate(), v8Value, exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
// Type check per: http://heycam.github.io/webidl/#es-interface |
if (!cppValue) { |
@@ -4244,7 +4249,7 @@ static void voidMethodArrayBufferOrNullArgMethod(const v8::FunctionCallbackInfo< |
} |
TestArrayBuffer* arrayBufferArg; |
- arrayBufferArg = info[0]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[0])) : 0; |
+ arrayBufferArg = V8ArrayBuffer::toImplWithTypeCheck(info.GetIsolate(), info[0]); |
if (!arrayBufferArg && !isUndefinedOrNull(info[0])) { |
V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodArrayBufferOrNullArg", "TestObject", "parameter 1 is not of type 'ArrayBuffer'.")); |
@@ -4255,17 +4260,21 @@ static void voidMethodArrayBufferOrNullArgMethod(const v8::FunctionCallbackInfo< |
} |
static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodArrayBufferViewArg"); |
+ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodArrayBufferViewArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))); |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
return; |
} |
- TestArrayBufferView* arrayBufferViewArg; |
- arrayBufferViewArg = info[0]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[0])) : 0; |
+ NotShared<TestArrayBufferView> arrayBufferViewArg; |
+ arrayBufferViewArg = toNotShared<NotShared<TestArrayBufferView>>(info.GetIsolate(), info[0], exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
if (!arrayBufferViewArg) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodArrayBufferViewArg", "TestObject", "parameter 1 is not of type 'ArrayBufferView'.")); |
+ exceptionState.throwTypeError("parameter 1 is not of type 'ArrayBufferView'."); |
return; |
} |
@@ -4274,17 +4283,19 @@ static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8 |
} |
static void voidMethodFlexibleArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodFlexibleArrayBufferViewArg"); |
+ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodFlexibleArrayBufferViewArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))); |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
return; |
} |
FlexibleArrayBufferView arrayBufferViewArg; |
toFlexibleArrayBufferView(info.GetIsolate(), info[0], arrayBufferViewArg, allocateFlexibleArrayBufferViewStorage(info[0])); |
if (!arrayBufferViewArg) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodFlexibleArrayBufferViewArg", "TestObject", "parameter 1 is not of type 'ArrayBufferView'.")); |
+ exceptionState.throwTypeError("parameter 1 is not of type 'ArrayBufferView'."); |
return; |
} |
@@ -4293,17 +4304,19 @@ static void voidMethodFlexibleArrayBufferViewArgMethod(const v8::FunctionCallbac |
} |
static void voidMethodFlexibleArrayBufferViewTypedArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodFlexibleArrayBufferViewTypedArg"); |
+ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodFlexibleArrayBufferViewTypedArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))); |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
return; |
} |
FlexibleFloat32ArrayView typedArrayBufferViewArg; |
toFlexibleArrayBufferView(info.GetIsolate(), info[0], typedArrayBufferViewArg, allocateFlexibleArrayBufferViewStorage(info[0])); |
if (!typedArrayBufferViewArg) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodFlexibleArrayBufferViewTypedArg", "TestObject", "parameter 1 is not of type 'Float32Array'.")); |
+ exceptionState.throwTypeError("parameter 1 is not of type 'Float32Array'."); |
return; |
} |
@@ -4312,17 +4325,21 @@ static void voidMethodFlexibleArrayBufferViewTypedArgMethod(const v8::FunctionCa |
} |
static void voidMethodFloat32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodFloat32ArrayArg"); |
+ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodFloat32ArrayArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))); |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
return; |
} |
- DOMFloat32Array* float32ArrayArg; |
- float32ArrayArg = info[0]->IsFloat32Array() ? V8Float32Array::toImpl(v8::Local<v8::Float32Array>::Cast(info[0])) : 0; |
+ NotShared<DOMFloat32Array> float32ArrayArg; |
+ float32ArrayArg = toNotShared<NotShared<DOMFloat32Array>>(info.GetIsolate(), info[0], exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
if (!float32ArrayArg) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodFloat32ArrayArg", "TestObject", "parameter 1 is not of type 'Float32Array'.")); |
+ exceptionState.throwTypeError("parameter 1 is not of type 'Float32Array'."); |
return; |
} |
@@ -4331,17 +4348,21 @@ static void voidMethodFloat32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::V |
} |
static void voidMethodInt32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodInt32ArrayArg"); |
+ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodInt32ArrayArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))); |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
return; |
} |
- DOMInt32Array* int32ArrayArg; |
- int32ArrayArg = info[0]->IsInt32Array() ? V8Int32Array::toImpl(v8::Local<v8::Int32Array>::Cast(info[0])) : 0; |
+ NotShared<DOMInt32Array> int32ArrayArg; |
+ int32ArrayArg = toNotShared<NotShared<DOMInt32Array>>(info.GetIsolate(), info[0], exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
if (!int32ArrayArg) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodInt32ArrayArg", "TestObject", "parameter 1 is not of type 'Int32Array'.")); |
+ exceptionState.throwTypeError("parameter 1 is not of type 'Int32Array'."); |
return; |
} |
@@ -4350,17 +4371,21 @@ static void voidMethodInt32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Val |
} |
static void voidMethodUint8ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodUint8ArrayArg"); |
+ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodUint8ArrayArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))); |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
return; |
} |
- DOMUint8Array* uint8ArrayArg; |
- uint8ArrayArg = info[0]->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local<v8::Uint8Array>::Cast(info[0])) : 0; |
+ NotShared<DOMUint8Array> uint8ArrayArg; |
+ uint8ArrayArg = toNotShared<NotShared<DOMUint8Array>>(info.GetIsolate(), info[0], exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
if (!uint8ArrayArg) { |
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodUint8ArrayArg", "TestObject", "parameter 1 is not of type 'Uint8Array'.")); |
+ exceptionState.throwTypeError("parameter 1 is not of type 'Uint8Array'."); |
return; |
} |