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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp

Issue 2272613003: binding: Retires ExceptionState::throwIfNeeded(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 4 years, 3 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 "V8TestTypedefs.h" 7 #include "V8TestTypedefs.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/StringOrDouble.h" 10 #include "bindings/core/v8/StringOrDouble.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 { 63 {
64 TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info); 64 TestTypedefsV8Internal::uLongLongAttributeAttributeGetter(info);
65 } 65 }
66 66
67 static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons t v8::FunctionCallbackInfo<v8::Value>& info) 67 static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons t v8::FunctionCallbackInfo<v8::Value>& info)
68 { 68 {
69 v8::Local<v8::Object> holder = info.Holder(); 69 v8::Local<v8::Object> holder = info.Holder();
70 ExceptionState exceptionState(ExceptionState::SetterContext, "uLongLongAttri bute", "TestTypedefs", holder, info.GetIsolate()); 70 ExceptionState exceptionState(ExceptionState::SetterContext, "uLongLongAttri bute", "TestTypedefs", holder, info.GetIsolate());
71 TestTypedefs* impl = V8TestTypedefs::toImpl(holder); 71 TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
72 unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalCon version, exceptionState); 72 unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalCon version, exceptionState);
73 if (exceptionState.throwIfNeeded()) 73 if (exceptionState.hadException())
74 return; 74 return;
75 impl->setULongLongAttribute(cppValue); 75 impl->setULongLongAttribute(cppValue);
76 } 76 }
77 77
78 static void uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallback Info<v8::Value>& info) 78 static void uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallback Info<v8::Value>& info)
79 { 79 {
80 v8::Local<v8::Value> v8Value = info[0]; 80 v8::Local<v8::Value> v8Value = info[0];
81 TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info); 81 TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info);
82 } 82 }
83 83
(...skipping 11 matching lines...) Expand all
95 TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeGetter(info ); 95 TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeGetter(info );
96 } 96 }
97 97
98 static void domStringOrDoubleOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 98 static void domStringOrDoubleOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
99 { 99 {
100 v8::Local<v8::Object> holder = info.Holder(); 100 v8::Local<v8::Object> holder = info.Holder();
101 ExceptionState exceptionState(ExceptionState::SetterContext, "domStringOrDou bleOrNullAttribute", "TestTypedefs", holder, info.GetIsolate()); 101 ExceptionState exceptionState(ExceptionState::SetterContext, "domStringOrDou bleOrNullAttribute", "TestTypedefs", holder, info.GetIsolate());
102 TestTypedefs* impl = V8TestTypedefs::toImpl(holder); 102 TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
103 StringOrDouble cppValue; 103 StringOrDouble cppValue;
104 V8StringOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConv ersionMode::Nullable, exceptionState); 104 V8StringOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConv ersionMode::Nullable, exceptionState);
105 if (exceptionState.throwIfNeeded()) 105 if (exceptionState.hadException())
106 return; 106 return;
107 impl->setDomStringOrDoubleOrNullAttribute(cppValue); 107 impl->setDomStringOrDoubleOrNullAttribute(cppValue);
108 } 108 }
109 109
110 static void domStringOrDoubleOrNullAttributeAttributeSetterCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info) 110 static void domStringOrDoubleOrNullAttributeAttributeSetterCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info)
111 { 111 {
112 v8::Local<v8::Value> v8Value = info[0]; 112 v8::Local<v8::Value> v8Value = info[0];
113 TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeSetter(v8Va lue, info); 113 TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeSetter(v8Va lue, info);
114 } 114 }
115 115
116 static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) 116 static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::V alue>& info)
117 { 117 {
118 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodA rrayOfLongsArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 118 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodA rrayOfLongsArg", "TestTypedefs", info.Holder(), info.GetIsolate());
119 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 119 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
120 Vector<int> arrayOfLongsArg; 120 Vector<int> arrayOfLongsArg;
121 { 121 {
122 int numArgsPassed = info.Length(); 122 int numArgsPassed = info.Length();
123 while (numArgsPassed > 0) { 123 while (numArgsPassed > 0) {
124 if (!info[numArgsPassed - 1]->IsUndefined()) 124 if (!info[numArgsPassed - 1]->IsUndefined())
125 break; 125 break;
126 --numArgsPassed; 126 --numArgsPassed;
127 } 127 }
128 if (UNLIKELY(numArgsPassed <= 0)) { 128 if (UNLIKELY(numArgsPassed <= 0)) {
129 impl->voidMethodArrayOfLongsArg(); 129 impl->voidMethodArrayOfLongsArg();
130 return; 130 return;
131 } 131 }
132 arrayOfLongsArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate() , exceptionState); 132 arrayOfLongsArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate() , exceptionState);
133 if (exceptionState.throwIfNeeded()) 133 if (exceptionState.hadException())
134 return; 134 return;
135 } 135 }
136 impl->voidMethodArrayOfLongsArg(arrayOfLongsArg); 136 impl->voidMethodArrayOfLongsArg(arrayOfLongsArg);
137 } 137 }
138 138
139 static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info) 139 static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info)
140 { 140 {
141 TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info); 141 TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info);
142 } 142 }
143 143
144 static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 144 static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
145 { 145 {
146 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodF loatArgStringArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 146 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodF loatArgStringArg", "TestTypedefs", info.Holder(), info.GetIsolate());
147 if (UNLIKELY(info.Length() < 2)) { 147 if (UNLIKELY(info.Length() < 2)) {
148 setMinimumArityTypeError(exceptionState, 2, info.Length()); 148 setMinimumArityTypeError(exceptionState, 2, info.Length());
149 exceptionState.throwIfNeeded();
150 return; 149 return;
151 } 150 }
152 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 151 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
153 float floatArg; 152 float floatArg;
154 V8StringResource<> stringArg; 153 V8StringResource<> stringArg;
155 { 154 {
156 floatArg = toRestrictedFloat(info.GetIsolate(), info[0], exceptionState) ; 155 floatArg = toRestrictedFloat(info.GetIsolate(), info[0], exceptionState) ;
157 if (exceptionState.throwIfNeeded()) 156 if (exceptionState.hadException())
158 return; 157 return;
159 stringArg = info[1]; 158 stringArg = info[1];
160 if (!stringArg.prepare()) 159 if (!stringArg.prepare())
161 return; 160 return;
162 } 161 }
163 impl->voidMethodFloatArgStringArg(floatArg, stringArg); 162 impl->voidMethodFloatArgStringArg(floatArg, stringArg);
164 } 163 }
165 164
166 static void voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 165 static void voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
167 { 166 {
(...skipping 21 matching lines...) Expand all
189 static void voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) 188 static void voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info)
190 { 189 {
191 TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info); 190 TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info);
192 } 191 }
193 192
194 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(const v8::Fun ctionCallbackInfo<v8::Value>& info) 193 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(const v8::Fun ctionCallbackInfo<v8::Value>& info)
195 { 194 {
196 ExceptionState exceptionState(ExceptionState::ExecutionContext, "uLongLongMe thodTestInterfaceEmptyTypeSequenceArg", "TestTypedefs", info.Holder(), info.GetI solate()); 195 ExceptionState exceptionState(ExceptionState::ExecutionContext, "uLongLongMe thodTestInterfaceEmptyTypeSequenceArg", "TestTypedefs", info.Holder(), info.GetI solate());
197 if (UNLIKELY(info.Length() < 1)) { 196 if (UNLIKELY(info.Length() < 1)) {
198 setMinimumArityTypeError(exceptionState, 1, info.Length()); 197 setMinimumArityTypeError(exceptionState, 1, info.Length());
199 exceptionState.throwIfNeeded();
200 return; 198 return;
201 } 199 }
202 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 200 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
203 HeapVector<Member<TestInterfaceEmpty>> testInterfaceEmptyTypeSequenceArg; 201 HeapVector<Member<TestInterfaceEmpty>> testInterfaceEmptyTypeSequenceArg;
204 { 202 {
205 testInterfaceEmptyTypeSequenceArg = (toMemberNativeArray<TestInterfaceEm pty>(info[0], 1, info.GetIsolate(), exceptionState)); 203 testInterfaceEmptyTypeSequenceArg = (toMemberNativeArray<TestInterfaceEm pty>(info[0], 1, info.GetIsolate(), exceptionState));
206 if (exceptionState.throwIfNeeded()) 204 if (exceptionState.hadException())
207 return; 205 return;
208 } 206 }
209 v8SetReturnValue(info, static_cast<double>(impl->uLongLongMethodTestInterfac eEmptyTypeSequenceArg(testInterfaceEmptyTypeSequenceArg))); 207 v8SetReturnValue(info, static_cast<double>(impl->uLongLongMethodTestInterfac eEmptyTypeSequenceArg(testInterfaceEmptyTypeSequenceArg)));
210 } 208 }
211 209
212 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 210 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
213 { 211 {
214 TestTypedefsV8Internal::uLongLongMethodTestInterfaceEmptyTypeSequenceArgMeth od(info); 212 TestTypedefsV8Internal::uLongLongMethodTestInterfaceEmptyTypeSequenceArgMeth od(info);
215 } 213 }
216 214
(...skipping 21 matching lines...) Expand all
238 static void domStringOrDoubleMethodMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& info) 236 static void domStringOrDoubleMethodMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& info)
239 { 237 {
240 TestTypedefsV8Internal::domStringOrDoubleMethodMethod(info); 238 TestTypedefsV8Internal::domStringOrDoubleMethodMethod(info);
241 } 239 }
242 240
243 static void arrayOfStringsMethodArrayOfStringsArgMethod(const v8::FunctionCallba ckInfo<v8::Value>& info) 241 static void arrayOfStringsMethodArrayOfStringsArgMethod(const v8::FunctionCallba ckInfo<v8::Value>& info)
244 { 242 {
245 ExceptionState exceptionState(ExceptionState::ExecutionContext, "arrayOfStri ngsMethodArrayOfStringsArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 243 ExceptionState exceptionState(ExceptionState::ExecutionContext, "arrayOfStri ngsMethodArrayOfStringsArg", "TestTypedefs", info.Holder(), info.GetIsolate());
246 if (UNLIKELY(info.Length() < 1)) { 244 if (UNLIKELY(info.Length() < 1)) {
247 setMinimumArityTypeError(exceptionState, 1, info.Length()); 245 setMinimumArityTypeError(exceptionState, 1, info.Length());
248 exceptionState.throwIfNeeded();
249 return; 246 return;
250 } 247 }
251 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 248 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
252 Vector<String> arrayOfStringsArg; 249 Vector<String> arrayOfStringsArg;
253 { 250 {
254 arrayOfStringsArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsol ate(), exceptionState); 251 arrayOfStringsArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsol ate(), exceptionState);
255 if (exceptionState.throwIfNeeded()) 252 if (exceptionState.hadException())
256 return; 253 return;
257 } 254 }
258 v8SetReturnValue(info, toV8(impl->arrayOfStringsMethodArrayOfStringsArg(arra yOfStringsArg), info.Holder(), info.GetIsolate())); 255 v8SetReturnValue(info, toV8(impl->arrayOfStringsMethodArrayOfStringsArg(arra yOfStringsArg), info.Holder(), info.GetIsolate()));
259 } 256 }
260 257
261 static void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info) 258 static void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info)
262 { 259 {
263 TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info); 260 TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info);
264 } 261 }
265 262
266 static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 263 static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
267 { 264 {
268 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray MethodStringArrayArg", "TestTypedefs", info.Holder(), info.GetIsolate()); 265 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray MethodStringArrayArg", "TestTypedefs", info.Holder(), info.GetIsolate());
269 if (UNLIKELY(info.Length() < 1)) { 266 if (UNLIKELY(info.Length() < 1)) {
270 setMinimumArityTypeError(exceptionState, 1, info.Length()); 267 setMinimumArityTypeError(exceptionState, 1, info.Length());
271 exceptionState.throwIfNeeded();
272 return; 268 return;
273 } 269 }
274 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder()); 270 TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
275 Vector<String> stringArrayArg; 271 Vector<String> stringArrayArg;
276 { 272 {
277 stringArrayArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate (), exceptionState); 273 stringArrayArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate (), exceptionState);
278 if (exceptionState.throwIfNeeded()) 274 if (exceptionState.hadException())
279 return; 275 return;
280 } 276 }
281 v8SetReturnValue(info, toV8(impl->stringArrayMethodStringArrayArg(stringArra yArg), info.Holder(), info.GetIsolate())); 277 v8SetReturnValue(info, toV8(impl->stringArrayMethodStringArrayArg(stringArra yArg), info.Holder(), info.GetIsolate()));
282 } 278 }
283 279
284 static void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 280 static void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
285 { 281 {
286 TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info); 282 TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info);
287 } 283 }
288 284
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 { 378 {
383 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 379 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
384 } 380 }
385 381
386 TestTypedefs* V8TestTypedefs::toImplWithTypeCheck(v8::Isolate* isolate, v8::Loca l<v8::Value> value) 382 TestTypedefs* V8TestTypedefs::toImplWithTypeCheck(v8::Isolate* isolate, v8::Loca l<v8::Value> value)
387 { 383 {
388 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : nullptr; 384 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : nullptr;
389 } 385 }
390 386
391 } // namespace blink 387 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698