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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor.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 "V8TestInterfaceConstructor.h" 8 #include "V8TestInterfaceConstructor.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 v8::Handle<v8::Object> wrapper = info.Holder(); 59 v8::Handle<v8::Object> wrapper = info.Holder();
60 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, isolate, Wrapper Configuration::Independent); 60 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, isolate, Wrapper Configuration::Independent);
61 v8SetReturnValue(info, wrapper); 61 v8SetReturnValue(info, wrapper);
62 } 62 }
63 63
64 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 64 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
65 { 65 {
66 v8::Isolate* isolate = info.GetIsolate(); 66 v8::Isolate* isolate = info.GetIsolate();
67 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), isolate); 67 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), isolate);
68 TONATIVE_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue()) ); 68 double doubleArg;
69 TOSTRING_VOID(V8StringResource<>, stringArg, info[1]); 69 V8StringResource<> stringArg;
70 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[2])); 70 TestInterfaceEmpty* testInterfaceEmptyArg;
71 TONATIVE_VOID(Dictionary, dictionaryArg, Dictionary(info[3], info.GetIsolate ())); 71 Dictionary dictionaryArg;
72 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { 72 Vector<String> sequenceStringArg;
73 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an o bject."); 73 Vector<Dictionary> sequenceDictionaryArg;
74 exceptionState.throwIfNeeded(); 74 Dictionary optionalDictionaryArg;
75 return; 75 TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
76 {
77 v8::TryCatch block;
78 TONATIVE_VOID_NO_DECL(doubleArg, static_cast<double>(info[0]->NumberValu e()));
79 TOSTRING_VOID_NO_DECL(stringArg, info[1]);
80 TONATIVE_VOID_NO_DECL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNat iveWithTypeCheck(info.GetIsolate(), info[2]));
81 TONATIVE_VOID_NO_DECL(dictionaryArg, Dictionary(info[3], info.GetIsolate ()));
82 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
83 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object.");
84 exceptionState.throwIfNeeded();
85 return;
86 }
87 TONATIVE_VOID_NO_DECL(sequenceStringArg, toNativeArray<String>(info[4], 5, info.GetIsolate()));
88 TONATIVE_VOID_NO_DECL(sequenceDictionaryArg, toNativeArray<Dictionary>(i nfo[5], 6, info.GetIsolate()));
89 TONATIVE_VOID_NO_DECL(optionalDictionaryArg, Dictionary(info[6], info.Ge tIsolate()));
90 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg .isObject()) {
91 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object.");
92 exceptionState.throwIfNeeded();
93 return;
94 }
95 TONATIVE_VOID_NO_DECL(optionalTestInterfaceEmptyArg, V8TestInterfaceEmpt y::toNativeWithTypeCheck(info.GetIsolate(), info[7]));
76 } 96 }
77 TONATIVE_VOID(Vector<String>, sequenceStringArg, toNativeArray<String>(info[ 4], 5, info.GetIsolate()));
78 TONATIVE_VOID(Vector<Dictionary>, sequenceDictionaryArg, toNativeArray<Dicti onary>(info[5], 6, info.GetIsolate()));
79 TONATIVE_VOID(Dictionary, optionalDictionaryArg, Dictionary(info[6], info.Ge tIsolate()));
80 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isO bject()) {
81 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object.");
82 exceptionState.throwIfNeeded();
83 return;
84 }
85 TONATIVE_VOID(TestInterfaceEmpty*, optionalTestInterfaceEmptyArg, V8TestInte rfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[7]));
86 ExecutionContext* context = currentExecutionContext(isolate); 97 ExecutionContext* context = currentExecutionContext(isolate);
87 Document& document = *toDocument(currentExecutionContext(isolate)); 98 Document& document = *toDocument(currentExecutionContext(isolate));
88 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTestInterfa ceEmptyArg, exceptionState); 99 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTestInterfa ceEmptyArg, exceptionState);
89 if (exceptionState.throwIfNeeded()) 100 if (exceptionState.throwIfNeeded())
90 return; 101 return;
91 102
92 v8::Handle<v8::Object> wrapper = info.Holder(); 103 v8::Handle<v8::Object> wrapper = info.Holder();
93 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, isolate, Wrapper Configuration::Independent); 104 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.re lease(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, isolate, Wrapper Configuration::Independent);
94 v8SetReturnValue(info, wrapper); 105 v8SetReturnValue(info, wrapper);
95 } 106 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 fromInternalPointer(object)->deref(); 210 fromInternalPointer(object)->deref();
200 } 211 }
201 212
202 template<> 213 template<>
203 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 214 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
204 { 215 {
205 return toV8(impl, creationContext, isolate); 216 return toV8(impl, creationContext, isolate);
206 } 217 }
207 218
208 } // namespace WebCore 219 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698