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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor2.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterfaceConstructor2.h" 8 #include "V8TestInterfaceConstructor2.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 30 matching lines...) Expand all
41 namespace WebCore { 41 namespace WebCore {
42 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor 2::derefObject, 0, 0, 0, V8TestInterfaceConstructor2::installPerContextEnabledMe thods, 0, WrapperTypeObjectPrototype, RefCountedObject }; 42 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor 2::derefObject, 0, 0, 0, V8TestInterfaceConstructor2::installPerContextEnabledMe thods, 0, WrapperTypeObjectPrototype, RefCountedObject };
43 43
44 namespace TestInterfaceConstructor2V8Internal { 44 namespace TestInterfaceConstructor2V8Internal {
45 45
46 template <typename T> void V8_USE(T) { } 46 template <typename T> void V8_USE(T) { }
47 47
48 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) 48 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
49 { 49 {
50 v8::Isolate* isolate = info.GetIsolate(); 50 v8::Isolate* isolate = info.GetIsolate();
51 TOSTRING_VOID(V8StringResource<>, stringArg, info[0]); 51 V8StringResource<> stringArg;
52 {
53 TOSTRING_VOID_NO_DECL(stringArg, info[0]);
54 }
52 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg); 55 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg);
53 56
54 v8::Handle<v8::Object> wrapper = info.Holder(); 57 v8::Handle<v8::Object> wrapper = info.Holder();
55 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent); 58 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent);
56 v8SetReturnValue(info, wrapper); 59 v8SetReturnValue(info, wrapper);
57 } 60 }
58 61
59 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 62 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
60 { 63 {
61 v8::Isolate* isolate = info.GetIsolate(); 64 v8::Isolate* isolate = info.GetIsolate();
62 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), isolate); 65 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), isolate);
63 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 66 TestInterfaceEmpty* testInterfaceEmptyArg;
64 TONATIVE_VOID_EXCEPTIONSTATE(int, longArg, toInt32(info[1], exceptionState), exceptionState); 67 int longArg;
65 TOSTRING_VOID(V8StringResource<>, defaultUndefinedOptionalStringArg, info[2] ); 68 V8StringResource<> defaultUndefinedOptionalStringArg;
66 TOSTRING_VOID(V8StringResource<>, defaultNullStringOptionalStringArg, argume ntOrNull(info, 3)); 69 V8StringResource<> defaultNullStringOptionalStringArg;
67 TONATIVE_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionary( info[4], info.GetIsolate())); 70 Dictionary defaultUndefinedOptionalDictionaryArg;
68 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn definedOptionalDictionaryArg.isObject()) { 71 V8StringResource<> optionalStringArg;
69 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptionalDic tionaryArg') is not an object."); 72 {
70 exceptionState.throwIfNeeded(); 73 v8::TryCatch block;
71 return; 74 TONATIVE_VOID_NO_DECL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNat iveWithTypeCheck(info.GetIsolate(), info[0]));
75 TONATIVE_VOID_EXCEPTIONSTATE_NO_DECL(longArg, toInt32(info[1], exception State), exceptionState);
76 TOSTRING_VOID_NO_DECL(defaultUndefinedOptionalStringArg, info[2]);
77 TOSTRING_VOID_NO_DECL(defaultNullStringOptionalStringArg, argumentOrNull (info, 3));
78 TONATIVE_VOID_NO_DECL(defaultUndefinedOptionalDictionaryArg, Dictionary( info[4], info.GetIsolate()));
79 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defau ltUndefinedOptionalDictionaryArg.isObject()) {
80 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object.");
81 exceptionState.throwIfNeeded();
82 return;
83 }
84 if (UNLIKELY(info.Length() <= 5)) {
85 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
86 v8::Handle<v8::Object> wrapper = info.Holder();
87 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2 >(impl.release(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolat e, WrapperConfiguration::Independent);
88 v8SetReturnValue(info, wrapper);
89 return;
90 }
91 TOSTRING_VOID_NO_DECL(optionalStringArg, info[5]);
72 } 92 }
73 if (UNLIKELY(info.Length() <= 5)) {
74 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::crea te(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNul lStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
75 v8::Handle<v8::Object> wrapper = info.Holder();
76 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(im pl.release(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, W rapperConfiguration::Independent);
77 v8SetReturnValue(info, wrapper);
78 return;
79 }
80 TOSTRING_VOID(V8StringResource<>, optionalStringArg, info[5]);
81 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg); 93 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg);
82 94
83 v8::Handle<v8::Object> wrapper = info.Holder(); 95 v8::Handle<v8::Object> wrapper = info.Holder();
84 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent); 96 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent);
85 v8SetReturnValue(info, wrapper); 97 v8SetReturnValue(info, wrapper);
86 } 98 }
87 99
88 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 100 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
89 { 101 {
90 if (((info.Length() == 1))) { 102 if (((info.Length() == 1))) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 fromInternalPointer(object)->deref(); 208 fromInternalPointer(object)->deref();
197 } 209 }
198 210
199 template<> 211 template<>
200 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 212 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
201 { 213 {
202 return toV8(impl, creationContext, isolate); 214 return toV8(impl, creationContext, isolate);
203 } 215 }
204 216
205 } // namespace WebCore 217 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698