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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor2.cpp

Issue 304223007: Use auto-rethrowing v8::TryCatch variant (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make constructors explicit Created 6 years, 6 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 V8StringResource<> stringArg; 51 V8StringResource<> stringArg;
52 { 52 {
53 TOSTRING_VOID_INTERNAL_NOTRYCATCH(stringArg, info[0]); 53 TOSTRING_VOID_INTERNAL(stringArg, info[0]);
54 } 54 }
55 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg); 55 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg);
56 56
57 v8::Handle<v8::Object> wrapper = info.Holder(); 57 v8::Handle<v8::Object> wrapper = info.Holder();
58 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);
59 v8SetReturnValue(info, wrapper); 59 v8SetReturnValue(info, wrapper);
60 } 60 }
61 61
62 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 62 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
63 { 63 {
64 v8::Isolate* isolate = info.GetIsolate(); 64 v8::Isolate* isolate = info.GetIsolate();
65 Dictionary dictionaryArg; 65 Dictionary dictionaryArg;
66 { 66 {
67 v8::TryCatch block; 67 v8::TryCatch block;
68 V8RethrowTryCatchScope rethrow(block);
68 TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolat e())); 69 TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolat e()));
69 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { 70 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
70 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceCo nstructor2", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate ()); 71 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceCo nstructor2", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate ());
71 block.ReThrow();
72 return; 72 return;
73 } 73 }
74 } 74 }
75 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg); 75 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg);
76 76
77 v8::Handle<v8::Object> wrapper = info.Holder(); 77 v8::Handle<v8::Object> wrapper = info.Holder();
78 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent); 78 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent);
79 v8SetReturnValue(info, wrapper); 79 v8SetReturnValue(info, wrapper);
80 } 80 }
81 81
82 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 82 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
83 { 83 {
84 v8::Isolate* isolate = info.GetIsolate(); 84 v8::Isolate* isolate = info.GetIsolate();
85 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), isolate); 85 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), isolate);
86 TestInterfaceEmpty* testInterfaceEmptyArg; 86 TestInterfaceEmpty* testInterfaceEmptyArg;
87 int longArg; 87 int longArg;
88 V8StringResource<> defaultUndefinedOptionalStringArg; 88 V8StringResource<> defaultUndefinedOptionalStringArg;
89 V8StringResource<> defaultNullStringOptionalStringArg; 89 V8StringResource<> defaultNullStringOptionalStringArg;
90 Dictionary defaultUndefinedOptionalDictionaryArg; 90 Dictionary defaultUndefinedOptionalDictionaryArg;
91 V8StringResource<> optionalStringArg; 91 V8StringResource<> optionalStringArg;
92 { 92 {
93 v8::TryCatch block; 93 v8::TryCatch block;
94 V8RethrowTryCatchScope rethrow(block);
94 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNa tiveWithTypeCheck(info.GetIsolate(), info[0])); 95 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNa tiveWithTypeCheck(info.GetIsolate(), info[0]));
95 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptio nState), exceptionState); 96 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptio nState), exceptionState);
96 TOSTRING_VOID_INTERNAL(defaultUndefinedOptionalStringArg, info[2]); 97 TOSTRING_VOID_INTERNAL(defaultUndefinedOptionalStringArg, info[2]);
97 TOSTRING_VOID_INTERNAL(defaultNullStringOptionalStringArg, argumentOrNul l(info, 3)); 98 TOSTRING_VOID_INTERNAL(defaultNullStringOptionalStringArg, argumentOrNul l(info, 3));
98 TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictionary (info[4], info.GetIsolate())); 99 TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictionary (info[4], info.GetIsolate()));
99 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defau ltUndefinedOptionalDictionaryArg.isObject()) { 100 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defau ltUndefinedOptionalDictionaryArg.isObject()) {
100 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object."); 101 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object.");
101 exceptionState.throwIfNeeded(); 102 exceptionState.throwIfNeeded();
102 block.ReThrow();
103 return; 103 return;
104 } 104 }
105 if (UNLIKELY(info.Length() <= 5)) { 105 if (UNLIKELY(info.Length() <= 5)) {
106 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg); 106 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
107 v8::Handle<v8::Object> wrapper = info.Holder(); 107 v8::Handle<v8::Object> wrapper = info.Holder();
108 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2 >(impl.release(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolat e, WrapperConfiguration::Independent); 108 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2 >(impl.release(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolat e, WrapperConfiguration::Independent);
109 v8SetReturnValue(info, wrapper); 109 v8SetReturnValue(info, wrapper);
110 return; 110 return;
111 } 111 }
112 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]); 112 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 fromInternalPointer(object)->deref(); 263 fromInternalPointer(object)->deref();
264 } 264 }
265 265
266 template<> 266 template<>
267 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 267 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
268 { 268 {
269 return toV8(impl, creationContext, isolate); 269 return toV8(impl, creationContext, isolate);
270 } 270 }
271 271
272 } // namespace WebCore 272 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698