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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp

Issue 2301993002: binding: Introduces ExceptionToPromiseScope. (Closed)
Patch Set: . Created 4 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: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
index fb36d93e9625e57130abe1924ddb3d0ebd21a458..2180f48c8a2b9b9f13f3c843800ba91236e2d4b7 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
@@ -56,12 +56,15 @@ namespace TestInterface2V8Internal {
static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "item");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
unsigned index;
{
index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
@@ -82,12 +85,15 @@ static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "setItem");
+
if (UNLIKELY(info.Length() < 2)) {
- setMinimumArityTypeError(exceptionState, 2, info.Length());
+ throwMinimumArityError(exceptionState, 2, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
unsigned index;
TestInterfaceEmpty* value;
{
@@ -114,12 +120,15 @@ static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "deleteItem");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
unsigned index;
{
index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
@@ -140,12 +149,15 @@ static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "namedItem");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
V8StringResource<> name;
{
name = info[0];
@@ -166,12 +178,15 @@ static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedItem", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "setNamedItem");
+
if (UNLIKELY(info.Length() < 2)) {
- setMinimumArityTypeError(exceptionState, 2, info.Length());
+ throwMinimumArityError(exceptionState, 2, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
V8StringResource<> name;
TestInterfaceEmpty* value;
{
@@ -198,12 +213,15 @@ static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamedItem", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "deleteNamedItem");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
V8StringResource<> name;
{
name = info[0];
@@ -225,6 +243,7 @@ static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val
static void stringifierMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate());
}
@@ -235,8 +254,10 @@ static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "keys");
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->keysForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -252,8 +273,10 @@ static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "values");
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -269,8 +292,10 @@ static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "entries");
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -286,12 +311,16 @@ static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "forEach");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
ScriptValue callback;
ScriptValue thisArg;
{
@@ -302,7 +331,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()), callback, thisArg, exceptionState);
if (exceptionState.hadException()) {
return;
@@ -316,12 +344,16 @@ static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "has");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
TestInterfaceEmpty* value;
{
value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
@@ -330,7 +362,6 @@ static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
return;
}
}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
bool result = impl->hasForBinding(scriptState, value, exceptionState);
if (exceptionState.hadException()) {
return;
@@ -346,6 +377,7 @@ static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate());
}
@@ -356,8 +388,10 @@ static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface2", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface2", "iterator");
+
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->iterator(scriptState, exceptionState);
if (exceptionState.hadException()) {

Powered by Google App Engine
This is Rietveld 408576698