OLD | NEW |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 91 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
92 { | 92 { |
93 TestInterfaceGarbageCollectedV8Internal::funcMethod(info); | 93 TestInterfaceGarbageCollectedV8Internal::funcMethod(info); |
94 } | 94 } |
95 | 95 |
96 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 96 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
97 { | 97 { |
98 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 98 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
99 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 99 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
100 ScriptState* scriptState = ScriptState::forHolderObject(info); | 100 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
101 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | 101 Iterator* result = impl->keysForBinding(scriptState, exceptionState); |
102 if (exceptionState.hadException()) { | 102 if (exceptionState.hadException()) { |
103 exceptionState.throwIfNeeded(); | 103 exceptionState.throwIfNeeded(); |
104 return; | 104 return; |
105 } | 105 } |
106 v8SetReturnValue(info, result); | 106 v8SetReturnValue(info, result); |
107 } | 107 } |
108 | 108 |
109 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 109 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
110 { | 110 { |
111 TestInterfaceGarbageCollectedV8Internal::keysMethod(info); | 111 TestInterfaceGarbageCollectedV8Internal::keysMethod(info); |
112 } | 112 } |
113 | 113 |
114 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 114 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
115 { | 115 { |
116 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 116 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
117 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 117 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
118 ScriptState* scriptState = ScriptState::forHolderObject(info); | 118 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
119 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 119 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
120 if (exceptionState.hadException()) { | 120 if (exceptionState.hadException()) { |
121 exceptionState.throwIfNeeded(); | 121 exceptionState.throwIfNeeded(); |
122 return; | 122 return; |
123 } | 123 } |
124 v8SetReturnValue(info, result); | 124 v8SetReturnValue(info, result); |
125 } | 125 } |
126 | 126 |
127 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 127 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
128 { | 128 { |
129 TestInterfaceGarbageCollectedV8Internal::valuesMethod(info); | 129 TestInterfaceGarbageCollectedV8Internal::valuesMethod(info); |
130 } | 130 } |
131 | 131 |
132 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 132 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
133 { | 133 { |
134 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 134 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
135 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 135 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
136 ScriptState* scriptState = ScriptState::forHolderObject(info); | 136 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
137 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 137 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
138 if (exceptionState.hadException()) { | 138 if (exceptionState.hadException()) { |
139 exceptionState.throwIfNeeded(); | 139 exceptionState.throwIfNeeded(); |
140 return; | 140 return; |
141 } | 141 } |
142 v8SetReturnValue(info, result); | 142 v8SetReturnValue(info, result); |
143 } | 143 } |
144 | 144 |
145 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 145 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
146 { | 146 { |
(...skipping 13 matching lines...) Expand all Loading... |
160 ScriptValue thisArg; | 160 ScriptValue thisArg; |
161 { | 161 { |
162 if (!info[0]->IsFunction()) { | 162 if (!info[0]->IsFunction()) { |
163 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); | 163 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); |
164 exceptionState.throwIfNeeded(); | 164 exceptionState.throwIfNeeded(); |
165 return; | 165 return; |
166 } | 166 } |
167 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; | 167 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; |
168 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | 168 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
169 } | 169 } |
170 ScriptState* scriptState = ScriptState::forHolderObject(info); | 170 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
171 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); | 171 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); |
172 if (exceptionState.hadException()) { | 172 if (exceptionState.hadException()) { |
173 exceptionState.throwIfNeeded(); | 173 exceptionState.throwIfNeeded(); |
174 return; | 174 return; |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 178 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
179 { | 179 { |
180 TestInterfaceGarbageCollectedV8Internal::forEachMethod(info); | 180 TestInterfaceGarbageCollectedV8Internal::forEachMethod(info); |
181 } | 181 } |
182 | 182 |
183 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 183 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
184 { | 184 { |
185 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test
InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 185 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test
InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
186 if (UNLIKELY(info.Length() < 1)) { | 186 if (UNLIKELY(info.Length() < 1)) { |
187 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 187 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
188 exceptionState.throwIfNeeded(); | 188 exceptionState.throwIfNeeded(); |
189 return; | 189 return; |
190 } | 190 } |
191 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 191 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
192 V8StringResource<> value; | 192 V8StringResource<> value; |
193 { | 193 { |
194 value = info[0]; | 194 value = info[0]; |
195 if (!value.prepare()) | 195 if (!value.prepare()) |
196 return; | 196 return; |
197 } | 197 } |
198 ScriptState* scriptState = ScriptState::forHolderObject(info); | 198 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
199 bool result = impl->hasForBinding(scriptState, value, exceptionState); | 199 bool result = impl->hasForBinding(scriptState, value, exceptionState); |
200 if (exceptionState.hadException()) { | 200 if (exceptionState.hadException()) { |
201 exceptionState.throwIfNeeded(); | 201 exceptionState.throwIfNeeded(); |
202 return; | 202 return; |
203 } | 203 } |
204 v8SetReturnValueBool(info, result); | 204 v8SetReturnValueBool(info, result); |
205 } | 205 } |
206 | 206 |
207 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 207 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
208 { | 208 { |
209 TestInterfaceGarbageCollectedV8Internal::hasMethod(info); | 209 TestInterfaceGarbageCollectedV8Internal::hasMethod(info); |
210 } | 210 } |
211 | 211 |
212 static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 212 static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
213 { | 213 { |
214 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "Test
InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 214 ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "Test
InterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
215 if (UNLIKELY(info.Length() < 1)) { | 215 if (UNLIKELY(info.Length() < 1)) { |
216 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 216 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
217 exceptionState.throwIfNeeded(); | 217 exceptionState.throwIfNeeded(); |
218 return; | 218 return; |
219 } | 219 } |
220 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 220 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
221 V8StringResource<> value; | 221 V8StringResource<> value; |
222 { | 222 { |
223 value = info[0]; | 223 value = info[0]; |
224 if (!value.prepare()) | 224 if (!value.prepare()) |
225 return; | 225 return; |
226 } | 226 } |
227 ScriptState* scriptState = ScriptState::forHolderObject(info); | 227 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
228 TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, val
ue, exceptionState); | 228 TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, val
ue, exceptionState); |
229 if (exceptionState.hadException()) { | 229 if (exceptionState.hadException()) { |
230 exceptionState.throwIfNeeded(); | 230 exceptionState.throwIfNeeded(); |
231 return; | 231 return; |
232 } | 232 } |
233 v8SetReturnValue(info, result); | 233 v8SetReturnValue(info, result); |
234 } | 234 } |
235 | 235 |
236 static void addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 236 static void addMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
237 { | 237 { |
238 TestInterfaceGarbageCollectedV8Internal::addMethod(info); | 238 TestInterfaceGarbageCollectedV8Internal::addMethod(info); |
239 } | 239 } |
240 | 240 |
241 static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 241 static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
242 { | 242 { |
243 ExceptionState exceptionState(ExceptionState::ExecutionContext, "clear", "Te
stInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 243 ExceptionState exceptionState(ExceptionState::ExecutionContext, "clear", "Te
stInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
244 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 244 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
245 ScriptState* scriptState = ScriptState::forHolderObject(info); | 245 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
246 impl->clearForBinding(scriptState, exceptionState); | 246 impl->clearForBinding(scriptState, exceptionState); |
247 if (exceptionState.hadException()) { | 247 if (exceptionState.hadException()) { |
248 exceptionState.throwIfNeeded(); | 248 exceptionState.throwIfNeeded(); |
249 return; | 249 return; |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 static void clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 253 static void clearMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
254 { | 254 { |
255 TestInterfaceGarbageCollectedV8Internal::clearMethod(info); | 255 TestInterfaceGarbageCollectedV8Internal::clearMethod(info); |
256 } | 256 } |
257 | 257 |
258 static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 258 static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
259 { | 259 { |
260 ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "T
estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 260 ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "T
estInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
261 if (UNLIKELY(info.Length() < 1)) { | 261 if (UNLIKELY(info.Length() < 1)) { |
262 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 262 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
263 exceptionState.throwIfNeeded(); | 263 exceptionState.throwIfNeeded(); |
264 return; | 264 return; |
265 } | 265 } |
266 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 266 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
267 V8StringResource<> value; | 267 V8StringResource<> value; |
268 { | 268 { |
269 value = info[0]; | 269 value = info[0]; |
270 if (!value.prepare()) | 270 if (!value.prepare()) |
271 return; | 271 return; |
272 } | 272 } |
273 ScriptState* scriptState = ScriptState::forHolderObject(info); | 273 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
274 bool result = impl->deleteForBinding(scriptState, value, exceptionState); | 274 bool result = impl->deleteForBinding(scriptState, value, exceptionState); |
275 if (exceptionState.hadException()) { | 275 if (exceptionState.hadException()) { |
276 exceptionState.throwIfNeeded(); | 276 exceptionState.throwIfNeeded(); |
277 return; | 277 return; |
278 } | 278 } |
279 v8SetReturnValueBool(info, result); | 279 v8SetReturnValueBool(info, result); |
280 } | 280 } |
281 | 281 |
282 static void deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 282 static void deleteMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
283 { | 283 { |
284 TestInterfaceGarbageCollectedV8Internal::deleteMethod(info); | 284 TestInterfaceGarbageCollectedV8Internal::deleteMethod(info); |
285 } | 285 } |
286 | 286 |
287 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 287 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
288 { | 288 { |
289 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); | 289 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate()); |
290 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); | 290 TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImp
l(info.Holder()); |
291 ScriptState* scriptState = ScriptState::forHolderObject(info); | 291 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
292 Iterator* result = impl->iterator(scriptState, exceptionState); | 292 Iterator* result = impl->iterator(scriptState, exceptionState); |
293 if (exceptionState.hadException()) { | 293 if (exceptionState.hadException()) { |
294 exceptionState.throwIfNeeded(); | 294 exceptionState.throwIfNeeded(); |
295 return; | 295 return; |
296 } | 296 } |
297 v8SetReturnValue(info, result); | 297 v8SetReturnValue(info, result); |
298 } | 298 } |
299 | 299 |
300 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 300 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
301 { | 301 { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 { | 389 { |
390 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 390 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
391 } | 391 } |
392 | 392 |
393 TestInterfaceGarbageCollected* V8TestInterfaceGarbageCollected::toImplWithTypeCh
eck(v8::Isolate* isolate, v8::Local<v8::Value> value) | 393 TestInterfaceGarbageCollected* V8TestInterfaceGarbageCollected::toImplWithTypeCh
eck(v8::Isolate* isolate, v8::Local<v8::Value> value) |
394 { | 394 { |
395 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 395 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
396 } | 396 } |
397 | 397 |
398 } // namespace blink | 398 } // namespace blink |
OLD | NEW |