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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.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/modules/V8TestInterface5.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
index 0d91ab3752f53355b3cf37055ca423b895f92262..6894dce89483b724669fac2d3f8920cf231a5e46 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -315,10 +315,12 @@ static void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCall
static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
- V8ThrowException::throwException(info.GetIsolate(), createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodTestInterfaceEmptyArg", "TestInterface5", 1, info.Length()));
+ throwMinimumArityErrorForMethod(info.GetIsolate(), "TestInterface5", "voidMethodTestInterfaceEmptyArg", 1, info.Length());
return;
}
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
TestInterfaceEmpty* testInterfaceEmptyArg;
{
testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
@@ -337,12 +339,15 @@ static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall
static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleArgFloatArg", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "voidMethodDoubleArgFloatArg");
+
if (UNLIKELY(info.Length() < 2)) {
- setMinimumArityTypeError(exceptionState, 2, info.Length());
+ throwMinimumArityError(exceptionState, 2, info.Length());
return;
}
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
double doubleArg;
float floatArg;
{
@@ -363,12 +368,15 @@ static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback
static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg");
+
if (UNLIKELY(info.Length() < 2)) {
- setMinimumArityTypeError(exceptionState, 2, info.Length());
+ throwMinimumArityError(exceptionState, 2, info.Length());
return;
}
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
double unrestrictedDoubleArg;
float unrestrictedFloatArg;
{
@@ -390,6 +398,7 @@ static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co
static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
impl->voidMethod();
}
@@ -401,6 +410,7 @@ static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
impl->voidMethod();
}
@@ -412,6 +422,7 @@ static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<
static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
impl->alwaysExposedMethod();
}
@@ -423,6 +434,7 @@ static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
impl->workerExposedMethod();
}
@@ -434,6 +446,7 @@ static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
impl->windowExposedMethod();
}
@@ -475,6 +488,7 @@ static void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackIn
static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
impl->windowAndServiceWorkerExposedMethod();
}
@@ -485,12 +499,15 @@ static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::Function
static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodBooleanOrDOMStringArg", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "voidMethodBooleanOrDOMStringArg");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
BooleanOrString arg;
{
V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
@@ -507,12 +524,15 @@ static void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCall
static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleOrDOMStringArg", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "voidMethodDoubleOrDOMStringArg");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
DoubleOrString arg;
{
V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
@@ -529,8 +549,10 @@ static void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallb
static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "keys");
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->keysForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -546,8 +568,10 @@ static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "values");
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -563,8 +587,10 @@ static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "entries");
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -580,12 +606,16 @@ static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "forEach");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
ScriptValue callback;
ScriptValue thisArg;
{
@@ -596,7 +626,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;
@@ -611,6 +640,7 @@ static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
+
v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
}
@@ -621,8 +651,10 @@ static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface5", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface5", "iterator");
+
TestInterface5Implementation* impl = V8TestInterface5::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