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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.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/V8TestInterface3.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
index 2b20d36116201835ba2b1ed61a0665a46fe929ea..7b390699f7204b68db3c2678026dd7217e4e64bc 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
@@ -67,10 +67,12 @@ static void readonlyStringifierAttributeAttributeGetterCallback(const v8::Functi
static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
- V8ThrowException::throwException(info.GetIsolate(), createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodDocument", "TestInterface3", 1, info.Length()));
+ throwMinimumArityErrorForMethod(info.GetIsolate(), "TestInterface3", "voidMethodDocument", 1, info.Length());
return;
}
+
TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
+
Document* document;
{
document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]);
@@ -89,8 +91,10 @@ static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::
static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "TestInterface3", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface3", "keys");
+
TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->iterableKeys(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -106,8 +110,10 @@ static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "TestInterface3", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface3", "values");
+
TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -123,8 +129,10 @@ static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "TestInterface3", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface3", "entries");
+
TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
+
ScriptState* scriptState = ScriptState::forReceiverObject(info);
Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
@@ -140,12 +148,16 @@ static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestInterface3", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface3", "forEach");
+
if (UNLIKELY(info.Length() < 1)) {
- setMinimumArityTypeError(exceptionState, 1, info.Length());
+ throwMinimumArityError(exceptionState, 1, info.Length());
return;
}
+
TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
+
+ ScriptState* scriptState = ScriptState::forReceiverObject(info);
ScriptValue callback;
ScriptValue thisArg;
{
@@ -156,7 +168,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;
@@ -171,6 +182,7 @@ static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface3* impl = V8TestInterface3::toImpl(info.Holder());
+
v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetIsolate());
}
@@ -181,8 +193,10 @@ static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface3", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestInterface3", "iterator");
+
TestInterface3* impl = V8TestInterface3::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