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 "V8TestInterface2.h" | 7 #include "V8TestInterface2.h" |
8 | 8 |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "bindings/core/v8/GeneratedCodeHelper.h" | 10 #include "bindings/core/v8/GeneratedCodeHelper.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 !std::is_same<decltype(&TestInterface2::hasPendingActivity), | 50 !std::is_same<decltype(&TestInterface2::hasPendingActivity), |
51 decltype(&ScriptWrappable::hasPendingActivity)>::value, | 51 decltype(&ScriptWrappable::hasPendingActivity)>::value, |
52 "TestInterface2 is not overriding hasPendingActivity(), but is specifying " | 52 "TestInterface2 is not overriding hasPendingActivity(), but is specifying " |
53 "[ActiveScriptWrappable] extended attribute in the IDL file. " | 53 "[ActiveScriptWrappable] extended attribute in the IDL file. " |
54 "Be consistent."); | 54 "Be consistent."); |
55 | 55 |
56 namespace TestInterface2V8Internal { | 56 namespace TestInterface2V8Internal { |
57 | 57 |
58 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 58 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
59 { | 59 { |
60 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes
tInterface2", info.Holder(), info.GetIsolate()); | 60 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "item"); |
| 61 |
| 62 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 63 |
61 if (UNLIKELY(info.Length() < 1)) { | 64 if (UNLIKELY(info.Length() < 1)) { |
62 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 65 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
63 return; | 66 return; |
64 } | 67 } |
65 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 68 |
66 unsigned index; | 69 unsigned index; |
67 { | 70 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionStat
e); |
68 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); | 71 if (exceptionState.hadException()) |
69 if (exceptionState.hadException()) | 72 return; |
70 return; | 73 |
71 } | |
72 TestInterfaceEmpty* result = impl->item(index, exceptionState); | 74 TestInterfaceEmpty* result = impl->item(index, exceptionState); |
73 if (exceptionState.hadException()) { | 75 if (exceptionState.hadException()) { |
74 return; | 76 return; |
75 } | 77 } |
76 v8SetReturnValue(info, result); | 78 v8SetReturnValue(info, result); |
77 } | 79 } |
78 | 80 |
79 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 81 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
80 { | 82 { |
81 TestInterface2V8Internal::itemMethod(info); | 83 TestInterface2V8Internal::itemMethod(info); |
82 } | 84 } |
83 | 85 |
84 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 86 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
85 { | 87 { |
86 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "
TestInterface2", info.Holder(), info.GetIsolate()); | 88 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "setItem"); |
| 89 |
| 90 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 91 |
87 if (UNLIKELY(info.Length() < 2)) { | 92 if (UNLIKELY(info.Length() < 2)) { |
88 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 93 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
89 return; | 94 return; |
90 } | 95 } |
91 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 96 |
92 unsigned index; | 97 unsigned index; |
93 TestInterfaceEmpty* value; | 98 TestInterfaceEmpty* value; |
94 { | 99 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionStat
e); |
95 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); | 100 if (exceptionState.hadException()) |
96 if (exceptionState.hadException()) | 101 return; |
97 return; | 102 |
98 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[1]); | 103 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]
); |
99 if (!value) { | 104 if (!value) { |
100 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); | 105 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterface
Empty'."); |
101 return; | 106 |
102 } | 107 return; |
103 } | 108 } |
| 109 |
104 TestInterfaceEmpty* result = impl->setItem(index, value, exceptionState); | 110 TestInterfaceEmpty* result = impl->setItem(index, value, exceptionState); |
105 if (exceptionState.hadException()) { | 111 if (exceptionState.hadException()) { |
106 return; | 112 return; |
107 } | 113 } |
108 v8SetReturnValue(info, result); | 114 v8SetReturnValue(info, result); |
109 } | 115 } |
110 | 116 |
111 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 117 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
112 { | 118 { |
113 TestInterface2V8Internal::setItemMethod(info); | 119 TestInterface2V8Internal::setItemMethod(info); |
114 } | 120 } |
115 | 121 |
116 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 122 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
117 { | 123 { |
118 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem"
, "TestInterface2", info.Holder(), info.GetIsolate()); | 124 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "deleteItem"); |
| 125 |
| 126 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 127 |
119 if (UNLIKELY(info.Length() < 1)) { | 128 if (UNLIKELY(info.Length() < 1)) { |
120 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 129 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
121 return; | 130 return; |
122 } | 131 } |
123 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 132 |
124 unsigned index; | 133 unsigned index; |
125 { | 134 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionStat
e); |
126 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception
State); | 135 if (exceptionState.hadException()) |
127 if (exceptionState.hadException()) | 136 return; |
128 return; | 137 |
129 } | |
130 bool result = impl->deleteItem(index, exceptionState); | 138 bool result = impl->deleteItem(index, exceptionState); |
131 if (exceptionState.hadException()) { | 139 if (exceptionState.hadException()) { |
132 return; | 140 return; |
133 } | 141 } |
134 v8SetReturnValueBool(info, result); | 142 v8SetReturnValueBool(info, result); |
135 } | 143 } |
136 | 144 |
137 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 145 static void deleteItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
138 { | 146 { |
139 TestInterface2V8Internal::deleteItemMethod(info); | 147 TestInterface2V8Internal::deleteItemMethod(info); |
140 } | 148 } |
141 | 149 |
142 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 150 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
143 { | 151 { |
144 ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem",
"TestInterface2", info.Holder(), info.GetIsolate()); | 152 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "namedItem"); |
| 153 |
| 154 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 155 |
145 if (UNLIKELY(info.Length() < 1)) { | 156 if (UNLIKELY(info.Length() < 1)) { |
146 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 157 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
147 return; | 158 return; |
148 } | 159 } |
149 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 160 |
150 V8StringResource<> name; | 161 V8StringResource<> name; |
151 { | 162 name = info[0]; |
152 name = info[0]; | 163 if (!name.prepare()) |
153 if (!name.prepare()) | 164 return; |
154 return; | 165 |
155 } | |
156 TestInterfaceEmpty* result = impl->namedItem(name, exceptionState); | 166 TestInterfaceEmpty* result = impl->namedItem(name, exceptionState); |
157 if (exceptionState.hadException()) { | 167 if (exceptionState.hadException()) { |
158 return; | 168 return; |
159 } | 169 } |
160 v8SetReturnValue(info, result); | 170 v8SetReturnValue(info, result); |
161 } | 171 } |
162 | 172 |
163 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 173 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
164 { | 174 { |
165 TestInterface2V8Internal::namedItemMethod(info); | 175 TestInterface2V8Internal::namedItemMethod(info); |
166 } | 176 } |
167 | 177 |
168 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 178 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
169 { | 179 { |
170 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte
m", "TestInterface2", info.Holder(), info.GetIsolate()); | 180 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "setNamedItem"); |
| 181 |
| 182 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 183 |
171 if (UNLIKELY(info.Length() < 2)) { | 184 if (UNLIKELY(info.Length() < 2)) { |
172 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 185 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
173 return; | 186 return; |
174 } | 187 } |
175 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 188 |
176 V8StringResource<> name; | 189 V8StringResource<> name; |
177 TestInterfaceEmpty* value; | 190 TestInterfaceEmpty* value; |
178 { | 191 name = info[0]; |
179 name = info[0]; | 192 if (!name.prepare()) |
180 if (!name.prepare()) | 193 return; |
181 return; | 194 |
182 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[1]); | 195 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]
); |
183 if (!value && !isUndefinedOrNull(info[1])) { | 196 if (!value && !isUndefinedOrNull(info[1])) { |
184 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); | 197 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterface
Empty'."); |
185 return; | 198 |
186 } | 199 return; |
187 } | 200 } |
| 201 |
188 TestInterfaceEmpty* result = impl->setNamedItem(name, value, exceptionState)
; | 202 TestInterfaceEmpty* result = impl->setNamedItem(name, value, exceptionState)
; |
189 if (exceptionState.hadException()) { | 203 if (exceptionState.hadException()) { |
190 return; | 204 return; |
191 } | 205 } |
192 v8SetReturnValue(info, result); | 206 v8SetReturnValue(info, result); |
193 } | 207 } |
194 | 208 |
195 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 209 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
196 { | 210 { |
197 TestInterface2V8Internal::setNamedItemMethod(info); | 211 TestInterface2V8Internal::setNamedItemMethod(info); |
198 } | 212 } |
199 | 213 |
200 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 214 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
201 { | 215 { |
202 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed
Item", "TestInterface2", info.Holder(), info.GetIsolate()); | 216 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "deleteNamedItem"); |
| 217 |
| 218 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 219 |
203 if (UNLIKELY(info.Length() < 1)) { | 220 if (UNLIKELY(info.Length() < 1)) { |
204 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 221 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
205 return; | 222 return; |
206 } | 223 } |
207 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 224 |
208 V8StringResource<> name; | 225 V8StringResource<> name; |
209 { | 226 name = info[0]; |
210 name = info[0]; | 227 if (!name.prepare()) |
211 if (!name.prepare()) | 228 return; |
212 return; | 229 |
213 } | |
214 bool result = impl->deleteNamedItem(name, exceptionState); | 230 bool result = impl->deleteNamedItem(name, exceptionState); |
215 if (exceptionState.hadException()) { | 231 if (exceptionState.hadException()) { |
216 return; | 232 return; |
217 } | 233 } |
218 v8SetReturnValueBool(info, result); | 234 v8SetReturnValueBool(info, result); |
219 } | 235 } |
220 | 236 |
221 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 237 static void deleteNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
222 { | 238 { |
223 TestInterface2V8Internal::deleteNamedItemMethod(info); | 239 TestInterface2V8Internal::deleteNamedItemMethod(info); |
224 } | 240 } |
225 | 241 |
226 static void stringifierMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 242 static void stringifierMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
227 { | 243 { |
228 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 244 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 245 |
229 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); | 246 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); |
230 } | 247 } |
231 | 248 |
232 static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 249 static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
233 { | 250 { |
234 TestInterface2V8Internal::stringifierMethodMethod(info); | 251 TestInterface2V8Internal::stringifierMethodMethod(info); |
235 } | 252 } |
236 | 253 |
237 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 254 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
238 { | 255 { |
239 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterface2", info.Holder(), info.GetIsolate()); | 256 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "keys"); |
| 257 |
240 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 258 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 259 |
241 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 260 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 261 |
242 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | 262 Iterator* result = impl->keysForBinding(scriptState, exceptionState); |
243 if (exceptionState.hadException()) { | 263 if (exceptionState.hadException()) { |
244 return; | 264 return; |
245 } | 265 } |
246 v8SetReturnValue(info, result); | 266 v8SetReturnValue(info, result); |
247 } | 267 } |
248 | 268 |
249 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 269 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
250 { | 270 { |
251 TestInterface2V8Internal::keysMethod(info); | 271 TestInterface2V8Internal::keysMethod(info); |
252 } | 272 } |
253 | 273 |
254 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 274 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
255 { | 275 { |
256 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterface2", info.Holder(), info.GetIsolate()); | 276 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "values"); |
| 277 |
257 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 278 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 279 |
258 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 280 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 281 |
259 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 282 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
260 if (exceptionState.hadException()) { | 283 if (exceptionState.hadException()) { |
261 return; | 284 return; |
262 } | 285 } |
263 v8SetReturnValue(info, result); | 286 v8SetReturnValue(info, result); |
264 } | 287 } |
265 | 288 |
266 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 289 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
267 { | 290 { |
268 TestInterface2V8Internal::valuesMethod(info); | 291 TestInterface2V8Internal::valuesMethod(info); |
269 } | 292 } |
270 | 293 |
271 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 294 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
272 { | 295 { |
273 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterface2", info.Holder(), info.GetIsolate()); | 296 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "entries"); |
| 297 |
274 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 298 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 299 |
275 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 300 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 301 |
276 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 302 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
277 if (exceptionState.hadException()) { | 303 if (exceptionState.hadException()) { |
278 return; | 304 return; |
279 } | 305 } |
280 v8SetReturnValue(info, result); | 306 v8SetReturnValue(info, result); |
281 } | 307 } |
282 | 308 |
283 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 309 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
284 { | 310 { |
285 TestInterface2V8Internal::entriesMethod(info); | 311 TestInterface2V8Internal::entriesMethod(info); |
286 } | 312 } |
287 | 313 |
288 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 314 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
289 { | 315 { |
290 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "
TestInterface2", info.Holder(), info.GetIsolate()); | 316 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "forEach"); |
| 317 |
| 318 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 319 |
| 320 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 321 |
291 if (UNLIKELY(info.Length() < 1)) { | 322 if (UNLIKELY(info.Length() < 1)) { |
292 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 323 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
293 return; | 324 return; |
294 } | 325 } |
295 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 326 |
296 ScriptValue callback; | 327 ScriptValue callback; |
297 ScriptValue thisArg; | 328 ScriptValue thisArg; |
298 { | 329 if (!info[0]->IsFunction()) { |
299 if (!info[0]->IsFunction()) { | 330 exceptionState.throwTypeError("The callback provided as parameter 1 is n
ot a function."); |
300 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); | 331 |
301 return; | 332 return; |
302 } | |
303 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; | |
304 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | |
305 } | 333 } |
306 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 334 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); |
| 335 |
| 336 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
| 337 |
307 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); | 338 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); |
308 if (exceptionState.hadException()) { | 339 if (exceptionState.hadException()) { |
309 return; | 340 return; |
310 } | 341 } |
311 } | 342 } |
312 | 343 |
313 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 344 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
314 { | 345 { |
315 TestInterface2V8Internal::forEachMethod(info); | 346 TestInterface2V8Internal::forEachMethod(info); |
316 } | 347 } |
317 | 348 |
318 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 349 static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
319 { | 350 { |
320 ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "Test
Interface2", info.Holder(), info.GetIsolate()); | 351 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "has"); |
| 352 |
| 353 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 354 |
| 355 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 356 |
321 if (UNLIKELY(info.Length() < 1)) { | 357 if (UNLIKELY(info.Length() < 1)) { |
322 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 358 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
323 return; | 359 return; |
324 } | 360 } |
325 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 361 |
326 TestInterfaceEmpty* value; | 362 TestInterfaceEmpty* value; |
327 { | 363 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]
); |
328 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf
o[0]); | 364 if (!value) { |
329 if (!value) { | 365 exceptionState.throwTypeError("parameter 1 is not of type 'TestInterface
Empty'."); |
330 exceptionState.throwTypeError("parameter 1 is not of type 'TestInter
faceEmpty'."); | 366 |
331 return; | 367 return; |
332 } | |
333 } | 368 } |
334 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 369 |
335 bool result = impl->hasForBinding(scriptState, value, exceptionState); | 370 bool result = impl->hasForBinding(scriptState, value, exceptionState); |
336 if (exceptionState.hadException()) { | 371 if (exceptionState.hadException()) { |
337 return; | 372 return; |
338 } | 373 } |
339 v8SetReturnValueBool(info, result); | 374 v8SetReturnValueBool(info, result); |
340 } | 375 } |
341 | 376 |
342 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 377 static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
343 { | 378 { |
344 TestInterface2V8Internal::hasMethod(info); | 379 TestInterface2V8Internal::hasMethod(info); |
345 } | 380 } |
346 | 381 |
347 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 382 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
348 { | 383 { |
349 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 384 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 385 |
350 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); | 386 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); |
351 } | 387 } |
352 | 388 |
353 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 389 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
354 { | 390 { |
355 TestInterface2V8Internal::toStringMethod(info); | 391 TestInterface2V8Internal::toStringMethod(info); |
356 } | 392 } |
357 | 393 |
358 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 394 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
359 { | 395 { |
360 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface2", info.Holder(), info.GetIsolate()); | 396 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface2", "iterator"); |
| 397 |
361 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 398 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 399 |
362 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 400 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 401 |
363 Iterator* result = impl->iterator(scriptState, exceptionState); | 402 Iterator* result = impl->iterator(scriptState, exceptionState); |
364 if (exceptionState.hadException()) { | 403 if (exceptionState.hadException()) { |
365 return; | 404 return; |
366 } | 405 } |
367 v8SetReturnValue(info, result); | 406 v8SetReturnValue(info, result); |
368 } | 407 } |
369 | 408 |
370 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 409 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
371 { | 410 { |
372 TestInterface2V8Internal::iteratorMethod(info); | 411 TestInterface2V8Internal::iteratorMethod(info); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 InstallTemplateFunction V8TestInterface2::installV8TestInterface2TemplateFunctio
n = (InstallTemplateFunction)&V8TestInterface2::installV8TestInterface2Template; | 692 InstallTemplateFunction V8TestInterface2::installV8TestInterface2TemplateFunctio
n = (InstallTemplateFunction)&V8TestInterface2::installV8TestInterface2Template; |
654 | 693 |
655 void V8TestInterface2::updateWrapperTypeInfo(InstallTemplateFunction installTemp
lateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInte
rfaceObjectFunction) | 694 void V8TestInterface2::updateWrapperTypeInfo(InstallTemplateFunction installTemp
lateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInte
rfaceObjectFunction) |
656 { | 695 { |
657 V8TestInterface2::installV8TestInterface2TemplateFunction = installTemplateF
unction; | 696 V8TestInterface2::installV8TestInterface2TemplateFunction = installTemplateF
unction; |
658 if (preparePrototypeAndInterfaceObjectFunction) | 697 if (preparePrototypeAndInterfaceObjectFunction) |
659 V8TestInterface2::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunc
tion = preparePrototypeAndInterfaceObjectFunction; | 698 V8TestInterface2::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunc
tion = preparePrototypeAndInterfaceObjectFunction; |
660 } | 699 } |
661 | 700 |
662 } // namespace blink | 701 } // namespace blink |
OLD | NEW |