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: Source/bindings/tests/results/core/V8TestInterface2.cpp

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: minor cleanup Created 5 years, 10 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: Source/bindings/tests/results/core/V8TestInterface2.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface2.cpp b/Source/bindings/tests/results/core/V8TestInterface2.cpp
index 0cc9dab31802ee5058f37a98a8407a8d2541b8ef..38783624c4a56eded432222b4488e6690fba7bb9 100644
--- a/Source/bindings/tests/results/core/V8TestInterface2.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface2.cpp
@@ -47,7 +47,9 @@ static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
unsigned index;
{
- TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exceptionState), exceptionState);
+ index = toUInt32(info[0], exceptionState);
+ if (exceptionState.throwIfNeeded())
+ return;
}
RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState);
if (exceptionState.hadException()) {
@@ -76,7 +78,9 @@ static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
unsigned index;
TestInterfaceEmpty* value;
{
- TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exceptionState), exceptionState);
+ index = toUInt32(info[0], exceptionState);
+ if (exceptionState.throwIfNeeded())
+ return;
value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
if (!value) {
exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
@@ -110,7 +114,9 @@ static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
unsigned index;
{
- TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(index, toUInt32(info[0], exceptionState), exceptionState);
+ index = toUInt32(info[0], exceptionState);
+ if (exceptionState.throwIfNeeded())
+ return;
}
bool result = impl->deleteItem(index, exceptionState);
if (exceptionState.hadException()) {
@@ -138,7 +144,9 @@ static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
V8StringResource<> name;
{
- TOSTRING_VOID_INTERNAL(name, info[0]);
+ name = info[0];
+ if (!name.prepare())
+ return;
}
RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState);
if (exceptionState.hadException()) {
@@ -167,7 +175,9 @@ static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
V8StringResource<> name;
TestInterfaceEmpty* value;
{
- TOSTRING_VOID_INTERNAL(name, info[0]);
+ name = info[0];
+ if (!name.prepare())
+ return;
value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
if (!value && !isUndefinedOrNull(info[1])) {
exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
@@ -201,7 +211,9 @@ static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
V8StringResource<> name;
{
- TOSTRING_VOID_INTERNAL(name, info[0]);
+ name = info[0];
+ if (!name.prepare())
+ return;
}
bool result = impl->deleteNamedItem(name, exceptionState);
if (exceptionState.hadException()) {
@@ -305,7 +317,7 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (!info[0]->IsFunction()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
- exceptionState.throwIfNeeded();
+ exceptionState.throwIfNeeded();
return;
}
callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
@@ -418,7 +430,7 @@ static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
- TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);
+ TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);;
ExceptionState exceptionState(ExceptionState::IndexedSetterContext, "TestInterface2", info.Holder(), info.GetIsolate());
if (!propertyValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
@@ -500,8 +512,10 @@ static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
v8::String::Utf8Value namedProperty(nameString);
ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate());
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
- TOSTRING_VOID(V8StringResource<>, propertyName, nameString);
- TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);
+ V8StringResource<> propertyName(nameString);
+ if (!propertyName.prepare())
+ return;
+ TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);;
if (!propertyValue && !isUndefinedOrNull(v8Value)) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
exceptionState.throwIfNeeded();

Powered by Google App Engine
This is Rietveld 408576698