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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceNode.cpp

Issue 265293004: Create fewer local v8::TryCatch objects in generated bindings code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added comment Created 6 years, 7 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/V8TestInterfaceNode.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceNode.cpp b/Source/bindings/tests/results/V8TestInterfaceNode.cpp
index 47bf1807ce1fe58d77a9cdc8fb06afd6e76608c4..87cf690697edd6c08cd846e71cae22fb5a3e168a 100644
--- a/Source/bindings/tests/results/V8TestInterfaceNode.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceNode.cpp
@@ -249,11 +249,15 @@ static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c
static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
- if (UNLIKELY(info.Length() <= 0)) {
- v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()), impl);
- return;
+ bool optionalBooleanArgument;
+ {
+ v8::TryCatch block;
+ if (UNLIKELY(info.Length() <= 0)) {
+ v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()), impl);
+ return;
+ }
+ TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue());
}
- TONATIVE_VOID(bool, optionalBooleanArgument, info[0]->BooleanValue());
v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg(optionalBooleanArgument)), impl);
}
@@ -267,11 +271,15 @@ static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder());
- if (UNLIKELY(info.Length() <= 0)) {
- v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()));
- return;
+ bool optionalBooleanArgument;
+ {
+ v8::TryCatch block;
+ if (UNLIKELY(info.Length() <= 0)) {
+ v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg()));
+ return;
+ }
+ TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue());
}
- TONATIVE_VOID(bool, optionalBooleanArgument, info[0]->BooleanValue());
v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg(optionalBooleanArgument)));
}

Powered by Google App Engine
This is Rietveld 408576698