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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceNamedConstructor.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: avoid some unused v8::TryCatch objects 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/V8TestInterfaceNamedConstructor.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp b/Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
index 9567b39369720ef3162213e12e06a006cf5ca56e..8748db6f8d9f793974f495867571ff3409940f54 100644
--- a/Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
@@ -97,19 +97,28 @@ static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio
throwArityTypeError(exceptionState, 1, info.Length());
return;
}
- TOSTRING_VOID(V8StringResource<>, stringArg, info[0]);
- TONATIVE_VOID(bool, defaultUndefinedOptionalBooleanArg, info[1]->BooleanValue());
- TONATIVE_VOID_EXCEPTIONSTATE(int, defaultUndefinedOptionalLongArg, toInt32(info[2], exceptionState), exceptionState);
- TOSTRING_VOID(V8StringResource<>, defaultUndefinedOptionalStringArg, info[3]);
- TOSTRING_VOID(V8StringResource<>, defaultNullStringOptionalstringArg, argumentOrNull(info, 4));
- if (UNLIKELY(info.Length() <= 5)) {
- RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::createForJSConstructor(stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg);
- v8::Handle<v8::Object> wrapper = info.Holder();
- V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(impl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
- v8SetReturnValue(info, wrapper);
- return;
+ V8StringResource<> stringArg;
+ bool defaultUndefinedOptionalBooleanArg;
+ int defaultUndefinedOptionalLongArg;
+ V8StringResource<> defaultUndefinedOptionalStringArg;
+ V8StringResource<> defaultNullStringOptionalstringArg;
+ V8StringResource<> optionalStringArg;
+ {
+ v8::TryCatch block;
+ TOSTRING_VOID_NO_DECL(stringArg, info[0]);
+ TONATIVE_VOID_NO_DECL(defaultUndefinedOptionalBooleanArg, info[1]->BooleanValue());
+ TONATIVE_VOID_EXCEPTIONSTATE_NO_DECL(defaultUndefinedOptionalLongArg, toInt32(info[2], exceptionState), exceptionState);
+ TOSTRING_VOID_NO_DECL(defaultUndefinedOptionalStringArg, info[3]);
+ TOSTRING_VOID_NO_DECL(defaultNullStringOptionalstringArg, argumentOrNull(info, 4));
+ if (UNLIKELY(info.Length() <= 5)) {
+ RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::createForJSConstructor(stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg);
+ v8::Handle<v8::Object> wrapper = info.Holder();
+ V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(impl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
+ v8SetReturnValue(info, wrapper);
+ return;
+ }
+ TOSTRING_VOID_NO_DECL(optionalStringArg, info[5]);
}
- TOSTRING_VOID(V8StringResource<>, optionalStringArg, info[5]);
RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::createForJSConstructor(*document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg, optionalStringArg, exceptionState);
if (exceptionState.throwIfNeeded())
return;

Powered by Google App Engine
This is Rietveld 408576698