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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.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 "V8TestInterfaceGarbageCollected.h" 7 #include "V8TestInterfaceGarbageCollected.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Functio nCallbackInfo<v8::Value>& info) 66 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Functio nCallbackInfo<v8::Value>& info)
67 { 67 {
68 v8::Local<v8::Object> holder = info.Holder(); 68 v8::Local<v8::Object> holder = info.Holder();
69 ExceptionState exceptionState(ExceptionState::SetterContext, "attr1", "TestI nterfaceGarbageCollected", holder, info.GetIsolate()); 69 ExceptionState exceptionState(ExceptionState::SetterContext, "attr1", "TestI nterfaceGarbageCollected", holder, info.GetIsolate());
70 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(holder); 70 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(holder);
71 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::t oImplWithTypeCheck(info.GetIsolate(), v8Value); 71 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::t oImplWithTypeCheck(info.GetIsolate(), v8Value);
72 if (!cppValue) { 72 if (!cppValue) {
73 exceptionState.throwTypeError("The provided value is not of type 'TestIn terfaceGarbageCollected'."); 73 exceptionState.throwTypeError("The provided value is not of type 'TestIn terfaceGarbageCollected'.");
74 exceptionState.throwIfNeeded();
75 return; 74 return;
76 } 75 }
77 impl->setAttr1(cppValue); 76 impl->setAttr1(cppValue);
78 } 77 }
79 78
80 static void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info) 79 static void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
81 { 80 {
82 v8::Local<v8::Value> v8Value = info[0]; 81 v8::Local<v8::Value> v8Value = info[0];
83 TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info) ; 82 TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info) ;
84 } 83 }
(...skipping 21 matching lines...) Expand all
106 TestInterfaceGarbageCollectedV8Internal::funcMethod(info); 105 TestInterfaceGarbageCollectedV8Internal::funcMethod(info);
107 } 106 }
108 107
109 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 108 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
110 { 109 {
111 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 110 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
112 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 111 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
113 ScriptState* scriptState = ScriptState::forReceiverObject(info); 112 ScriptState* scriptState = ScriptState::forReceiverObject(info);
114 Iterator* result = impl->keysForBinding(scriptState, exceptionState); 113 Iterator* result = impl->keysForBinding(scriptState, exceptionState);
115 if (exceptionState.hadException()) { 114 if (exceptionState.hadException()) {
116 exceptionState.throwIfNeeded();
117 return; 115 return;
118 } 116 }
119 v8SetReturnValue(info, result); 117 v8SetReturnValue(info, result);
120 } 118 }
121 119
122 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 120 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
123 { 121 {
124 TestInterfaceGarbageCollectedV8Internal::keysMethod(info); 122 TestInterfaceGarbageCollectedV8Internal::keysMethod(info);
125 } 123 }
126 124
127 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 125 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
128 { 126 {
129 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 127 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
130 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 128 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
131 ScriptState* scriptState = ScriptState::forReceiverObject(info); 129 ScriptState* scriptState = ScriptState::forReceiverObject(info);
132 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); 130 Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
133 if (exceptionState.hadException()) { 131 if (exceptionState.hadException()) {
134 exceptionState.throwIfNeeded();
135 return; 132 return;
136 } 133 }
137 v8SetReturnValue(info, result); 134 v8SetReturnValue(info, result);
138 } 135 }
139 136
140 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info ) 137 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info )
141 { 138 {
142 TestInterfaceGarbageCollectedV8Internal::valuesMethod(info); 139 TestInterfaceGarbageCollectedV8Internal::valuesMethod(info);
143 } 140 }
144 141
145 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 142 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
146 { 143 {
147 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", " TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 144 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", " TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
148 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 145 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
149 ScriptState* scriptState = ScriptState::forReceiverObject(info); 146 ScriptState* scriptState = ScriptState::forReceiverObject(info);
150 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); 147 Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
151 if (exceptionState.hadException()) { 148 if (exceptionState.hadException()) {
152 exceptionState.throwIfNeeded();
153 return; 149 return;
154 } 150 }
155 v8SetReturnValue(info, result); 151 v8SetReturnValue(info, result);
156 } 152 }
157 153
158 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 154 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
159 { 155 {
160 TestInterfaceGarbageCollectedV8Internal::entriesMethod(info); 156 TestInterfaceGarbageCollectedV8Internal::entriesMethod(info);
161 } 157 }
162 158
163 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 159 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
164 { 160 {
165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 161 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
166 if (UNLIKELY(info.Length() < 1)) { 162 if (UNLIKELY(info.Length() < 1)) {
167 setMinimumArityTypeError(exceptionState, 1, info.Length()); 163 setMinimumArityTypeError(exceptionState, 1, info.Length());
168 exceptionState.throwIfNeeded();
169 return; 164 return;
170 } 165 }
171 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 166 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
172 ScriptValue callback; 167 ScriptValue callback;
173 ScriptValue thisArg; 168 ScriptValue thisArg;
174 { 169 {
175 if (!info[0]->IsFunction()) { 170 if (!info[0]->IsFunction()) {
176 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 171 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
177 exceptionState.throwIfNeeded();
178 return; 172 return;
179 } 173 }
180 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]) ; 174 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]) ;
181 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); 175 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
182 } 176 }
183 ScriptState* scriptState = ScriptState::forReceiverObject(info); 177 ScriptState* scriptState = ScriptState::forReceiverObject(info);
184 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()) , callback, thisArg, exceptionState); 178 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()) , callback, thisArg, exceptionState);
185 if (exceptionState.hadException()) { 179 if (exceptionState.hadException()) {
186 exceptionState.throwIfNeeded();
187 return; 180 return;
188 } 181 }
189 } 182 }
190 183
191 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 184 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
192 { 185 {
193 TestInterfaceGarbageCollectedV8Internal::forEachMethod(info); 186 TestInterfaceGarbageCollectedV8Internal::forEachMethod(info);
194 } 187 }
195 188
196 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 189 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
197 { 190 {
198 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 191 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test InterfaceGarbageCollected", info.Holder(), info.GetIsolate());
199 if (UNLIKELY(info.Length() < 1)) { 192 if (UNLIKELY(info.Length() < 1)) {
200 setMinimumArityTypeError(exceptionState, 1, info.Length()); 193 setMinimumArityTypeError(exceptionState, 1, info.Length());
201 exceptionState.throwIfNeeded();
202 return; 194 return;
203 } 195 }
204 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 196 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
205 V8StringResource<> value; 197 V8StringResource<> value;
206 { 198 {
207 value = info[0]; 199 value = info[0];
208 if (!value.prepare()) 200 if (!value.prepare())
209 return; 201 return;
210 } 202 }
211 ScriptState* scriptState = ScriptState::forReceiverObject(info); 203 ScriptState* scriptState = ScriptState::forReceiverObject(info);
212 bool result = impl->hasForBinding(scriptState, value, exceptionState); 204 bool result = impl->hasForBinding(scriptState, value, exceptionState);
213 if (exceptionState.hadException()) { 205 if (exceptionState.hadException()) {
214 exceptionState.throwIfNeeded();
215 return; 206 return;
216 } 207 }
217 v8SetReturnValueBool(info, result); 208 v8SetReturnValueBool(info, result);
218 } 209 }
219 210
220 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 211 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
221 { 212 {
222 TestInterfaceGarbageCollectedV8Internal::hasMethod(info); 213 TestInterfaceGarbageCollectedV8Internal::hasMethod(info);
223 } 214 }
224 215
225 static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 216 static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
226 { 217 {
227 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "Test InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 218 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "Test InterfaceGarbageCollected", info.Holder(), info.GetIsolate());
228 if (UNLIKELY(info.Length() < 1)) { 219 if (UNLIKELY(info.Length() < 1)) {
229 setMinimumArityTypeError(exceptionState, 1, info.Length()); 220 setMinimumArityTypeError(exceptionState, 1, info.Length());
230 exceptionState.throwIfNeeded();
231 return; 221 return;
232 } 222 }
233 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 223 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
234 V8StringResource<> value; 224 V8StringResource<> value;
235 { 225 {
236 value = info[0]; 226 value = info[0];
237 if (!value.prepare()) 227 if (!value.prepare())
238 return; 228 return;
239 } 229 }
240 ScriptState* scriptState = ScriptState::forReceiverObject(info); 230 ScriptState* scriptState = ScriptState::forReceiverObject(info);
241 TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, val ue, exceptionState); 231 TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, val ue, exceptionState);
242 if (exceptionState.hadException()) { 232 if (exceptionState.hadException()) {
243 exceptionState.throwIfNeeded();
244 return; 233 return;
245 } 234 }
246 v8SetReturnValue(info, result); 235 v8SetReturnValue(info, result);
247 } 236 }
248 237
249 static void addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 238 static void addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
250 { 239 {
251 TestInterfaceGarbageCollectedV8Internal::addMethod(info); 240 TestInterfaceGarbageCollectedV8Internal::addMethod(info);
252 } 241 }
253 242
254 static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 243 static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
255 { 244 {
256 ExceptionState exceptionState(ExceptionState::ExecutionContext, "clear", "Te stInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 245 ExceptionState exceptionState(ExceptionState::ExecutionContext, "clear", "Te stInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
257 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 246 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
258 ScriptState* scriptState = ScriptState::forReceiverObject(info); 247 ScriptState* scriptState = ScriptState::forReceiverObject(info);
259 impl->clearForBinding(scriptState, exceptionState); 248 impl->clearForBinding(scriptState, exceptionState);
260 if (exceptionState.hadException()) { 249 if (exceptionState.hadException()) {
261 exceptionState.throwIfNeeded();
262 return; 250 return;
263 } 251 }
264 } 252 }
265 253
266 static void clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 254 static void clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
267 { 255 {
268 TestInterfaceGarbageCollectedV8Internal::clearMethod(info); 256 TestInterfaceGarbageCollectedV8Internal::clearMethod(info);
269 } 257 }
270 258
271 static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 259 static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
272 { 260 {
273 ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "T estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 261 ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "T estInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
274 if (UNLIKELY(info.Length() < 1)) { 262 if (UNLIKELY(info.Length() < 1)) {
275 setMinimumArityTypeError(exceptionState, 1, info.Length()); 263 setMinimumArityTypeError(exceptionState, 1, info.Length());
276 exceptionState.throwIfNeeded();
277 return; 264 return;
278 } 265 }
279 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 266 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
280 V8StringResource<> value; 267 V8StringResource<> value;
281 { 268 {
282 value = info[0]; 269 value = info[0];
283 if (!value.prepare()) 270 if (!value.prepare())
284 return; 271 return;
285 } 272 }
286 ScriptState* scriptState = ScriptState::forReceiverObject(info); 273 ScriptState* scriptState = ScriptState::forReceiverObject(info);
287 bool result = impl->deleteForBinding(scriptState, value, exceptionState); 274 bool result = impl->deleteForBinding(scriptState, value, exceptionState);
288 if (exceptionState.hadException()) { 275 if (exceptionState.hadException()) {
289 exceptionState.throwIfNeeded();
290 return; 276 return;
291 } 277 }
292 v8SetReturnValueBool(info, result); 278 v8SetReturnValueBool(info, result);
293 } 279 }
294 280
295 static void deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info ) 281 static void deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info )
296 { 282 {
297 TestInterfaceGarbageCollectedV8Internal::deleteMethod(info); 283 TestInterfaceGarbageCollectedV8Internal::deleteMethod(info);
298 } 284 }
299 285
300 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 286 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
301 { 287 {
302 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); 288 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
303 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder()); 289 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp l(info.Holder());
304 ScriptState* scriptState = ScriptState::forReceiverObject(info); 290 ScriptState* scriptState = ScriptState::forReceiverObject(info);
305 Iterator* result = impl->iterator(scriptState, exceptionState); 291 Iterator* result = impl->iterator(scriptState, exceptionState);
306 if (exceptionState.hadException()) { 292 if (exceptionState.hadException()) {
307 exceptionState.throwIfNeeded();
308 return; 293 return;
309 } 294 }
310 v8SetReturnValue(info, result); 295 v8SetReturnValue(info, result);
311 } 296 }
312 297
313 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 298 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
314 { 299 {
315 TestInterfaceGarbageCollectedV8Internal::iteratorMethod(info); 300 TestInterfaceGarbageCollectedV8Internal::iteratorMethod(info);
316 } 301 }
317 302
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 { 386 {
402 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 387 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
403 } 388 }
404 389
405 TestInterfaceGarbageCollected* V8TestInterfaceGarbageCollected::toImplWithTypeCh eck(v8::Isolate* isolate, v8::Local<v8::Value> value) 390 TestInterfaceGarbageCollected* V8TestInterfaceGarbageCollected::toImplWithTypeCh eck(v8::Isolate* isolate, v8::Local<v8::Value> value)
406 { 391 {
407 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : nullptr; 392 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : nullptr;
408 } 393 }
409 394
410 } // namespace blink 395 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698