| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 This file is part of the Blink open source project. | |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | |
| 4 | |
| 5 This library is free software; you can redistribute it and/or | |
| 6 modify it under the terms of the GNU Library General Public | |
| 7 License as published by the Free Software Foundation; either | |
| 8 version 2 of the License, or (at your option) any later version. | |
| 9 | |
| 10 This library is distributed in the hope that it will be useful, | |
| 11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 Library General Public License for more details. | |
| 14 | |
| 15 You should have received a copy of the GNU Library General Public License | |
| 16 along with this library; see the file COPYING.LIB. If not, write to | |
| 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 18 Boston, MA 02111-1307, USA. | |
| 19 */ | |
| 20 | |
| 21 #include "config.h" | |
| 22 #include "V8TestObj.h" | |
| 23 | |
| 24 #include "HTMLNames.h" | |
| 25 #include "RuntimeEnabledFeatures.h" | |
| 26 #include "ScriptProfile.h" | |
| 27 #include "V8DOMStringList.h" | |
| 28 #include "V8Document.h" | |
| 29 #include "V8Float32Array.h" | |
| 30 #include "V8Node.h" | |
| 31 #include "V8SVGDocument.h" | |
| 32 #include "V8SVGPoint.h" | |
| 33 #include "V8ScriptProfile.h" | |
| 34 #include "V8TestCallback.h" | |
| 35 #include "V8TestNode.h" | |
| 36 #include "V8TestSubObj.h" | |
| 37 #include "bindings/v8/BindingSecurity.h" | |
| 38 #include "bindings/v8/Dictionary.h" | |
| 39 #include "bindings/v8/ScriptController.h" | |
| 40 #include "bindings/v8/ScriptValue.h" | |
| 41 #include "bindings/v8/SerializedScriptValue.h" | |
| 42 #include "bindings/v8/V8Binding.h" | |
| 43 #include "bindings/v8/V8Collection.h" | |
| 44 #include "bindings/v8/V8DOMActivityLogger.h" | |
| 45 #include "bindings/v8/V8DOMConfiguration.h" | |
| 46 #include "bindings/v8/V8DOMWrapper.h" | |
| 47 #include "bindings/v8/V8EventListenerList.h" | |
| 48 #include "bindings/v8/V8HiddenPropertyName.h" | |
| 49 #include "bindings/v8/V8ObjectConstructor.h" | |
| 50 #include "core/dom/ContextFeatures.h" | |
| 51 #include "core/dom/DOMStringList.h" | |
| 52 #include "core/dom/Document.h" | |
| 53 #include "core/dom/ExceptionCode.h" | |
| 54 #include "core/page/Frame.h" | |
| 55 #include "core/page/PageConsole.h" | |
| 56 #include "core/page/UseCounter.h" | |
| 57 #include "core/svg/properties/SVGPropertyTearOff.h" | |
| 58 #include "core/svg/properties/SVGStaticPropertyTearOff.h" | |
| 59 #include "wtf/Float32Array.h" | |
| 60 #include "wtf/GetPtr.h" | |
| 61 #include "wtf/RefCounted.h" | |
| 62 #include "wtf/RefPtr.h" | |
| 63 #include "wtf/UnusedParam.h" | |
| 64 #include "wtf/Vector.h" | |
| 65 | |
| 66 #if ENABLE(Condition1) | |
| 67 #include "V8TestObjectA.h" | |
| 68 #endif | |
| 69 | |
| 70 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 71 #include "V8TestObjectB.h" | |
| 72 #endif | |
| 73 | |
| 74 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 75 #include "V8TestObjectC.h" | |
| 76 #endif | |
| 77 | |
| 78 #if ENABLE(BINDING_INTEGRITY) | |
| 79 #if defined(OS_WIN) | |
| 80 #pragma warning(disable: 4483) | |
| 81 extern "C" { extern void (*const __identifier("??_7TestObj@WebCore@@6B@")[])();
} | |
| 82 #else | |
| 83 extern "C" { extern void* _ZTVN7WebCore7TestObjE[]; } | |
| 84 #endif | |
| 85 #endif // ENABLE(BINDING_INTEGRITY) | |
| 86 | |
| 87 namespace WebCore { | |
| 88 | |
| 89 #if ENABLE(BINDING_INTEGRITY) | |
| 90 // This checks if a DOM object that is about to be wrapped is valid. | |
| 91 // Specifically, it checks that a vtable of the DOM object is equal to | |
| 92 // a vtable of an expected class. | |
| 93 // Due to a dangling pointer, the DOM object you are wrapping might be | |
| 94 // already freed or realloced. If freed, the check will fail because | |
| 95 // a free list pointer should be stored at the head of the DOM object. | |
| 96 // If realloced, the check will fail because the vtable of the DOM object | |
| 97 // differs from the expected vtable (unless the same class of DOM object | |
| 98 // is realloced on the slot). | |
| 99 inline void checkTypeOrDieTrying(TestObj* object) | |
| 100 { | |
| 101 void* actualVTablePointer = *(reinterpret_cast<void**>(object)); | |
| 102 #if defined(OS_WIN) | |
| 103 void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7Test
Obj@WebCore@@6B@")); | |
| 104 #else | |
| 105 void* expectedVTablePointer = &_ZTVN7WebCore7TestObjE[2]; | |
| 106 #endif | |
| 107 if (actualVTablePointer != expectedVTablePointer) | |
| 108 CRASH(); | |
| 109 } | |
| 110 #endif // ENABLE(BINDING_INTEGRITY) | |
| 111 | |
| 112 #if defined(OS_WIN) | |
| 113 // In ScriptWrappable, the use of extern function prototypes inside templated st
atic methods has an issue on windows. | |
| 114 // These prototypes do not pick up the surrounding namespace, so drop out of Web
Core as a workaround. | |
| 115 } // namespace WebCore | |
| 116 using WebCore::ScriptWrappable; | |
| 117 using WebCore::V8TestObj; | |
| 118 using WebCore::TestObj; | |
| 119 #endif | |
| 120 void initializeScriptWrappableForInterface(TestObj* object) | |
| 121 { | |
| 122 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | |
| 123 ScriptWrappable::setTypeInfoInObject(object, &V8TestObj::info); | |
| 124 } | |
| 125 #if defined(OS_WIN) | |
| 126 namespace WebCore { | |
| 127 #endif | |
| 128 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObje
ct, 0, 0, 0, V8TestObj::installPerContextPrototypeProperties, 0, WrapperTypeObje
ctPrototype }; | |
| 129 | |
| 130 namespace TestObjV8Internal { | |
| 131 | |
| 132 template <typename T> void V8_USE(T) { } | |
| 133 | |
| 134 static v8::Handle<v8::Value> readOnlyLongAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 135 { | |
| 136 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 137 return v8Integer(imp->readOnlyLongAttr(), info.GetIsolate()); | |
| 138 } | |
| 139 | |
| 140 static v8::Handle<v8::Value> readOnlyLongAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 141 { | |
| 142 return TestObjV8Internal::readOnlyLongAttrAttrGetter(name, info); | |
| 143 } | |
| 144 | |
| 145 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 146 { | |
| 147 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 148 return v8String(imp->readOnlyStringAttr(), info.GetIsolate(), ReturnUnsafeHa
ndle); | |
| 149 } | |
| 150 | |
| 151 static v8::Handle<v8::Value> readOnlyStringAttrAttrGetterCallback(v8::Local<v8::
String> name, const v8::AccessorInfo& info) | |
| 152 { | |
| 153 return TestObjV8Internal::readOnlyStringAttrAttrGetter(name, info); | |
| 154 } | |
| 155 | |
| 156 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 157 { | |
| 158 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 159 RefPtr<TestObj> result = imp->readOnlyTestObjAttr(); | |
| 160 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
| 161 if (wrapper.IsEmpty()) { | |
| 162 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
| 163 if (!wrapper.IsEmpty()) | |
| 164 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOn
lyTestObjAttr", wrapper); | |
| 165 } | |
| 166 return wrapper; | |
| 167 } | |
| 168 | |
| 169 static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 170 { | |
| 171 return TestObjV8Internal::readOnlyTestObjAttrAttrGetter(name, info); | |
| 172 } | |
| 173 | |
| 174 static v8::Handle<v8::Value> staticReadOnlyLongAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 175 { | |
| 176 return v8Integer(TestObj::staticReadOnlyLongAttr(), info.GetIsolate()); | |
| 177 } | |
| 178 | |
| 179 static v8::Handle<v8::Value> staticReadOnlyLongAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 180 { | |
| 181 return TestObjV8Internal::staticReadOnlyLongAttrAttrGetter(name, info); | |
| 182 } | |
| 183 | |
| 184 static v8::Handle<v8::Value> staticStringAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 185 { | |
| 186 return v8String(TestObj::staticStringAttr(), info.GetIsolate(), ReturnUnsafe
Handle); | |
| 187 } | |
| 188 | |
| 189 static v8::Handle<v8::Value> staticStringAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 190 { | |
| 191 return TestObjV8Internal::staticStringAttrAttrGetter(name, info); | |
| 192 } | |
| 193 | |
| 194 static void staticStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 195 { | |
| 196 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 197 TestObj::setStaticStringAttr(v); | |
| 198 return; | |
| 199 } | |
| 200 | |
| 201 static void staticStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 202 { | |
| 203 TestObjV8Internal::staticStringAttrAttrSetter(name, value, info); | |
| 204 } | |
| 205 | |
| 206 static v8::Handle<v8::Value> enumAttrAttrGetter(v8::Local<v8::String> name, cons
t v8::AccessorInfo& info) | |
| 207 { | |
| 208 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 209 return v8String(imp->enumAttr(), info.GetIsolate(), ReturnUnsafeHandle); | |
| 210 } | |
| 211 | |
| 212 static v8::Handle<v8::Value> enumAttrAttrGetterCallback(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 213 { | |
| 214 return TestObjV8Internal::enumAttrAttrGetter(name, info); | |
| 215 } | |
| 216 | |
| 217 static void enumAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
| 218 { | |
| 219 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 220 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 221 String string = v; | |
| 222 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | |
| 223 return; | |
| 224 imp->setEnumAttr(v); | |
| 225 return; | |
| 226 } | |
| 227 | |
| 228 static void enumAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 229 { | |
| 230 TestObjV8Internal::enumAttrAttrSetter(name, value, info); | |
| 231 } | |
| 232 | |
| 233 static v8::Handle<v8::Value> readOnlyEnumAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 234 { | |
| 235 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 236 return v8String(imp->readOnlyEnumAttr(), info.GetIsolate(), ReturnUnsafeHand
le); | |
| 237 } | |
| 238 | |
| 239 static v8::Handle<v8::Value> readOnlyEnumAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 240 { | |
| 241 return TestObjV8Internal::readOnlyEnumAttrAttrGetter(name, info); | |
| 242 } | |
| 243 | |
| 244 static v8::Handle<v8::Value> shortAttrAttrGetter(v8::Local<v8::String> name, con
st v8::AccessorInfo& info) | |
| 245 { | |
| 246 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 247 return v8Integer(imp->shortAttr(), info.GetIsolate()); | |
| 248 } | |
| 249 | |
| 250 static v8::Handle<v8::Value> shortAttrAttrGetterCallback(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
| 251 { | |
| 252 return TestObjV8Internal::shortAttrAttrGetter(name, info); | |
| 253 } | |
| 254 | |
| 255 static void shortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
| 256 { | |
| 257 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 258 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 259 imp->setShortAttr(v); | |
| 260 return; | |
| 261 } | |
| 262 | |
| 263 static void shortAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
| 264 { | |
| 265 TestObjV8Internal::shortAttrAttrSetter(name, value, info); | |
| 266 } | |
| 267 | |
| 268 static v8::Handle<v8::Value> unsignedShortAttrAttrGetter(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
| 269 { | |
| 270 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 271 return v8Integer(imp->unsignedShortAttr(), info.GetIsolate()); | |
| 272 } | |
| 273 | |
| 274 static v8::Handle<v8::Value> unsignedShortAttrAttrGetterCallback(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 275 { | |
| 276 return TestObjV8Internal::unsignedShortAttrAttrGetter(name, info); | |
| 277 } | |
| 278 | |
| 279 static void unsignedShortAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
| 280 { | |
| 281 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 282 V8TRYCATCH_VOID(int, v, toUInt32(value)); | |
| 283 imp->setUnsignedShortAttr(v); | |
| 284 return; | |
| 285 } | |
| 286 | |
| 287 static void unsignedShortAttrAttrSetterCallback(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 288 { | |
| 289 TestObjV8Internal::unsignedShortAttrAttrSetter(name, value, info); | |
| 290 } | |
| 291 | |
| 292 static v8::Handle<v8::Value> longAttrAttrGetter(v8::Local<v8::String> name, cons
t v8::AccessorInfo& info) | |
| 293 { | |
| 294 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 295 return v8Integer(imp->longAttr(), info.GetIsolate()); | |
| 296 } | |
| 297 | |
| 298 static v8::Handle<v8::Value> longAttrAttrGetterCallback(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 299 { | |
| 300 return TestObjV8Internal::longAttrAttrGetter(name, info); | |
| 301 } | |
| 302 | |
| 303 static void longAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value>
value, const v8::AccessorInfo& info) | |
| 304 { | |
| 305 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 306 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 307 imp->setLongAttr(v); | |
| 308 return; | |
| 309 } | |
| 310 | |
| 311 static void longAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 312 { | |
| 313 TestObjV8Internal::longAttrAttrSetter(name, value, info); | |
| 314 } | |
| 315 | |
| 316 static v8::Handle<v8::Value> longLongAttrAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 317 { | |
| 318 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 319 return v8::Number::New(static_cast<double>(imp->longLongAttr())); | |
| 320 } | |
| 321 | |
| 322 static v8::Handle<v8::Value> longLongAttrAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 323 { | |
| 324 return TestObjV8Internal::longLongAttrAttrGetter(name, info); | |
| 325 } | |
| 326 | |
| 327 static void longLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
| 328 { | |
| 329 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 330 V8TRYCATCH_VOID(long long, v, toInt64(value)); | |
| 331 imp->setLongLongAttr(v); | |
| 332 return; | |
| 333 } | |
| 334 | |
| 335 static void longLongAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 336 { | |
| 337 TestObjV8Internal::longLongAttrAttrSetter(name, value, info); | |
| 338 } | |
| 339 | |
| 340 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 341 { | |
| 342 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 343 return v8::Number::New(static_cast<double>(imp->unsignedLongLongAttr())); | |
| 344 } | |
| 345 | |
| 346 static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 347 { | |
| 348 return TestObjV8Internal::unsignedLongLongAttrAttrGetter(name, info); | |
| 349 } | |
| 350 | |
| 351 static void unsignedLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 352 { | |
| 353 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 354 V8TRYCATCH_VOID(unsigned long long, v, toUInt64(value)); | |
| 355 imp->setUnsignedLongLongAttr(v); | |
| 356 return; | |
| 357 } | |
| 358 | |
| 359 static void unsignedLongLongAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 360 { | |
| 361 TestObjV8Internal::unsignedLongLongAttrAttrSetter(name, value, info); | |
| 362 } | |
| 363 | |
| 364 static v8::Handle<v8::Value> stringAttrAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 365 { | |
| 366 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 367 return v8String(imp->stringAttr(), info.GetIsolate(), ReturnUnsafeHandle); | |
| 368 } | |
| 369 | |
| 370 static v8::Handle<v8::Value> stringAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 371 { | |
| 372 return TestObjV8Internal::stringAttrAttrGetter(name, info); | |
| 373 } | |
| 374 | |
| 375 static void stringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 376 { | |
| 377 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 378 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 379 imp->setStringAttr(v); | |
| 380 return; | |
| 381 } | |
| 382 | |
| 383 static void stringAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 384 { | |
| 385 TestObjV8Internal::stringAttrAttrSetter(name, value, info); | |
| 386 } | |
| 387 | |
| 388 static v8::Handle<v8::Value> testObjAttrAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 389 { | |
| 390 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 391 return toV8Fast(imp->testObjAttr(), info, imp); | |
| 392 } | |
| 393 | |
| 394 static v8::Handle<v8::Value> testObjAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 395 { | |
| 396 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
| 397 return TestObjV8Internal::testObjAttrAttrGetter(name, info); | |
| 398 } | |
| 399 | |
| 400 static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
| 401 { | |
| 402 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 403 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 404 imp->setTestObjAttr(WTF::getPtr(v)); | |
| 405 return; | |
| 406 } | |
| 407 | |
| 408 static void testObjAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 409 { | |
| 410 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
| 411 TestObjV8Internal::testObjAttrAttrSetter(name, value, info); | |
| 412 } | |
| 413 | |
| 414 static v8::Handle<v8::Value> XMLObjAttrAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 415 { | |
| 416 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 417 return toV8Fast(imp->xmlObjAttr(), info, imp); | |
| 418 } | |
| 419 | |
| 420 static v8::Handle<v8::Value> XMLObjAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 421 { | |
| 422 return TestObjV8Internal::XMLObjAttrAttrGetter(name, info); | |
| 423 } | |
| 424 | |
| 425 static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 426 { | |
| 427 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 428 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 429 imp->setXMLObjAttr(WTF::getPtr(v)); | |
| 430 return; | |
| 431 } | |
| 432 | |
| 433 static void XMLObjAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 434 { | |
| 435 TestObjV8Internal::XMLObjAttrAttrSetter(name, value, info); | |
| 436 } | |
| 437 | |
| 438 static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const
v8::AccessorInfo& info) | |
| 439 { | |
| 440 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 441 return v8Boolean(imp->isCreate(), info.GetIsolate()); | |
| 442 } | |
| 443 | |
| 444 static v8::Handle<v8::Value> createAttrGetterCallback(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 445 { | |
| 446 return TestObjV8Internal::createAttrGetter(name, info); | |
| 447 } | |
| 448 | |
| 449 static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> va
lue, const v8::AccessorInfo& info) | |
| 450 { | |
| 451 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 452 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
| 453 imp->setCreate(v); | |
| 454 return; | |
| 455 } | |
| 456 | |
| 457 static void createAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 458 { | |
| 459 TestObjV8Internal::createAttrSetter(name, value, info); | |
| 460 } | |
| 461 | |
| 462 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 463 { | |
| 464 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 465 return v8String(imp->fastGetAttribute(WebCore::HTMLNames::reflectedstringatt
rAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
| 466 } | |
| 467 | |
| 468 static v8::Handle<v8::Value> reflectedStringAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 469 { | |
| 470 return TestObjV8Internal::reflectedStringAttrAttrGetter(name, info); | |
| 471 } | |
| 472 | |
| 473 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 474 { | |
| 475 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 476 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 477 imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v); | |
| 478 return; | |
| 479 } | |
| 480 | |
| 481 static void reflectedStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 482 { | |
| 483 TestObjV8Internal::reflectedStringAttrAttrSetter(name, value, info); | |
| 484 } | |
| 485 | |
| 486 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 487 { | |
| 488 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 489 return v8Integer(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedinte
gralattrAttr), info.GetIsolate()); | |
| 490 } | |
| 491 | |
| 492 static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 493 { | |
| 494 return TestObjV8Internal::reflectedIntegralAttrAttrGetter(name, info); | |
| 495 } | |
| 496 | |
| 497 static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 498 { | |
| 499 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 500 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 501 imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v); | |
| 502 return; | |
| 503 } | |
| 504 | |
| 505 static void reflectedIntegralAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 506 { | |
| 507 TestObjV8Internal::reflectedIntegralAttrAttrSetter(name, value, info); | |
| 508 } | |
| 509 | |
| 510 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 511 { | |
| 512 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 513 return v8UnsignedInteger(std::max(0, imp->getIntegralAttribute(WebCore::HTML
Names::reflectedunsignedintegralattrAttr)), info.GetIsolate()); | |
| 514 } | |
| 515 | |
| 516 static v8::Handle<v8::Value> reflectedUnsignedIntegralAttrAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 517 { | |
| 518 return TestObjV8Internal::reflectedUnsignedIntegralAttrAttrGetter(name, info
); | |
| 519 } | |
| 520 | |
| 521 static void reflectedUnsignedIntegralAttrAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 522 { | |
| 523 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 524 V8TRYCATCH_VOID(unsigned, v, toUInt32(value)); | |
| 525 imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedinteg
ralattrAttr, v); | |
| 526 return; | |
| 527 } | |
| 528 | |
| 529 static void reflectedUnsignedIntegralAttrAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 530 { | |
| 531 TestObjV8Internal::reflectedUnsignedIntegralAttrAttrSetter(name, value, info
); | |
| 532 } | |
| 533 | |
| 534 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 535 { | |
| 536 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 537 return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::reflectedbooleana
ttrAttr), info.GetIsolate()); | |
| 538 } | |
| 539 | |
| 540 static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 541 { | |
| 542 return TestObjV8Internal::reflectedBooleanAttrAttrGetter(name, info); | |
| 543 } | |
| 544 | |
| 545 static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 546 { | |
| 547 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 548 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
| 549 imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v); | |
| 550 return; | |
| 551 } | |
| 552 | |
| 553 static void reflectedBooleanAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 554 { | |
| 555 TestObjV8Internal::reflectedBooleanAttrAttrSetter(name, value, info); | |
| 556 } | |
| 557 | |
| 558 static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 559 { | |
| 560 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 561 return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAtt
r), info.GetIsolate(), ReturnUnsafeHandle); | |
| 562 } | |
| 563 | |
| 564 static v8::Handle<v8::Value> reflectedURLAttrAttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 565 { | |
| 566 return TestObjV8Internal::reflectedURLAttrAttrGetter(name, info); | |
| 567 } | |
| 568 | |
| 569 static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 570 { | |
| 571 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 572 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 573 imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v); | |
| 574 return; | |
| 575 } | |
| 576 | |
| 577 static void reflectedURLAttrAttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 578 { | |
| 579 TestObjV8Internal::reflectedURLAttrAttrSetter(name, value, info); | |
| 580 } | |
| 581 | |
| 582 static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 583 { | |
| 584 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 585 return v8String(imp->fastGetAttribute(WebCore::HTMLNames::customContentStrin
gAttrAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
| 586 } | |
| 587 | |
| 588 static v8::Handle<v8::Value> reflectedStringAttrAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 589 { | |
| 590 return TestObjV8Internal::reflectedStringAttrAttrGetter(name, info); | |
| 591 } | |
| 592 | |
| 593 static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 594 { | |
| 595 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 596 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 597 imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v); | |
| 598 return; | |
| 599 } | |
| 600 | |
| 601 static void reflectedStringAttrAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 602 { | |
| 603 TestObjV8Internal::reflectedStringAttrAttrSetter(name, value, info); | |
| 604 } | |
| 605 | |
| 606 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 607 { | |
| 608 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 609 return v8Integer(imp->getIntegralAttribute(WebCore::HTMLNames::customContent
IntegralAttrAttr), info.GetIsolate()); | |
| 610 } | |
| 611 | |
| 612 static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetterCallback(v8::L
ocal<v8::String> name, const v8::AccessorInfo& info) | |
| 613 { | |
| 614 return TestObjV8Internal::reflectedCustomIntegralAttrAttrGetter(name, info); | |
| 615 } | |
| 616 | |
| 617 static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 618 { | |
| 619 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 620 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 621 imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr,
v); | |
| 622 return; | |
| 623 } | |
| 624 | |
| 625 static void reflectedCustomIntegralAttrAttrSetterCallback(v8::Local<v8::String>
name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 626 { | |
| 627 TestObjV8Internal::reflectedCustomIntegralAttrAttrSetter(name, value, info); | |
| 628 } | |
| 629 | |
| 630 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::
String> name, const v8::AccessorInfo& info) | |
| 631 { | |
| 632 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 633 return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::customContentBool
eanAttrAttr), info.GetIsolate()); | |
| 634 } | |
| 635 | |
| 636 static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetterCallback(v8::Lo
cal<v8::String> name, const v8::AccessorInfo& info) | |
| 637 { | |
| 638 return TestObjV8Internal::reflectedCustomBooleanAttrAttrGetter(name, info); | |
| 639 } | |
| 640 | |
| 641 static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 642 { | |
| 643 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 644 V8TRYCATCH_VOID(bool, v, value->BooleanValue()); | |
| 645 imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v
); | |
| 646 return; | |
| 647 } | |
| 648 | |
| 649 static void reflectedCustomBooleanAttrAttrSetterCallback(v8::Local<v8::String> n
ame, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 650 { | |
| 651 TestObjV8Internal::reflectedCustomBooleanAttrAttrSetter(name, value, info); | |
| 652 } | |
| 653 | |
| 654 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 655 { | |
| 656 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 657 return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAtt
rAttr), info.GetIsolate(), ReturnUnsafeHandle); | |
| 658 } | |
| 659 | |
| 660 static v8::Handle<v8::Value> reflectedCustomURLAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 661 { | |
| 662 return TestObjV8Internal::reflectedCustomURLAttrAttrGetter(name, info); | |
| 663 } | |
| 664 | |
| 665 static void reflectedCustomURLAttrAttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 666 { | |
| 667 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 668 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, val
ue); | |
| 669 imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v); | |
| 670 return; | |
| 671 } | |
| 672 | |
| 673 static void reflectedCustomURLAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 674 { | |
| 675 TestObjV8Internal::reflectedCustomURLAttrAttrSetter(name, value, info); | |
| 676 } | |
| 677 | |
| 678 static v8::Handle<v8::Value> typedArrayAttrAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 679 { | |
| 680 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 681 return toV8Fast(imp->typedArrayAttr(), info, imp); | |
| 682 } | |
| 683 | |
| 684 static v8::Handle<v8::Value> typedArrayAttrAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 685 { | |
| 686 return TestObjV8Internal::typedArrayAttrAttrGetter(name, info); | |
| 687 } | |
| 688 | |
| 689 static void typedArrayAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 690 { | |
| 691 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 692 V8TRYCATCH_VOID(Float32Array*, v, V8Float32Array::HasInstance(value, info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<
v8::Object>::Cast(value)) : 0); | |
| 693 imp->setTypedArrayAttr(WTF::getPtr(v)); | |
| 694 return; | |
| 695 } | |
| 696 | |
| 697 static void typedArrayAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 698 { | |
| 699 TestObjV8Internal::typedArrayAttrAttrSetter(name, value, info); | |
| 700 } | |
| 701 | |
| 702 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 703 { | |
| 704 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 705 ExceptionCode ec = 0; | |
| 706 int v = imp->attrWithGetterException(ec); | |
| 707 if (UNLIKELY(ec)) | |
| 708 return setDOMException(ec, info.GetIsolate()); | |
| 709 return v8Integer(v, info.GetIsolate()); | |
| 710 } | |
| 711 | |
| 712 static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 713 { | |
| 714 return TestObjV8Internal::attrWithGetterExceptionAttrGetter(name, info); | |
| 715 } | |
| 716 | |
| 717 static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::AccessorInfo& info) | |
| 718 { | |
| 719 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 720 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 721 imp->setAttrWithGetterException(v); | |
| 722 return; | |
| 723 } | |
| 724 | |
| 725 static void attrWithGetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 726 { | |
| 727 TestObjV8Internal::attrWithGetterExceptionAttrSetter(name, value, info); | |
| 728 } | |
| 729 | |
| 730 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 731 { | |
| 732 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 733 return v8Integer(imp->attrWithSetterException(), info.GetIsolate()); | |
| 734 } | |
| 735 | |
| 736 static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 737 { | |
| 738 return TestObjV8Internal::attrWithSetterExceptionAttrGetter(name, info); | |
| 739 } | |
| 740 | |
| 741 static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::AccessorInfo& info) | |
| 742 { | |
| 743 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 744 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 745 ExceptionCode ec = 0; | |
| 746 imp->setAttrWithSetterException(v, ec); | |
| 747 if (UNLIKELY(ec)) | |
| 748 setDOMException(ec, info.GetIsolate()); | |
| 749 return; | |
| 750 } | |
| 751 | |
| 752 static void attrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 753 { | |
| 754 TestObjV8Internal::attrWithSetterExceptionAttrSetter(name, value, info); | |
| 755 } | |
| 756 | |
| 757 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 758 { | |
| 759 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 760 ExceptionCode ec = 0; | |
| 761 String v = imp->stringAttrWithGetterException(ec); | |
| 762 if (UNLIKELY(ec)) | |
| 763 return setDOMException(ec, info.GetIsolate()); | |
| 764 return v8String(v, info.GetIsolate(), ReturnUnsafeHandle); | |
| 765 } | |
| 766 | |
| 767 static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 768 { | |
| 769 return TestObjV8Internal::stringAttrWithGetterExceptionAttrGetter(name, info
); | |
| 770 } | |
| 771 | |
| 772 static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 773 { | |
| 774 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 775 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 776 imp->setStringAttrWithGetterException(v); | |
| 777 return; | |
| 778 } | |
| 779 | |
| 780 static void stringAttrWithGetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 781 { | |
| 782 TestObjV8Internal::stringAttrWithGetterExceptionAttrSetter(name, value, info
); | |
| 783 } | |
| 784 | |
| 785 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 786 { | |
| 787 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 788 return v8String(imp->stringAttrWithSetterException(), info.GetIsolate(), Ret
urnUnsafeHandle); | |
| 789 } | |
| 790 | |
| 791 static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 792 { | |
| 793 return TestObjV8Internal::stringAttrWithSetterExceptionAttrGetter(name, info
); | |
| 794 } | |
| 795 | |
| 796 static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 797 { | |
| 798 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 799 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | |
| 800 ExceptionCode ec = 0; | |
| 801 imp->setStringAttrWithSetterException(v, ec); | |
| 802 if (UNLIKELY(ec)) | |
| 803 setDOMException(ec, info.GetIsolate()); | |
| 804 return; | |
| 805 } | |
| 806 | |
| 807 static void stringAttrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 808 { | |
| 809 TestObjV8Internal::stringAttrWithSetterExceptionAttrSetter(name, value, info
); | |
| 810 } | |
| 811 | |
| 812 static v8::Handle<v8::Value> customAttrAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 813 { | |
| 814 return V8TestObj::customAttrAttrGetterCustom(name, info); | |
| 815 } | |
| 816 | |
| 817 static void customAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 818 { | |
| 819 V8TestObj::customAttrAttrSetterCustom(name, value, info); | |
| 820 } | |
| 821 | |
| 822 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetter(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 823 { | |
| 824 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 825 ScriptState* currentState = ScriptState::current(); | |
| 826 if (!currentState) | |
| 827 return v8Undefined(); | |
| 828 ScriptState& state = *currentState; | |
| 829 return v8Integer(imp->withScriptStateAttribute(&state), info.GetIsolate()); | |
| 830 } | |
| 831 | |
| 832 static v8::Handle<v8::Value> withScriptStateAttributeAttrGetterCallback(v8::Loca
l<v8::String> name, const v8::AccessorInfo& info) | |
| 833 { | |
| 834 return TestObjV8Internal::withScriptStateAttributeAttrGetter(name, info); | |
| 835 } | |
| 836 | |
| 837 static void withScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 838 { | |
| 839 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 840 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 841 ScriptState* currentState = ScriptState::current(); | |
| 842 if (!currentState) | |
| 843 return; | |
| 844 ScriptState& state = *currentState; | |
| 845 imp->setWithScriptStateAttribute(&state, v); | |
| 846 if (state.hadException()) | |
| 847 throwError(state.exception(), info.GetIsolate()); | |
| 848 return; | |
| 849 } | |
| 850 | |
| 851 static void withScriptStateAttributeAttrSetterCallback(v8::Local<v8::String> nam
e, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 852 { | |
| 853 TestObjV8Internal::withScriptStateAttributeAttrSetter(name, value, info); | |
| 854 } | |
| 855 | |
| 856 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetter(v8::L
ocal<v8::String> name, const v8::AccessorInfo& info) | |
| 857 { | |
| 858 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 859 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 860 return toV8Fast(imp->withScriptExecutionContextAttribute(scriptContext), inf
o, imp); | |
| 861 } | |
| 862 | |
| 863 static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetterCallba
ck(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 864 { | |
| 865 return TestObjV8Internal::withScriptExecutionContextAttributeAttrGetter(name
, info); | |
| 866 } | |
| 867 | |
| 868 static void withScriptExecutionContextAttributeAttrSetter(v8::Local<v8::String>
name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 869 { | |
| 870 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 871 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 872 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 873 imp->setWithScriptExecutionContextAttribute(scriptContext, WTF::getPtr(v)); | |
| 874 return; | |
| 875 } | |
| 876 | |
| 877 static void withScriptExecutionContextAttributeAttrSetterCallback(v8::Local<v8::
String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 878 { | |
| 879 TestObjV8Internal::withScriptExecutionContextAttributeAttrSetter(name, value
, info); | |
| 880 } | |
| 881 | |
| 882 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 883 { | |
| 884 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 885 ExceptionCode ec = 0; | |
| 886 ScriptState* currentState = ScriptState::current(); | |
| 887 if (!currentState) | |
| 888 return v8Undefined(); | |
| 889 ScriptState& state = *currentState; | |
| 890 RefPtr<TestObj> v = imp->withScriptStateAttributeRaises(&state, ec); | |
| 891 if (UNLIKELY(ec)) | |
| 892 return setDOMException(ec, info.GetIsolate()); | |
| 893 if (state.hadException()) | |
| 894 return throwError(state.exception(), info.GetIsolate()); | |
| 895 return toV8Fast(v.release(), info, imp); | |
| 896 } | |
| 897 | |
| 898 static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetterCallback(v8
::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 899 { | |
| 900 return TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter(name, inf
o); | |
| 901 } | |
| 902 | |
| 903 static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 904 { | |
| 905 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 906 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 907 ScriptState* currentState = ScriptState::current(); | |
| 908 if (!currentState) | |
| 909 return; | |
| 910 ScriptState& state = *currentState; | |
| 911 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(v)); | |
| 912 if (state.hadException()) | |
| 913 throwError(state.exception(), info.GetIsolate()); | |
| 914 return; | |
| 915 } | |
| 916 | |
| 917 static void withScriptStateAttributeRaisesAttrSetterCallback(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 918 { | |
| 919 TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter(name, value, inf
o); | |
| 920 } | |
| 921 | |
| 922 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 923 { | |
| 924 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 925 ExceptionCode ec = 0; | |
| 926 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 927 RefPtr<TestObj> v = imp->withScriptExecutionContextAttributeRaises(scriptCon
text, ec); | |
| 928 if (UNLIKELY(ec)) | |
| 929 return setDOMException(ec, info.GetIsolate()); | |
| 930 return toV8Fast(v.release(), info, imp); | |
| 931 } | |
| 932 | |
| 933 static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter
Callback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 934 { | |
| 935 return TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGette
r(name, info); | |
| 936 } | |
| 937 | |
| 938 static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::St
ring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 939 { | |
| 940 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 941 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 942 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 943 imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr
(v)); | |
| 944 return; | |
| 945 } | |
| 946 | |
| 947 static void withScriptExecutionContextAttributeRaisesAttrSetterCallback(v8::Loca
l<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 948 { | |
| 949 TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter(name,
value, info); | |
| 950 } | |
| 951 | |
| 952 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
trGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 953 { | |
| 954 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 955 ScriptState* currentState = ScriptState::current(); | |
| 956 if (!currentState) | |
| 957 return v8Undefined(); | |
| 958 ScriptState& state = *currentState; | |
| 959 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 960 return toV8Fast(imp->withScriptExecutionContextAndScriptStateAttribute(&stat
e, scriptContext), info, imp); | |
| 961 } | |
| 962 | |
| 963 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeAt
trGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 964 { | |
| 965 return TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeA
ttrGetter(name, info); | |
| 966 } | |
| 967 | |
| 968 static void withScriptExecutionContextAndScriptStateAttributeAttrSetter(v8::Loca
l<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 969 { | |
| 970 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 971 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 972 ScriptState* currentState = ScriptState::current(); | |
| 973 if (!currentState) | |
| 974 return; | |
| 975 ScriptState& state = *currentState; | |
| 976 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 977 imp->setWithScriptExecutionContextAndScriptStateAttribute(&state, scriptCont
ext, WTF::getPtr(v)); | |
| 978 if (state.hadException()) | |
| 979 throwError(state.exception(), info.GetIsolate()); | |
| 980 return; | |
| 981 } | |
| 982 | |
| 983 static void withScriptExecutionContextAndScriptStateAttributeAttrSetterCallback(
v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo&
info) | |
| 984 { | |
| 985 TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSett
er(name, value, info); | |
| 986 } | |
| 987 | |
| 988 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
isesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 989 { | |
| 990 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 991 ExceptionCode ec = 0; | |
| 992 ScriptState* currentState = ScriptState::current(); | |
| 993 if (!currentState) | |
| 994 return v8Undefined(); | |
| 995 ScriptState& state = *currentState; | |
| 996 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 997 RefPtr<TestObj> v = imp->withScriptExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, ec); | |
| 998 if (UNLIKELY(ec)) | |
| 999 return setDOMException(ec, info.GetIsolate()); | |
| 1000 if (state.hadException()) | |
| 1001 return throwError(state.exception(), info.GetIsolate()); | |
| 1002 return toV8Fast(v.release(), info, imp); | |
| 1003 } | |
| 1004 | |
| 1005 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateAttributeRa
isesAttrGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1006 { | |
| 1007 return TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeR
aisesAttrGetter(name, info); | |
| 1008 } | |
| 1009 | |
| 1010 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter(v8
::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& in
fo) | |
| 1011 { | |
| 1012 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1013 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1014 ScriptState* currentState = ScriptState::current(); | |
| 1015 if (!currentState) | |
| 1016 return; | |
| 1017 ScriptState& state = *currentState; | |
| 1018 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 1019 imp->setWithScriptExecutionContextAndScriptStateAttributeRaises(&state, scri
ptContext, WTF::getPtr(v)); | |
| 1020 if (state.hadException()) | |
| 1021 throwError(state.exception(), info.GetIsolate()); | |
| 1022 return; | |
| 1023 } | |
| 1024 | |
| 1025 static void withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetterCal
lback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Accessor
Info& info) | |
| 1026 { | |
| 1027 TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAt
trSetter(name, value, info); | |
| 1028 } | |
| 1029 | |
| 1030 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
ttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1031 { | |
| 1032 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1033 ScriptState* currentState = ScriptState::current(); | |
| 1034 if (!currentState) | |
| 1035 return v8Undefined(); | |
| 1036 ScriptState& state = *currentState; | |
| 1037 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 1038 return toV8Fast(imp->withScriptExecutionContextAndScriptStateWithSpacesAttri
bute(&state, scriptContext), info, imp); | |
| 1039 } | |
| 1040 | |
| 1041 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesA
ttributeAttrGetterCallback(v8::Local<v8::String> name, const v8::AccessorInfo& i
nfo) | |
| 1042 { | |
| 1043 return TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpaces
AttributeAttrGetter(name, info); | |
| 1044 } | |
| 1045 | |
| 1046 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSette
r(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo
& info) | |
| 1047 { | |
| 1048 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1049 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1050 ScriptState* currentState = ScriptState::current(); | |
| 1051 if (!currentState) | |
| 1052 return; | |
| 1053 ScriptState& state = *currentState; | |
| 1054 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 1055 imp->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(&state,
scriptContext, WTF::getPtr(v)); | |
| 1056 if (state.hadException()) | |
| 1057 throwError(state.exception(), info.GetIsolate()); | |
| 1058 return; | |
| 1059 } | |
| 1060 | |
| 1061 static void withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSette
rCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::Acce
ssorInfo& info) | |
| 1062 { | |
| 1063 TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttribu
teAttrSetter(name, value, info); | |
| 1064 } | |
| 1065 | |
| 1066 static v8::Handle<v8::Value> enforcedRangeLongAttrAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1067 { | |
| 1068 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1069 return v8Integer(imp->enforcedRangeLongAttr(), info.GetIsolate()); | |
| 1070 } | |
| 1071 | |
| 1072 static v8::Handle<v8::Value> enforcedRangeLongAttrAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1073 { | |
| 1074 return TestObjV8Internal::enforcedRangeLongAttrAttrGetter(name, info); | |
| 1075 } | |
| 1076 | |
| 1077 static void enforcedRangeLongAttrAttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 1078 { | |
| 1079 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1080 V8TRYCATCH_WITH_TYPECHECK_VOID(int, v, toInt32(value, EnforceRange, ok), inf
o.GetIsolate()); | |
| 1081 imp->setEnforcedRangeLongAttr(v); | |
| 1082 return; | |
| 1083 } | |
| 1084 | |
| 1085 static void enforcedRangeLongAttrAttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1086 { | |
| 1087 TestObjV8Internal::enforcedRangeLongAttrAttrSetter(name, value, info); | |
| 1088 } | |
| 1089 | |
| 1090 static v8::Handle<v8::Value> enforcedRangeUnsignedLongAttrAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1091 { | |
| 1092 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1093 return v8UnsignedInteger(imp->enforcedRangeUnsignedLongAttr(), info.GetIsola
te()); | |
| 1094 } | |
| 1095 | |
| 1096 static v8::Handle<v8::Value> enforcedRangeUnsignedLongAttrAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1097 { | |
| 1098 return TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrGetter(name, info
); | |
| 1099 } | |
| 1100 | |
| 1101 static void enforcedRangeUnsignedLongAttrAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1102 { | |
| 1103 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1104 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, v, toUInt32(value, EnforceRange, ok
), info.GetIsolate()); | |
| 1105 imp->setEnforcedRangeUnsignedLongAttr(v); | |
| 1106 return; | |
| 1107 } | |
| 1108 | |
| 1109 static void enforcedRangeUnsignedLongAttrAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1110 { | |
| 1111 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrSetter(name, value, info
); | |
| 1112 } | |
| 1113 | |
| 1114 static v8::Handle<v8::Value> enforcedRangeLongLongAttrAttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1115 { | |
| 1116 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1117 return v8::Number::New(static_cast<double>(imp->enforcedRangeLongLongAttr())
); | |
| 1118 } | |
| 1119 | |
| 1120 static v8::Handle<v8::Value> enforcedRangeLongLongAttrAttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 1121 { | |
| 1122 return TestObjV8Internal::enforcedRangeLongLongAttrAttrGetter(name, info); | |
| 1123 } | |
| 1124 | |
| 1125 static void enforcedRangeLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1126 { | |
| 1127 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1128 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, v, toInt64(value, EnforceRange, ok
), info.GetIsolate()); | |
| 1129 imp->setEnforcedRangeLongLongAttr(v); | |
| 1130 return; | |
| 1131 } | |
| 1132 | |
| 1133 static void enforcedRangeLongLongAttrAttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1134 { | |
| 1135 TestObjV8Internal::enforcedRangeLongLongAttrAttrSetter(name, value, info); | |
| 1136 } | |
| 1137 | |
| 1138 static v8::Handle<v8::Value> enforcedRangeUnsignedLongLongAttrAttrGetter(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 1139 { | |
| 1140 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1141 return v8::Number::New(static_cast<double>(imp->enforcedRangeUnsignedLongLon
gAttr())); | |
| 1142 } | |
| 1143 | |
| 1144 static v8::Handle<v8::Value> enforcedRangeUnsignedLongLongAttrAttrGetterCallback
(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1145 { | |
| 1146 return TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttrGetter(name,
info); | |
| 1147 } | |
| 1148 | |
| 1149 static void enforcedRangeUnsignedLongLongAttrAttrSetter(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1150 { | |
| 1151 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1152 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, v, toUInt64(value, Enforc
eRange, ok), info.GetIsolate()); | |
| 1153 imp->setEnforcedRangeUnsignedLongLongAttr(v); | |
| 1154 return; | |
| 1155 } | |
| 1156 | |
| 1157 static void enforcedRangeUnsignedLongLongAttrAttrSetterCallback(v8::Local<v8::St
ring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1158 { | |
| 1159 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttrSetter(name, value,
info); | |
| 1160 } | |
| 1161 | |
| 1162 #if ENABLE(Condition1) | |
| 1163 | |
| 1164 static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1165 { | |
| 1166 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1167 return v8Integer(imp->conditionalAttr1(), info.GetIsolate()); | |
| 1168 } | |
| 1169 | |
| 1170 #endif // ENABLE(Condition1) | |
| 1171 | |
| 1172 #if ENABLE(Condition1) | |
| 1173 | |
| 1174 static v8::Handle<v8::Value> conditionalAttr1AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1175 { | |
| 1176 return TestObjV8Internal::conditionalAttr1AttrGetter(name, info); | |
| 1177 } | |
| 1178 | |
| 1179 #endif // ENABLE(Condition1) | |
| 1180 | |
| 1181 #if ENABLE(Condition1) | |
| 1182 | |
| 1183 static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 1184 { | |
| 1185 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1186 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1187 imp->setConditionalAttr1(v); | |
| 1188 return; | |
| 1189 } | |
| 1190 | |
| 1191 #endif // ENABLE(Condition1) | |
| 1192 | |
| 1193 #if ENABLE(Condition1) | |
| 1194 | |
| 1195 static void conditionalAttr1AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 1196 { | |
| 1197 TestObjV8Internal::conditionalAttr1AttrSetter(name, value, info); | |
| 1198 } | |
| 1199 | |
| 1200 #endif // ENABLE(Condition1) | |
| 1201 | |
| 1202 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1203 | |
| 1204 static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1205 { | |
| 1206 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1207 return v8Integer(imp->conditionalAttr2(), info.GetIsolate()); | |
| 1208 } | |
| 1209 | |
| 1210 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1211 | |
| 1212 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1213 | |
| 1214 static v8::Handle<v8::Value> conditionalAttr2AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1215 { | |
| 1216 return TestObjV8Internal::conditionalAttr2AttrGetter(name, info); | |
| 1217 } | |
| 1218 | |
| 1219 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1220 | |
| 1221 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1222 | |
| 1223 static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 1224 { | |
| 1225 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1226 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1227 imp->setConditionalAttr2(v); | |
| 1228 return; | |
| 1229 } | |
| 1230 | |
| 1231 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1232 | |
| 1233 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 1234 | |
| 1235 static void conditionalAttr2AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 1236 { | |
| 1237 TestObjV8Internal::conditionalAttr2AttrSetter(name, value, info); | |
| 1238 } | |
| 1239 | |
| 1240 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 1241 | |
| 1242 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1243 | |
| 1244 static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1245 { | |
| 1246 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1247 return v8Integer(imp->conditionalAttr3(), info.GetIsolate()); | |
| 1248 } | |
| 1249 | |
| 1250 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1251 | |
| 1252 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1253 | |
| 1254 static v8::Handle<v8::Value> conditionalAttr3AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1255 { | |
| 1256 return TestObjV8Internal::conditionalAttr3AttrGetter(name, info); | |
| 1257 } | |
| 1258 | |
| 1259 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1260 | |
| 1261 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1262 | |
| 1263 static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
:Value> value, const v8::AccessorInfo& info) | |
| 1264 { | |
| 1265 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1266 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1267 imp->setConditionalAttr3(v); | |
| 1268 return; | |
| 1269 } | |
| 1270 | |
| 1271 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1272 | |
| 1273 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 1274 | |
| 1275 static void conditionalAttr3AttrSetterCallback(v8::Local<v8::String> name, v8::L
ocal<v8::Value> value, const v8::AccessorInfo& info) | |
| 1276 { | |
| 1277 TestObjV8Internal::conditionalAttr3AttrSetter(name, value, info); | |
| 1278 } | |
| 1279 | |
| 1280 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 1281 | |
| 1282 static v8::Handle<v8::Value> cachedAttribute1AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1283 { | |
| 1284 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1285 return imp->cachedAttribute1().v8Value(); | |
| 1286 } | |
| 1287 | |
| 1288 static v8::Handle<v8::Value> cachedAttribute1AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1289 { | |
| 1290 return TestObjV8Internal::cachedAttribute1AttrGetter(name, info); | |
| 1291 } | |
| 1292 | |
| 1293 static v8::Handle<v8::Value> cachedAttribute2AttrGetter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | |
| 1294 { | |
| 1295 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1296 return imp->cachedAttribute2().v8Value(); | |
| 1297 } | |
| 1298 | |
| 1299 static v8::Handle<v8::Value> cachedAttribute2AttrGetterCallback(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1300 { | |
| 1301 return TestObjV8Internal::cachedAttribute2AttrGetter(name, info); | |
| 1302 } | |
| 1303 | |
| 1304 static v8::Handle<v8::Value> anyAttributeAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 1305 { | |
| 1306 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1307 return imp->anyAttribute().v8Value(); | |
| 1308 } | |
| 1309 | |
| 1310 static v8::Handle<v8::Value> anyAttributeAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 1311 { | |
| 1312 return TestObjV8Internal::anyAttributeAttrGetter(name, info); | |
| 1313 } | |
| 1314 | |
| 1315 static void anyAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
| 1316 { | |
| 1317 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1318 V8TRYCATCH_VOID(ScriptValue, v, ScriptValue(value)); | |
| 1319 imp->setAnyAttribute(WTF::getPtr(v)); | |
| 1320 return; | |
| 1321 } | |
| 1322 | |
| 1323 static void anyAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 1324 { | |
| 1325 TestObjV8Internal::anyAttributeAttrSetter(name, value, info); | |
| 1326 } | |
| 1327 | |
| 1328 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1329 { | |
| 1330 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1331 return v8Integer(imp->enabledAtRuntimeAttr1(), info.GetIsolate()); | |
| 1332 } | |
| 1333 | |
| 1334 static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1335 { | |
| 1336 return TestObjV8Internal::enabledAtRuntimeAttr1AttrGetter(name, info); | |
| 1337 } | |
| 1338 | |
| 1339 static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 1340 { | |
| 1341 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1342 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1343 imp->setEnabledAtRuntimeAttr1(v); | |
| 1344 return; | |
| 1345 } | |
| 1346 | |
| 1347 static void enabledAtRuntimeAttr1AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1348 { | |
| 1349 TestObjV8Internal::enabledAtRuntimeAttr1AttrSetter(name, value, info); | |
| 1350 } | |
| 1351 | |
| 1352 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1353 { | |
| 1354 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1355 return v8Integer(imp->enabledAtRuntimeAttr2(), info.GetIsolate()); | |
| 1356 } | |
| 1357 | |
| 1358 static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1359 { | |
| 1360 return TestObjV8Internal::enabledAtRuntimeAttr2AttrGetter(name, info); | |
| 1361 } | |
| 1362 | |
| 1363 static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Loca
l<v8::Value> value, const v8::AccessorInfo& info) | |
| 1364 { | |
| 1365 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1366 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1367 imp->setEnabledAtRuntimeAttr2(v); | |
| 1368 return; | |
| 1369 } | |
| 1370 | |
| 1371 static void enabledAtRuntimeAttr2AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1372 { | |
| 1373 TestObjV8Internal::enabledAtRuntimeAttr2AttrSetter(name, value, info); | |
| 1374 } | |
| 1375 | |
| 1376 static v8::Handle<v8::Value> enabledPerContextAttr1AttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 1377 { | |
| 1378 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1379 return v8Integer(imp->enabledPerContextAttr1(), info.GetIsolate()); | |
| 1380 } | |
| 1381 | |
| 1382 static v8::Handle<v8::Value> enabledPerContextAttr1AttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 1383 { | |
| 1384 return TestObjV8Internal::enabledPerContextAttr1AttrGetter(name, info); | |
| 1385 } | |
| 1386 | |
| 1387 static void enabledPerContextAttr1AttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 1388 { | |
| 1389 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1390 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1391 imp->setEnabledPerContextAttr1(v); | |
| 1392 return; | |
| 1393 } | |
| 1394 | |
| 1395 static void enabledPerContextAttr1AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1396 { | |
| 1397 TestObjV8Internal::enabledPerContextAttr1AttrSetter(name, value, info); | |
| 1398 } | |
| 1399 | |
| 1400 static v8::Handle<v8::Value> enabledPerContextAttr2AttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 1401 { | |
| 1402 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1403 return v8Integer(imp->enabledPerContextAttr2(), info.GetIsolate()); | |
| 1404 } | |
| 1405 | |
| 1406 static v8::Handle<v8::Value> enabledPerContextAttr2AttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 1407 { | |
| 1408 return TestObjV8Internal::enabledPerContextAttr2AttrGetter(name, info); | |
| 1409 } | |
| 1410 | |
| 1411 static void enabledPerContextAttr2AttrSetter(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 1412 { | |
| 1413 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1414 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1415 imp->setEnabledPerContextAttr2(v); | |
| 1416 return; | |
| 1417 } | |
| 1418 | |
| 1419 static void enabledPerContextAttr2AttrSetterCallback(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1420 { | |
| 1421 TestObjV8Internal::enabledPerContextAttr2AttrSetter(name, value, info); | |
| 1422 } | |
| 1423 | |
| 1424 static v8::Handle<v8::Value> floatArrayAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 1425 { | |
| 1426 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1427 return v8Array(imp->floatArray(), info.GetIsolate()); | |
| 1428 } | |
| 1429 | |
| 1430 static v8::Handle<v8::Value> floatArrayAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1431 { | |
| 1432 return TestObjV8Internal::floatArrayAttrGetter(name, info); | |
| 1433 } | |
| 1434 | |
| 1435 static void floatArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 1436 { | |
| 1437 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1438 V8TRYCATCH_VOID(Vector<float>, v, toNativeArray<float>(value)); | |
| 1439 imp->setFloatArray(v); | |
| 1440 return; | |
| 1441 } | |
| 1442 | |
| 1443 static void floatArrayAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 1444 { | |
| 1445 TestObjV8Internal::floatArrayAttrSetter(name, value, info); | |
| 1446 } | |
| 1447 | |
| 1448 static v8::Handle<v8::Value> doubleArrayAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 1449 { | |
| 1450 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1451 return v8Array(imp->doubleArray(), info.GetIsolate()); | |
| 1452 } | |
| 1453 | |
| 1454 static v8::Handle<v8::Value> doubleArrayAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1455 { | |
| 1456 return TestObjV8Internal::doubleArrayAttrGetter(name, info); | |
| 1457 } | |
| 1458 | |
| 1459 static void doubleArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
| 1460 { | |
| 1461 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1462 V8TRYCATCH_VOID(Vector<double>, v, toNativeArray<double>(value)); | |
| 1463 imp->setDoubleArray(v); | |
| 1464 return; | |
| 1465 } | |
| 1466 | |
| 1467 static void doubleArrayAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1468 { | |
| 1469 TestObjV8Internal::doubleArrayAttrSetter(name, value, info); | |
| 1470 } | |
| 1471 | |
| 1472 static v8::Handle<v8::Value> contentDocumentAttrGetter(v8::Local<v8::String> nam
e, const v8::AccessorInfo& info) | |
| 1473 { | |
| 1474 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1475 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument())) | |
| 1476 return v8::Handle<v8::Value>(v8Null(info.GetIsolate())); | |
| 1477 | |
| 1478 return toV8Fast(imp->contentDocument(), info, imp); | |
| 1479 } | |
| 1480 | |
| 1481 static v8::Handle<v8::Value> contentDocumentAttrGetterCallback(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 1482 { | |
| 1483 return TestObjV8Internal::contentDocumentAttrGetter(name, info); | |
| 1484 } | |
| 1485 | |
| 1486 static v8::Handle<v8::Value> mutablePointAttrGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 1487 { | |
| 1488 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1489 return toV8Fast(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::c
reate(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), info, imp); | |
| 1490 } | |
| 1491 | |
| 1492 static v8::Handle<v8::Value> mutablePointAttrGetterCallback(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 1493 { | |
| 1494 return TestObjV8Internal::mutablePointAttrGetter(name, info); | |
| 1495 } | |
| 1496 | |
| 1497 static void mutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val
ue> value, const v8::AccessorInfo& info) | |
| 1498 { | |
| 1499 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1500 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<FloatPoint> >, v, V8SVGPoint::HasI
nstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::to
Native(v8::Handle<v8::Object>::Cast(value)) : 0); | |
| 1501 imp->setMutablePoint(WTF::getPtr(v)); | |
| 1502 return; | |
| 1503 } | |
| 1504 | |
| 1505 static void mutablePointAttrSetterCallback(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 1506 { | |
| 1507 TestObjV8Internal::mutablePointAttrSetter(name, value, info); | |
| 1508 } | |
| 1509 | |
| 1510 static v8::Handle<v8::Value> immutablePointAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 1511 { | |
| 1512 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1513 return toV8Fast(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immu
tablePoint())), info, imp); | |
| 1514 } | |
| 1515 | |
| 1516 static v8::Handle<v8::Value> immutablePointAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 1517 { | |
| 1518 return TestObjV8Internal::immutablePointAttrGetter(name, info); | |
| 1519 } | |
| 1520 | |
| 1521 static void immutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 1522 { | |
| 1523 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1524 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<FloatPoint> >, v, V8SVGPoint::HasI
nstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::to
Native(v8::Handle<v8::Object>::Cast(value)) : 0); | |
| 1525 imp->setImmutablePoint(WTF::getPtr(v)); | |
| 1526 return; | |
| 1527 } | |
| 1528 | |
| 1529 static void immutablePointAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 1530 { | |
| 1531 TestObjV8Internal::immutablePointAttrSetter(name, value, info); | |
| 1532 } | |
| 1533 | |
| 1534 static v8::Handle<v8::Value> strawberryAttrGetter(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 1535 { | |
| 1536 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1537 return v8Integer(imp->blueberry(), info.GetIsolate()); | |
| 1538 } | |
| 1539 | |
| 1540 static v8::Handle<v8::Value> strawberryAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1541 { | |
| 1542 return TestObjV8Internal::strawberryAttrGetter(name, info); | |
| 1543 } | |
| 1544 | |
| 1545 static void strawberryAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 1546 { | |
| 1547 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1548 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1549 imp->setBlueberry(v); | |
| 1550 return; | |
| 1551 } | |
| 1552 | |
| 1553 static void strawberryAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 1554 { | |
| 1555 TestObjV8Internal::strawberryAttrSetter(name, value, info); | |
| 1556 } | |
| 1557 | |
| 1558 static v8::Handle<v8::Value> strictFloatAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 1559 { | |
| 1560 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1561 return v8::Number::New(imp->strictFloat()); | |
| 1562 } | |
| 1563 | |
| 1564 static v8::Handle<v8::Value> strictFloatAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1565 { | |
| 1566 return TestObjV8Internal::strictFloatAttrGetter(name, info); | |
| 1567 } | |
| 1568 | |
| 1569 static void strictFloatAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
e> value, const v8::AccessorInfo& info) | |
| 1570 { | |
| 1571 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1572 V8TRYCATCH_VOID(float, v, static_cast<float>(value->NumberValue())); | |
| 1573 imp->setStrictFloat(v); | |
| 1574 return; | |
| 1575 } | |
| 1576 | |
| 1577 static void strictFloatAttrSetterCallback(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1578 { | |
| 1579 TestObjV8Internal::strictFloatAttrSetter(name, value, info); | |
| 1580 } | |
| 1581 | |
| 1582 static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, c
onst v8::AccessorInfo& info) | |
| 1583 { | |
| 1584 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1585 return v8Integer(imp->description(), info.GetIsolate()); | |
| 1586 } | |
| 1587 | |
| 1588 static v8::Handle<v8::Value> descriptionAttrGetterCallback(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1589 { | |
| 1590 return TestObjV8Internal::descriptionAttrGetter(name, info); | |
| 1591 } | |
| 1592 | |
| 1593 static v8::Handle<v8::Value> idAttrGetter(v8::Local<v8::String> name, const v8::
AccessorInfo& info) | |
| 1594 { | |
| 1595 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1596 return v8Integer(imp->id(), info.GetIsolate()); | |
| 1597 } | |
| 1598 | |
| 1599 static v8::Handle<v8::Value> idAttrGetterCallback(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | |
| 1600 { | |
| 1601 return TestObjV8Internal::idAttrGetter(name, info); | |
| 1602 } | |
| 1603 | |
| 1604 static void idAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value,
const v8::AccessorInfo& info) | |
| 1605 { | |
| 1606 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1607 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1608 imp->setId(v); | |
| 1609 return; | |
| 1610 } | |
| 1611 | |
| 1612 static void idAttrSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value
> value, const v8::AccessorInfo& info) | |
| 1613 { | |
| 1614 TestObjV8Internal::idAttrSetter(name, value, info); | |
| 1615 } | |
| 1616 | |
| 1617 static v8::Handle<v8::Value> hashAttrGetter(v8::Local<v8::String> name, const v8
::AccessorInfo& info) | |
| 1618 { | |
| 1619 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1620 return v8String(imp->hash(), info.GetIsolate(), ReturnUnsafeHandle); | |
| 1621 } | |
| 1622 | |
| 1623 static v8::Handle<v8::Value> hashAttrGetterCallback(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 1624 { | |
| 1625 return TestObjV8Internal::hashAttrGetter(name, info); | |
| 1626 } | |
| 1627 | |
| 1628 static v8::Handle<v8::Value> replaceableAttributeAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 1629 { | |
| 1630 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1631 return v8Integer(imp->replaceableAttribute(), info.GetIsolate()); | |
| 1632 } | |
| 1633 | |
| 1634 static v8::Handle<v8::Value> replaceableAttributeAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 1635 { | |
| 1636 return TestObjV8Internal::replaceableAttributeAttrGetter(name, info); | |
| 1637 } | |
| 1638 | |
| 1639 static v8::Handle<v8::Value> nullableDoubleAttributeAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 1640 { | |
| 1641 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1642 bool isNull = false; | |
| 1643 double v = imp->nullableDoubleAttribute(isNull); | |
| 1644 if (isNull) | |
| 1645 return v8Null(info.GetIsolate()); | |
| 1646 return v8::Number::New(v); | |
| 1647 } | |
| 1648 | |
| 1649 static v8::Handle<v8::Value> nullableDoubleAttributeAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 1650 { | |
| 1651 return TestObjV8Internal::nullableDoubleAttributeAttrGetter(name, info); | |
| 1652 } | |
| 1653 | |
| 1654 static v8::Handle<v8::Value> nullableLongAttributeAttrGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 1655 { | |
| 1656 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1657 bool isNull = false; | |
| 1658 int v = imp->nullableLongAttribute(isNull); | |
| 1659 if (isNull) | |
| 1660 return v8Null(info.GetIsolate()); | |
| 1661 return v8Integer(v, info.GetIsolate()); | |
| 1662 } | |
| 1663 | |
| 1664 static v8::Handle<v8::Value> nullableLongAttributeAttrGetterCallback(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1665 { | |
| 1666 return TestObjV8Internal::nullableLongAttributeAttrGetter(name, info); | |
| 1667 } | |
| 1668 | |
| 1669 static v8::Handle<v8::Value> nullableBooleanAttributeAttrGetter(v8::Local<v8::St
ring> name, const v8::AccessorInfo& info) | |
| 1670 { | |
| 1671 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1672 bool isNull = false; | |
| 1673 bool v = imp->nullableBooleanAttribute(isNull); | |
| 1674 if (isNull) | |
| 1675 return v8Null(info.GetIsolate()); | |
| 1676 return v8Boolean(v, info.GetIsolate()); | |
| 1677 } | |
| 1678 | |
| 1679 static v8::Handle<v8::Value> nullableBooleanAttributeAttrGetterCallback(v8::Loca
l<v8::String> name, const v8::AccessorInfo& info) | |
| 1680 { | |
| 1681 return TestObjV8Internal::nullableBooleanAttributeAttrGetter(name, info); | |
| 1682 } | |
| 1683 | |
| 1684 static v8::Handle<v8::Value> nullableStringAttributeAttrGetter(v8::Local<v8::Str
ing> name, const v8::AccessorInfo& info) | |
| 1685 { | |
| 1686 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1687 bool isNull = false; | |
| 1688 String v = imp->nullableStringAttribute(isNull); | |
| 1689 if (isNull) | |
| 1690 return v8Null(info.GetIsolate()); | |
| 1691 return v8String(v, info.GetIsolate(), ReturnUnsafeHandle); | |
| 1692 } | |
| 1693 | |
| 1694 static v8::Handle<v8::Value> nullableStringAttributeAttrGetterCallback(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 1695 { | |
| 1696 return TestObjV8Internal::nullableStringAttributeAttrGetter(name, info); | |
| 1697 } | |
| 1698 | |
| 1699 static v8::Handle<v8::Value> nullableLongSettableAttributeAttrGetter(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1700 { | |
| 1701 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1702 bool isNull = false; | |
| 1703 int v = imp->nullableLongSettableAttribute(isNull); | |
| 1704 if (isNull) | |
| 1705 return v8Null(info.GetIsolate()); | |
| 1706 return v8Integer(v, info.GetIsolate()); | |
| 1707 } | |
| 1708 | |
| 1709 static v8::Handle<v8::Value> nullableLongSettableAttributeAttrGetterCallback(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1710 { | |
| 1711 return TestObjV8Internal::nullableLongSettableAttributeAttrGetter(name, info
); | |
| 1712 } | |
| 1713 | |
| 1714 static void nullableLongSettableAttributeAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1715 { | |
| 1716 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1717 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1718 imp->setNullableLongSettableAttribute(v); | |
| 1719 return; | |
| 1720 } | |
| 1721 | |
| 1722 static void nullableLongSettableAttributeAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1723 { | |
| 1724 TestObjV8Internal::nullableLongSettableAttributeAttrSetter(name, value, info
); | |
| 1725 } | |
| 1726 | |
| 1727 static v8::Handle<v8::Value> nullableStringValueAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1728 { | |
| 1729 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1730 ExceptionCode ec = 0; | |
| 1731 bool isNull = false; | |
| 1732 int v = imp->nullableStringValue(isNull, ec); | |
| 1733 if (isNull) | |
| 1734 return v8Null(info.GetIsolate()); | |
| 1735 if (UNLIKELY(ec)) | |
| 1736 return setDOMException(ec, info.GetIsolate()); | |
| 1737 return v8Integer(v, info.GetIsolate()); | |
| 1738 } | |
| 1739 | |
| 1740 static v8::Handle<v8::Value> nullableStringValueAttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 1741 { | |
| 1742 return TestObjV8Internal::nullableStringValueAttrGetter(name, info); | |
| 1743 } | |
| 1744 | |
| 1745 static void nullableStringValueAttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1746 { | |
| 1747 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1748 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1749 imp->setNullableStringValue(v); | |
| 1750 return; | |
| 1751 } | |
| 1752 | |
| 1753 static void nullableStringValueAttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1754 { | |
| 1755 TestObjV8Internal::nullableStringValueAttrSetter(name, value, info); | |
| 1756 } | |
| 1757 | |
| 1758 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1759 { | |
| 1760 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1761 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | |
| 1762 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); | |
| 1763 if (wrapper.IsEmpty()) { | |
| 1764 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
| 1765 if (!wrapper.IsEmpty()) | |
| 1766 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor
ldReadOnlyAttribute", wrapper); | |
| 1767 } | |
| 1768 return wrapper; | |
| 1769 } | |
| 1770 | |
| 1771 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 1772 { | |
| 1773 return TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter(name, info); | |
| 1774 } | |
| 1775 | |
| 1776 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1777 { | |
| 1778 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1779 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); | |
| 1780 v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMData
Store::getWrapperForMainWorld(result.get())) : v8Undefined(); | |
| 1781 if (wrapper.IsEmpty()) { | |
| 1782 wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); | |
| 1783 if (!wrapper.IsEmpty()) | |
| 1784 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWor
ldReadOnlyAttribute", wrapper); | |
| 1785 } | |
| 1786 return wrapper; | |
| 1787 } | |
| 1788 | |
| 1789 static v8::Handle<v8::Value> perWorldReadOnlyAttributeAttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1790 { | |
| 1791 return TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterForMainWorld(na
me, info); | |
| 1792 } | |
| 1793 | |
| 1794 static v8::Handle<v8::Value> perWorldAttributeAttrGetter(v8::Local<v8::String> n
ame, const v8::AccessorInfo& info) | |
| 1795 { | |
| 1796 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1797 return toV8Fast(imp->perWorldAttribute(), info, imp); | |
| 1798 } | |
| 1799 | |
| 1800 static v8::Handle<v8::Value> perWorldAttributeAttrGetterCallback(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1801 { | |
| 1802 return TestObjV8Internal::perWorldAttributeAttrGetter(name, info); | |
| 1803 } | |
| 1804 | |
| 1805 static v8::Handle<v8::Value> perWorldAttributeAttrGetterForMainWorld(v8::Local<v
8::String> name, const v8::AccessorInfo& info) | |
| 1806 { | |
| 1807 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1808 return toV8FastForMainWorld(imp->perWorldAttribute(), info, imp); | |
| 1809 } | |
| 1810 | |
| 1811 static v8::Handle<v8::Value> perWorldAttributeAttrGetterCallbackForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1812 { | |
| 1813 return TestObjV8Internal::perWorldAttributeAttrGetterForMainWorld(name, info
); | |
| 1814 } | |
| 1815 | |
| 1816 static void perWorldAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8
::Value> value, const v8::AccessorInfo& info) | |
| 1817 { | |
| 1818 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1819 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1820 imp->setPerWorldAttribute(WTF::getPtr(v)); | |
| 1821 return; | |
| 1822 } | |
| 1823 | |
| 1824 static void perWorldAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1825 { | |
| 1826 TestObjV8Internal::perWorldAttributeAttrSetter(name, value, info); | |
| 1827 } | |
| 1828 | |
| 1829 static void perWorldAttributeAttrSetterForMainWorld(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1830 { | |
| 1831 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1832 V8TRYCATCH_VOID(TestObj*, v, V8TestObj::HasInstance(value, info.GetIsolate()
, worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Ca
st(value)) : 0); | |
| 1833 imp->setPerWorldAttribute(WTF::getPtr(v)); | |
| 1834 return; | |
| 1835 } | |
| 1836 | |
| 1837 static void perWorldAttributeAttrSetterCallbackForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1838 { | |
| 1839 TestObjV8Internal::perWorldAttributeAttrSetterForMainWorld(name, value, info
); | |
| 1840 } | |
| 1841 | |
| 1842 static v8::Handle<v8::Value> activityLoggedAttr1AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1843 { | |
| 1844 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1845 return v8Integer(imp->activityLoggedAttr1(), info.GetIsolate()); | |
| 1846 } | |
| 1847 | |
| 1848 static v8::Handle<v8::Value> activityLoggedAttr1AttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 1849 { | |
| 1850 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1851 if (contextData && contextData->activityLogger()) | |
| 1852 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0,
0, "Getter"); | |
| 1853 return TestObjV8Internal::activityLoggedAttr1AttrGetter(name, info); | |
| 1854 } | |
| 1855 | |
| 1856 static void activityLoggedAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1857 { | |
| 1858 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1859 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1860 imp->setActivityLoggedAttr1(v); | |
| 1861 return; | |
| 1862 } | |
| 1863 | |
| 1864 static void activityLoggedAttr1AttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1865 { | |
| 1866 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1867 if (contextData && contextData->activityLogger()) { | |
| 1868 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 1869 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1,
&loggerArg[0], "Setter"); | |
| 1870 } | |
| 1871 TestObjV8Internal::activityLoggedAttr1AttrSetter(name, value, info); | |
| 1872 } | |
| 1873 | |
| 1874 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) | |
| 1875 { | |
| 1876 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1877 return v8Integer(imp->activityLoggedAttr2(), info.GetIsolate()); | |
| 1878 } | |
| 1879 | |
| 1880 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetterCallback(v8::Local<v8:
:String> name, const v8::AccessorInfo& info) | |
| 1881 { | |
| 1882 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1883 if (contextData && contextData->activityLogger()) | |
| 1884 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); | |
| 1885 return TestObjV8Internal::activityLoggedAttr2AttrGetter(name, info); | |
| 1886 } | |
| 1887 | |
| 1888 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetterForMainWorld(v8::Local
<v8::String> name, const v8::AccessorInfo& info) | |
| 1889 { | |
| 1890 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1891 return v8Integer(imp->activityLoggedAttr2(), info.GetIsolate()); | |
| 1892 } | |
| 1893 | |
| 1894 static v8::Handle<v8::Value> activityLoggedAttr2AttrGetterCallbackForMainWorld(v
8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1895 { | |
| 1896 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1897 if (contextData && contextData->activityLogger()) | |
| 1898 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0,
0, "Getter"); | |
| 1899 return TestObjV8Internal::activityLoggedAttr2AttrGetterForMainWorld(name, in
fo); | |
| 1900 } | |
| 1901 | |
| 1902 static void activityLoggedAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::AccessorInfo& info) | |
| 1903 { | |
| 1904 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1905 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1906 imp->setActivityLoggedAttr2(v); | |
| 1907 return; | |
| 1908 } | |
| 1909 | |
| 1910 static void activityLoggedAttr2AttrSetterCallback(v8::Local<v8::String> name, v8
::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1911 { | |
| 1912 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1913 if (contextData && contextData->activityLogger()) { | |
| 1914 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 1915 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); | |
| 1916 } | |
| 1917 TestObjV8Internal::activityLoggedAttr2AttrSetter(name, value, info); | |
| 1918 } | |
| 1919 | |
| 1920 static void activityLoggedAttr2AttrSetterForMainWorld(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1921 { | |
| 1922 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1923 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1924 imp->setActivityLoggedAttr2(v); | |
| 1925 return; | |
| 1926 } | |
| 1927 | |
| 1928 static void activityLoggedAttr2AttrSetterCallbackForMainWorld(v8::Local<v8::Stri
ng> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1929 { | |
| 1930 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1931 if (contextData && contextData->activityLogger()) { | |
| 1932 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 1933 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1,
&loggerArg[0], "Setter"); | |
| 1934 } | |
| 1935 TestObjV8Internal::activityLoggedAttr2AttrSetterForMainWorld(name, value, in
fo); | |
| 1936 } | |
| 1937 | |
| 1938 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetter(v8::Lo
cal<v8::String> name, const v8::AccessorInfo& info) | |
| 1939 { | |
| 1940 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1941 return v8Integer(imp->activityLoggedInIsolatedWorldsAttr(), info.GetIsolate(
)); | |
| 1942 } | |
| 1943 | |
| 1944 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetterCallbac
k(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1945 { | |
| 1946 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1947 if (contextData && contextData->activityLogger()) | |
| 1948 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 0, 0, "Getter"); | |
| 1949 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrGetter(name,
info); | |
| 1950 } | |
| 1951 | |
| 1952 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetterForMain
World(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1953 { | |
| 1954 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1955 return v8Integer(imp->activityLoggedInIsolatedWorldsAttr(), info.GetIsolate(
)); | |
| 1956 } | |
| 1957 | |
| 1958 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrAttrGetterCallbac
kForMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 1959 { | |
| 1960 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrGetterForMai
nWorld(name, info); | |
| 1961 } | |
| 1962 | |
| 1963 static void activityLoggedInIsolatedWorldsAttrAttrSetter(v8::Local<v8::String> n
ame, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1964 { | |
| 1965 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1966 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1967 imp->setActivityLoggedInIsolatedWorldsAttr(v); | |
| 1968 return; | |
| 1969 } | |
| 1970 | |
| 1971 static void activityLoggedInIsolatedWorldsAttrAttrSetterCallback(v8::Local<v8::S
tring> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1972 { | |
| 1973 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 1974 if (contextData && contextData->activityLogger()) { | |
| 1975 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 1976 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttr", 1, &loggerArg[0], "Setter"); | |
| 1977 } | |
| 1978 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrSetter(name, value,
info); | |
| 1979 } | |
| 1980 | |
| 1981 static void activityLoggedInIsolatedWorldsAttrAttrSetterForMainWorld(v8::Local<v
8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 1982 { | |
| 1983 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1984 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 1985 imp->setActivityLoggedInIsolatedWorldsAttr(v); | |
| 1986 return; | |
| 1987 } | |
| 1988 | |
| 1989 static void activityLoggedInIsolatedWorldsAttrAttrSetterCallbackForMainWorld(v8:
:Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& inf
o) | |
| 1990 { | |
| 1991 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttrSetterForMainWorld(
name, value, info); | |
| 1992 } | |
| 1993 | |
| 1994 static v8::Handle<v8::Value> activityLoggedAttrSetter1AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 1995 { | |
| 1996 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 1997 return v8Integer(imp->activityLoggedAttrSetter1(), info.GetIsolate()); | |
| 1998 } | |
| 1999 | |
| 2000 static v8::Handle<v8::Value> activityLoggedAttrSetter1AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 2001 { | |
| 2002 return TestObjV8Internal::activityLoggedAttrSetter1AttrGetter(name, info); | |
| 2003 } | |
| 2004 | |
| 2005 static void activityLoggedAttrSetter1AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2006 { | |
| 2007 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2008 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2009 imp->setActivityLoggedAttrSetter1(v); | |
| 2010 return; | |
| 2011 } | |
| 2012 | |
| 2013 static void activityLoggedAttrSetter1AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2014 { | |
| 2015 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2016 if (contextData && contextData->activityLogger()) { | |
| 2017 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 2018 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1
", 1, &loggerArg[0], "Setter"); | |
| 2019 } | |
| 2020 TestObjV8Internal::activityLoggedAttrSetter1AttrSetter(name, value, info); | |
| 2021 } | |
| 2022 | |
| 2023 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 2024 { | |
| 2025 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2026 return v8Integer(imp->activityLoggedAttrSetter2(), info.GetIsolate()); | |
| 2027 } | |
| 2028 | |
| 2029 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 2030 { | |
| 2031 return TestObjV8Internal::activityLoggedAttrSetter2AttrGetter(name, info); | |
| 2032 } | |
| 2033 | |
| 2034 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2035 { | |
| 2036 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2037 return v8Integer(imp->activityLoggedAttrSetter2(), info.GetIsolate()); | |
| 2038 } | |
| 2039 | |
| 2040 static v8::Handle<v8::Value> activityLoggedAttrSetter2AttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2041 { | |
| 2042 return TestObjV8Internal::activityLoggedAttrSetter2AttrGetterForMainWorld(na
me, info); | |
| 2043 } | |
| 2044 | |
| 2045 static void activityLoggedAttrSetter2AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2046 { | |
| 2047 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2048 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2049 imp->setActivityLoggedAttrSetter2(v); | |
| 2050 return; | |
| 2051 } | |
| 2052 | |
| 2053 static void activityLoggedAttrSetter2AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2054 { | |
| 2055 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2056 if (contextData && contextData->activityLogger()) { | |
| 2057 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 2058 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); | |
| 2059 } | |
| 2060 TestObjV8Internal::activityLoggedAttrSetter2AttrSetter(name, value, info); | |
| 2061 } | |
| 2062 | |
| 2063 static void activityLoggedAttrSetter2AttrSetterForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2064 { | |
| 2065 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2066 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2067 imp->setActivityLoggedAttrSetter2(v); | |
| 2068 return; | |
| 2069 } | |
| 2070 | |
| 2071 static void activityLoggedAttrSetter2AttrSetterCallbackForMainWorld(v8::Local<v8
::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2072 { | |
| 2073 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2074 if (contextData && contextData->activityLogger()) { | |
| 2075 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 2076 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2
", 1, &loggerArg[0], "Setter"); | |
| 2077 } | |
| 2078 TestObjV8Internal::activityLoggedAttrSetter2AttrSetterForMainWorld(name, val
ue, info); | |
| 2079 } | |
| 2080 | |
| 2081 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetter(
v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2082 { | |
| 2083 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2084 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrSetter(), info.GetIs
olate()); | |
| 2085 } | |
| 2086 | |
| 2087 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetterC
allback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2088 { | |
| 2089 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrGetter
(name, info); | |
| 2090 } | |
| 2091 | |
| 2092 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetterF
orMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2093 { | |
| 2094 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2095 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrSetter(), info.GetIs
olate()); | |
| 2096 } | |
| 2097 | |
| 2098 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrSetterAttrGetterC
allbackForMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2099 { | |
| 2100 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrGetter
ForMainWorld(name, info); | |
| 2101 } | |
| 2102 | |
| 2103 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetter(v8::Local<v8::Str
ing> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2104 { | |
| 2105 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2106 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2107 imp->setActivityLoggedInIsolatedWorldsAttrSetter(v); | |
| 2108 return; | |
| 2109 } | |
| 2110 | |
| 2111 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetterCallback(v8::Local
<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2112 { | |
| 2113 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2114 if (contextData && contextData->activityLogger()) { | |
| 2115 v8::Handle<v8::Value> loggerArg[] = { value }; | |
| 2116 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrSetter", 1, &loggerArg[0], "Setter"); | |
| 2117 } | |
| 2118 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrSetter(name,
value, info); | |
| 2119 } | |
| 2120 | |
| 2121 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetterForMainWorld(v8::L
ocal<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2122 { | |
| 2123 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2124 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2125 imp->setActivityLoggedInIsolatedWorldsAttrSetter(v); | |
| 2126 return; | |
| 2127 } | |
| 2128 | |
| 2129 static void activityLoggedInIsolatedWorldsAttrSetterAttrSetterCallbackForMainWor
ld(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInf
o& info) | |
| 2130 { | |
| 2131 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttrSetterForMain
World(name, value, info); | |
| 2132 } | |
| 2133 | |
| 2134 static v8::Handle<v8::Value> activityLoggedAttrGetter1AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 2135 { | |
| 2136 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2137 return v8Integer(imp->activityLoggedAttrGetter1(), info.GetIsolate()); | |
| 2138 } | |
| 2139 | |
| 2140 static v8::Handle<v8::Value> activityLoggedAttrGetter1AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 2141 { | |
| 2142 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2143 if (contextData && contextData->activityLogger()) | |
| 2144 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1
", 0, 0, "Getter"); | |
| 2145 return TestObjV8Internal::activityLoggedAttrGetter1AttrGetter(name, info); | |
| 2146 } | |
| 2147 | |
| 2148 static void activityLoggedAttrGetter1AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2149 { | |
| 2150 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2151 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2152 imp->setActivityLoggedAttrGetter1(v); | |
| 2153 return; | |
| 2154 } | |
| 2155 | |
| 2156 static void activityLoggedAttrGetter1AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2157 { | |
| 2158 TestObjV8Internal::activityLoggedAttrGetter1AttrSetter(name, value, info); | |
| 2159 } | |
| 2160 | |
| 2161 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetter(v8::Local<v8::S
tring> name, const v8::AccessorInfo& info) | |
| 2162 { | |
| 2163 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2164 return v8Integer(imp->activityLoggedAttrGetter2(), info.GetIsolate()); | |
| 2165 } | |
| 2166 | |
| 2167 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetterCallback(v8::Loc
al<v8::String> name, const v8::AccessorInfo& info) | |
| 2168 { | |
| 2169 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2170 if (contextData && contextData->activityLogger()) | |
| 2171 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); | |
| 2172 return TestObjV8Internal::activityLoggedAttrGetter2AttrGetter(name, info); | |
| 2173 } | |
| 2174 | |
| 2175 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetterForMainWorld(v8:
:Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2176 { | |
| 2177 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2178 return v8Integer(imp->activityLoggedAttrGetter2(), info.GetIsolate()); | |
| 2179 } | |
| 2180 | |
| 2181 static v8::Handle<v8::Value> activityLoggedAttrGetter2AttrGetterCallbackForMainW
orld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2182 { | |
| 2183 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2184 if (contextData && contextData->activityLogger()) | |
| 2185 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2
", 0, 0, "Getter"); | |
| 2186 return TestObjV8Internal::activityLoggedAttrGetter2AttrGetterForMainWorld(na
me, info); | |
| 2187 } | |
| 2188 | |
| 2189 static void activityLoggedAttrGetter2AttrSetter(v8::Local<v8::String> name, v8::
Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2190 { | |
| 2191 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2192 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2193 imp->setActivityLoggedAttrGetter2(v); | |
| 2194 return; | |
| 2195 } | |
| 2196 | |
| 2197 static void activityLoggedAttrGetter2AttrSetterCallback(v8::Local<v8::String> na
me, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2198 { | |
| 2199 TestObjV8Internal::activityLoggedAttrGetter2AttrSetter(name, value, info); | |
| 2200 } | |
| 2201 | |
| 2202 static void activityLoggedAttrGetter2AttrSetterForMainWorld(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2203 { | |
| 2204 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2205 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2206 imp->setActivityLoggedAttrGetter2(v); | |
| 2207 return; | |
| 2208 } | |
| 2209 | |
| 2210 static void activityLoggedAttrGetter2AttrSetterCallbackForMainWorld(v8::Local<v8
::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2211 { | |
| 2212 TestObjV8Internal::activityLoggedAttrGetter2AttrSetterForMainWorld(name, val
ue, info); | |
| 2213 } | |
| 2214 | |
| 2215 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetter(
v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2216 { | |
| 2217 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2218 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrGetter(), info.GetIs
olate()); | |
| 2219 } | |
| 2220 | |
| 2221 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetterC
allback(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2222 { | |
| 2223 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | |
| 2224 if (contextData && contextData->activityLogger()) | |
| 2225 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldsAttrGetter", 0, 0, "Getter"); | |
| 2226 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrGetter
(name, info); | |
| 2227 } | |
| 2228 | |
| 2229 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetterF
orMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2230 { | |
| 2231 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2232 return v8Integer(imp->activityLoggedInIsolatedWorldsAttrGetter(), info.GetIs
olate()); | |
| 2233 } | |
| 2234 | |
| 2235 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldsAttrGetterAttrGetterC
allbackForMainWorld(v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2236 { | |
| 2237 return TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrGetter
ForMainWorld(name, info); | |
| 2238 } | |
| 2239 | |
| 2240 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetter(v8::Local<v8::Str
ing> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2241 { | |
| 2242 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2243 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2244 imp->setActivityLoggedInIsolatedWorldsAttrGetter(v); | |
| 2245 return; | |
| 2246 } | |
| 2247 | |
| 2248 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetterCallback(v8::Local
<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2249 { | |
| 2250 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrSetter(name,
value, info); | |
| 2251 } | |
| 2252 | |
| 2253 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetterForMainWorld(v8::L
ocal<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2254 { | |
| 2255 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2256 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2257 imp->setActivityLoggedInIsolatedWorldsAttrGetter(v); | |
| 2258 return; | |
| 2259 } | |
| 2260 | |
| 2261 static void activityLoggedInIsolatedWorldsAttrGetterAttrSetterCallbackForMainWor
ld(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInf
o& info) | |
| 2262 { | |
| 2263 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttrSetterForMain
World(name, value, info); | |
| 2264 } | |
| 2265 | |
| 2266 static v8::Handle<v8::Value> deprecatedStaticReadOnlyAttrAttrGetter(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 2267 { | |
| 2268 return v8Integer(TestObj::deprecatedStaticReadOnlyAttr(), info.GetIsolate())
; | |
| 2269 } | |
| 2270 | |
| 2271 static v8::Handle<v8::Value> deprecatedStaticReadOnlyAttrAttrGetterCallback(v8::
Local<v8::String> name, const v8::AccessorInfo& info) | |
| 2272 { | |
| 2273 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticReadonlyAt
tribute); | |
| 2274 return TestObjV8Internal::deprecatedStaticReadOnlyAttrAttrGetter(name, info)
; | |
| 2275 } | |
| 2276 | |
| 2277 static v8::Handle<v8::Value> deprecatedStaticAttrAttrGetter(v8::Local<v8::String
> name, const v8::AccessorInfo& info) | |
| 2278 { | |
| 2279 return v8Integer(TestObj::deprecatedStaticAttr(), info.GetIsolate()); | |
| 2280 } | |
| 2281 | |
| 2282 static v8::Handle<v8::Value> deprecatedStaticAttrAttrGetterCallback(v8::Local<v8
::String> name, const v8::AccessorInfo& info) | |
| 2283 { | |
| 2284 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticAttribute)
; | |
| 2285 return TestObjV8Internal::deprecatedStaticAttrAttrGetter(name, info); | |
| 2286 } | |
| 2287 | |
| 2288 static void deprecatedStaticAttrAttrSetter(v8::Local<v8::String> name, v8::Local
<v8::Value> value, const v8::AccessorInfo& info) | |
| 2289 { | |
| 2290 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2291 TestObj::setDeprecatedStaticAttr(v); | |
| 2292 return; | |
| 2293 } | |
| 2294 | |
| 2295 static void deprecatedStaticAttrAttrSetterCallback(v8::Local<v8::String> name, v
8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2296 { | |
| 2297 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticAttribute)
; | |
| 2298 TestObjV8Internal::deprecatedStaticAttrAttrSetter(name, value, info); | |
| 2299 } | |
| 2300 | |
| 2301 static v8::Handle<v8::Value> deprecatedReadonlyAttrAttrGetter(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 2302 { | |
| 2303 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2304 return v8Integer(imp->deprecatedReadonlyAttr(), info.GetIsolate()); | |
| 2305 } | |
| 2306 | |
| 2307 static v8::Handle<v8::Value> deprecatedReadonlyAttrAttrGetterCallback(v8::Local<
v8::String> name, const v8::AccessorInfo& info) | |
| 2308 { | |
| 2309 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::ReadonlyAttribut
e); | |
| 2310 return TestObjV8Internal::deprecatedReadonlyAttrAttrGetter(name, info); | |
| 2311 } | |
| 2312 | |
| 2313 static v8::Handle<v8::Value> deprecatedAttrAttrGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 2314 { | |
| 2315 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2316 return v8Integer(imp->deprecatedAttr(), info.GetIsolate()); | |
| 2317 } | |
| 2318 | |
| 2319 static v8::Handle<v8::Value> deprecatedAttrAttrGetterCallback(v8::Local<v8::Stri
ng> name, const v8::AccessorInfo& info) | |
| 2320 { | |
| 2321 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::Attribute); | |
| 2322 return TestObjV8Internal::deprecatedAttrAttrGetter(name, info); | |
| 2323 } | |
| 2324 | |
| 2325 static void deprecatedAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::V
alue> value, const v8::AccessorInfo& info) | |
| 2326 { | |
| 2327 TestObj* imp = V8TestObj::toNative(info.Holder()); | |
| 2328 V8TRYCATCH_VOID(int, v, toInt32(value)); | |
| 2329 imp->setDeprecatedAttr(v); | |
| 2330 return; | |
| 2331 } | |
| 2332 | |
| 2333 static void deprecatedAttrAttrSetterCallback(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::AccessorInfo& info) | |
| 2334 { | |
| 2335 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::Attribute); | |
| 2336 TestObjV8Internal::deprecatedAttrAttrSetter(name, value, info); | |
| 2337 } | |
| 2338 | |
| 2339 static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name
, const v8::AccessorInfo& info) | |
| 2340 { | |
| 2341 v8::Handle<v8::Value> data = info.Data(); | |
| 2342 ASSERT(data->IsExternal()); | |
| 2343 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | |
| 2344 if (!perContextData) | |
| 2345 return v8Undefined(); | |
| 2346 return perContextData->constructorForType(WrapperTypeInfo::unwrap(data)); | |
| 2347 } | |
| 2348 static void TestObjReplaceableAttrSetter(v8::Local<v8::String> name, v8::Local<v
8::Value> value, const v8::AccessorInfo& info) | |
| 2349 { | |
| 2350 info.This()->ForceSet(name, value); | |
| 2351 } | |
| 2352 | |
| 2353 static void TestObjReplaceableAttrSetterCallback(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 2354 { | |
| 2355 return TestObjV8Internal::TestObjReplaceableAttrSetter(name, value, info); | |
| 2356 } | |
| 2357 | |
| 2358 static v8::Handle<v8::Value> voidMethodMethod(const v8::Arguments& args) | |
| 2359 { | |
| 2360 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2361 imp->voidMethod(); | |
| 2362 return v8Undefined(); | |
| 2363 } | |
| 2364 | |
| 2365 static v8::Handle<v8::Value> voidMethodMethodCallback(const v8::Arguments& args) | |
| 2366 { | |
| 2367 return TestObjV8Internal::voidMethodMethod(args); | |
| 2368 } | |
| 2369 | |
| 2370 static v8::Handle<v8::Value> voidMethodWithArgsMethod(const v8::Arguments& args) | |
| 2371 { | |
| 2372 if (args.Length() < 3) | |
| 2373 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2374 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2375 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2376 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 2377 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
| 2378 imp->voidMethodWithArgs(longArg, strArg, objArg); | |
| 2379 return v8Undefined(); | |
| 2380 } | |
| 2381 | |
| 2382 static v8::Handle<v8::Value> voidMethodWithArgsMethodCallback(const v8::Argument
s& args) | |
| 2383 { | |
| 2384 return TestObjV8Internal::voidMethodWithArgsMethod(args); | |
| 2385 } | |
| 2386 | |
| 2387 static v8::Handle<v8::Value> longMethodMethod(const v8::Arguments& args) | |
| 2388 { | |
| 2389 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2390 return v8Integer(imp->longMethod(), args.GetIsolate()); | |
| 2391 } | |
| 2392 | |
| 2393 static v8::Handle<v8::Value> longMethodMethodCallback(const v8::Arguments& args) | |
| 2394 { | |
| 2395 return TestObjV8Internal::longMethodMethod(args); | |
| 2396 } | |
| 2397 | |
| 2398 static v8::Handle<v8::Value> longMethodWithArgsMethod(const v8::Arguments& args) | |
| 2399 { | |
| 2400 if (args.Length() < 3) | |
| 2401 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2402 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2403 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2404 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 2405 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
| 2406 return v8Integer(imp->longMethodWithArgs(longArg, strArg, objArg), args.GetI
solate()); | |
| 2407 } | |
| 2408 | |
| 2409 static v8::Handle<v8::Value> longMethodWithArgsMethodCallback(const v8::Argument
s& args) | |
| 2410 { | |
| 2411 return TestObjV8Internal::longMethodWithArgsMethod(args); | |
| 2412 } | |
| 2413 | |
| 2414 static v8::Handle<v8::Value> objMethodMethod(const v8::Arguments& args) | |
| 2415 { | |
| 2416 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2417 return toV8(imp->objMethod(), args.Holder(), args.GetIsolate()); | |
| 2418 } | |
| 2419 | |
| 2420 static v8::Handle<v8::Value> objMethodMethodCallback(const v8::Arguments& args) | |
| 2421 { | |
| 2422 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | |
| 2423 return TestObjV8Internal::objMethodMethod(args); | |
| 2424 } | |
| 2425 | |
| 2426 static v8::Handle<v8::Value> objMethodWithArgsMethod(const v8::Arguments& args) | |
| 2427 { | |
| 2428 if (args.Length() < 3) | |
| 2429 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2430 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2431 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2432 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 2433 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[2])) : 0); | |
| 2434 return toV8(imp->objMethodWithArgs(longArg, strArg, objArg), args.Holder(),
args.GetIsolate()); | |
| 2435 } | |
| 2436 | |
| 2437 static v8::Handle<v8::Value> objMethodWithArgsMethodCallback(const v8::Arguments
& args) | |
| 2438 { | |
| 2439 return TestObjV8Internal::objMethodWithArgsMethod(args); | |
| 2440 } | |
| 2441 | |
| 2442 static v8::Handle<v8::Value> methodWithSequenceArgMethod(const v8::Arguments& ar
gs) | |
| 2443 { | |
| 2444 if (args.Length() < 1) | |
| 2445 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2446 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2447 V8TRYCATCH(Vector<RefPtr<ScriptProfile> >, sequenceArg, (toRefPtrNativeArray
<ScriptProfile, V8ScriptProfile>(args[0], args.GetIsolate()))); | |
| 2448 imp->methodWithSequenceArg(sequenceArg); | |
| 2449 return v8Undefined(); | |
| 2450 } | |
| 2451 | |
| 2452 static v8::Handle<v8::Value> methodWithSequenceArgMethodCallback(const v8::Argum
ents& args) | |
| 2453 { | |
| 2454 return TestObjV8Internal::methodWithSequenceArgMethod(args); | |
| 2455 } | |
| 2456 | |
| 2457 static v8::Handle<v8::Value> methodReturningSequenceMethod(const v8::Arguments&
args) | |
| 2458 { | |
| 2459 if (args.Length() < 1) | |
| 2460 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2461 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2462 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 2463 return v8Array(imp->methodReturningSequence(longArg), args.GetIsolate()); | |
| 2464 } | |
| 2465 | |
| 2466 static v8::Handle<v8::Value> methodReturningSequenceMethodCallback(const v8::Arg
uments& args) | |
| 2467 { | |
| 2468 return TestObjV8Internal::methodReturningSequenceMethod(args); | |
| 2469 } | |
| 2470 | |
| 2471 static v8::Handle<v8::Value> methodWithEnumArgMethod(const v8::Arguments& args) | |
| 2472 { | |
| 2473 if (args.Length() < 1) | |
| 2474 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2475 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2476 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, enumArg, args[0]); | |
| 2477 String string = enumArg; | |
| 2478 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) | |
| 2479 return throwTypeError(0, args.GetIsolate()); | |
| 2480 imp->methodWithEnumArg(enumArg); | |
| 2481 return v8Undefined(); | |
| 2482 } | |
| 2483 | |
| 2484 static v8::Handle<v8::Value> methodWithEnumArgMethodCallback(const v8::Arguments
& args) | |
| 2485 { | |
| 2486 return TestObjV8Internal::methodWithEnumArgMethod(args); | |
| 2487 } | |
| 2488 | |
| 2489 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsMethod(const v8::
Arguments& args) | |
| 2490 { | |
| 2491 if (args.Length() < 2) | |
| 2492 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2493 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2494 ExceptionCode ec = 0; | |
| 2495 { | |
| 2496 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 2497 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[1])) : 0); | |
| 2498 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, ec); | |
| 2499 if (UNLIKELY(ec)) | |
| 2500 goto fail; | |
| 2501 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2502 } | |
| 2503 fail: | |
| 2504 return setDOMException(ec, args.GetIsolate()); | |
| 2505 } | |
| 2506 | |
| 2507 static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsMethodCallback(co
nst v8::Arguments& args) | |
| 2508 { | |
| 2509 return TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(args); | |
| 2510 } | |
| 2511 | |
| 2512 static v8::Handle<v8::Value> serializedValueMethod(const v8::Arguments& args) | |
| 2513 { | |
| 2514 if (args.Length() < 1) | |
| 2515 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2516 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2517 bool serializedArgDidThrow = false; | |
| 2518 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
args[0], 0, 0, serializedArgDidThrow, args.GetIsolate()); | |
| 2519 if (serializedArgDidThrow) | |
| 2520 return v8Undefined(); | |
| 2521 imp->serializedValue(serializedArg); | |
| 2522 return v8Undefined(); | |
| 2523 } | |
| 2524 | |
| 2525 static v8::Handle<v8::Value> serializedValueMethodCallback(const v8::Arguments&
args) | |
| 2526 { | |
| 2527 return TestObjV8Internal::serializedValueMethod(args); | |
| 2528 } | |
| 2529 | |
| 2530 static v8::Handle<v8::Value> optionsObjectMethod(const v8::Arguments& args) | |
| 2531 { | |
| 2532 if (args.Length() < 1) | |
| 2533 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2534 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2535 V8TRYCATCH(Dictionary, oo, Dictionary(args[0], args.GetIsolate())); | |
| 2536 if (!oo.isUndefinedOrNull() && !oo.isObject()) | |
| 2537 return throwTypeError("Not an object.", args.GetIsolate()); | |
| 2538 V8TRYCATCH(Dictionary, ooo, Dictionary(args[1], args.GetIsolate())); | |
| 2539 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) | |
| 2540 return throwTypeError("Not an object.", args.GetIsolate()); | |
| 2541 imp->optionsObject(oo, ooo); | |
| 2542 return v8Undefined(); | |
| 2543 } | |
| 2544 | |
| 2545 static v8::Handle<v8::Value> optionsObjectMethodCallback(const v8::Arguments& ar
gs) | |
| 2546 { | |
| 2547 return TestObjV8Internal::optionsObjectMethod(args); | |
| 2548 } | |
| 2549 | |
| 2550 static v8::Handle<v8::Value> namedItemMethod(const v8::Arguments& args) | |
| 2551 { | |
| 2552 if (args.Length() < 1) | |
| 2553 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2554 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2555 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, args[0]); | |
| 2556 return v8String(imp->namedItem(name), args.GetIsolate(), ReturnUnsafeHandle)
; | |
| 2557 } | |
| 2558 | |
| 2559 static v8::Handle<v8::Value> namedItemMethodCallback(const v8::Arguments& args) | |
| 2560 { | |
| 2561 return TestObjV8Internal::namedItemMethod(args); | |
| 2562 } | |
| 2563 | |
| 2564 static v8::Handle<v8::Value> methodWithExceptionMethod(const v8::Arguments& args
) | |
| 2565 { | |
| 2566 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2567 ExceptionCode ec = 0; | |
| 2568 { | |
| 2569 imp->methodWithException(ec); | |
| 2570 if (UNLIKELY(ec)) | |
| 2571 goto fail; | |
| 2572 return v8Undefined(); | |
| 2573 } | |
| 2574 fail: | |
| 2575 return setDOMException(ec, args.GetIsolate()); | |
| 2576 } | |
| 2577 | |
| 2578 static v8::Handle<v8::Value> methodWithExceptionMethodCallback(const v8::Argumen
ts& args) | |
| 2579 { | |
| 2580 return TestObjV8Internal::methodWithExceptionMethod(args); | |
| 2581 } | |
| 2582 | |
| 2583 static v8::Handle<v8::Value> customMethodMethodCallback(const v8::Arguments& arg
s) | |
| 2584 { | |
| 2585 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); | |
| 2586 return V8TestObj::customMethodMethodCustom(args); | |
| 2587 } | |
| 2588 | |
| 2589 static v8::Handle<v8::Value> customMethodWithArgsMethodCallback(const v8::Argume
nts& args) | |
| 2590 { | |
| 2591 return V8TestObj::customMethodWithArgsMethodCustom(args); | |
| 2592 } | |
| 2593 | |
| 2594 static v8::Handle<v8::Value> addEventListenerMethod(const v8::Arguments& args) | |
| 2595 { | |
| 2596 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOrCreate); | |
| 2597 if (listener) { | |
| 2598 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | |
| 2599 V8TestObj::toNative(args.Holder())->addEventListener(stringResource, lis
tener, args[2]->BooleanValue()); | |
| 2600 createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerC
acheIndex, args.GetIsolate()); | |
| 2601 } | |
| 2602 return v8Undefined(); | |
| 2603 } | |
| 2604 | |
| 2605 static v8::Handle<v8::Value> addEventListenerMethodCallback(const v8::Arguments&
args) | |
| 2606 { | |
| 2607 return TestObjV8Internal::addEventListenerMethod(args); | |
| 2608 } | |
| 2609 | |
| 2610 static v8::Handle<v8::Value> removeEventListenerMethod(const v8::Arguments& args
) | |
| 2611 { | |
| 2612 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[
1], false, ListenerFindOnly); | |
| 2613 if (listener) { | |
| 2614 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithNullCheck>, stringR
esource, args[0]); | |
| 2615 V8TestObj::toNative(args.Holder())->removeEventListener(stringResource,
listener.get(), args[2]->BooleanValue()); | |
| 2616 removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerC
acheIndex, args.GetIsolate()); | |
| 2617 } | |
| 2618 return v8Undefined(); | |
| 2619 } | |
| 2620 | |
| 2621 static v8::Handle<v8::Value> removeEventListenerMethodCallback(const v8::Argumen
ts& args) | |
| 2622 { | |
| 2623 return TestObjV8Internal::removeEventListenerMethod(args); | |
| 2624 } | |
| 2625 | |
| 2626 static v8::Handle<v8::Value> withScriptStateVoidMethod(const v8::Arguments& args
) | |
| 2627 { | |
| 2628 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2629 ScriptState* currentState = ScriptState::current(); | |
| 2630 if (!currentState) | |
| 2631 return v8Undefined(); | |
| 2632 ScriptState& state = *currentState; | |
| 2633 imp->withScriptStateVoid(&state); | |
| 2634 if (state.hadException()) { | |
| 2635 v8::Local<v8::Value> exception = state.exception(); | |
| 2636 state.clearException(); | |
| 2637 return throwError(exception, args.GetIsolate()); | |
| 2638 } | |
| 2639 return v8Undefined(); | |
| 2640 } | |
| 2641 | |
| 2642 static v8::Handle<v8::Value> withScriptStateVoidMethodCallback(const v8::Argumen
ts& args) | |
| 2643 { | |
| 2644 return TestObjV8Internal::withScriptStateVoidMethod(args); | |
| 2645 } | |
| 2646 | |
| 2647 static v8::Handle<v8::Value> withScriptStateObjMethod(const v8::Arguments& args) | |
| 2648 { | |
| 2649 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2650 ScriptState* currentState = ScriptState::current(); | |
| 2651 if (!currentState) | |
| 2652 return v8Undefined(); | |
| 2653 ScriptState& state = *currentState; | |
| 2654 RefPtr<TestObj> result = imp->withScriptStateObj(&state); | |
| 2655 if (state.hadException()) { | |
| 2656 v8::Local<v8::Value> exception = state.exception(); | |
| 2657 state.clearException(); | |
| 2658 return throwError(exception, args.GetIsolate()); | |
| 2659 } | |
| 2660 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2661 } | |
| 2662 | |
| 2663 static v8::Handle<v8::Value> withScriptStateObjMethodCallback(const v8::Argument
s& args) | |
| 2664 { | |
| 2665 return TestObjV8Internal::withScriptStateObjMethod(args); | |
| 2666 } | |
| 2667 | |
| 2668 static v8::Handle<v8::Value> withScriptStateVoidExceptionMethod(const v8::Argume
nts& args) | |
| 2669 { | |
| 2670 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2671 ExceptionCode ec = 0; | |
| 2672 { | |
| 2673 ScriptState* currentState = ScriptState::current(); | |
| 2674 if (!currentState) | |
| 2675 return v8Undefined(); | |
| 2676 ScriptState& state = *currentState; | |
| 2677 imp->withScriptStateVoidException(&state, ec); | |
| 2678 if (UNLIKELY(ec)) | |
| 2679 goto fail; | |
| 2680 if (state.hadException()) { | |
| 2681 v8::Local<v8::Value> exception = state.exception(); | |
| 2682 state.clearException(); | |
| 2683 return throwError(exception, args.GetIsolate()); | |
| 2684 } | |
| 2685 return v8Undefined(); | |
| 2686 } | |
| 2687 fail: | |
| 2688 return setDOMException(ec, args.GetIsolate()); | |
| 2689 } | |
| 2690 | |
| 2691 static v8::Handle<v8::Value> withScriptStateVoidExceptionMethodCallback(const v8
::Arguments& args) | |
| 2692 { | |
| 2693 return TestObjV8Internal::withScriptStateVoidExceptionMethod(args); | |
| 2694 } | |
| 2695 | |
| 2696 static v8::Handle<v8::Value> withScriptStateObjExceptionMethod(const v8::Argumen
ts& args) | |
| 2697 { | |
| 2698 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2699 ExceptionCode ec = 0; | |
| 2700 { | |
| 2701 ScriptState* currentState = ScriptState::current(); | |
| 2702 if (!currentState) | |
| 2703 return v8Undefined(); | |
| 2704 ScriptState& state = *currentState; | |
| 2705 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, ec); | |
| 2706 if (UNLIKELY(ec)) | |
| 2707 goto fail; | |
| 2708 if (state.hadException()) { | |
| 2709 v8::Local<v8::Value> exception = state.exception(); | |
| 2710 state.clearException(); | |
| 2711 return throwError(exception, args.GetIsolate()); | |
| 2712 } | |
| 2713 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2714 } | |
| 2715 fail: | |
| 2716 return setDOMException(ec, args.GetIsolate()); | |
| 2717 } | |
| 2718 | |
| 2719 static v8::Handle<v8::Value> withScriptStateObjExceptionMethodCallback(const v8:
:Arguments& args) | |
| 2720 { | |
| 2721 return TestObjV8Internal::withScriptStateObjExceptionMethod(args); | |
| 2722 } | |
| 2723 | |
| 2724 static v8::Handle<v8::Value> withScriptExecutionContextMethod(const v8::Argument
s& args) | |
| 2725 { | |
| 2726 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2727 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2728 imp->withScriptExecutionContext(scriptContext); | |
| 2729 return v8Undefined(); | |
| 2730 } | |
| 2731 | |
| 2732 static v8::Handle<v8::Value> withScriptExecutionContextMethodCallback(const v8::
Arguments& args) | |
| 2733 { | |
| 2734 return TestObjV8Internal::withScriptExecutionContextMethod(args); | |
| 2735 } | |
| 2736 | |
| 2737 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateMethod(cons
t v8::Arguments& args) | |
| 2738 { | |
| 2739 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2740 ScriptState* currentState = ScriptState::current(); | |
| 2741 if (!currentState) | |
| 2742 return v8Undefined(); | |
| 2743 ScriptState& state = *currentState; | |
| 2744 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2745 imp->withScriptExecutionContextAndScriptState(&state, scriptContext); | |
| 2746 if (state.hadException()) { | |
| 2747 v8::Local<v8::Value> exception = state.exception(); | |
| 2748 state.clearException(); | |
| 2749 return throwError(exception, args.GetIsolate()); | |
| 2750 } | |
| 2751 return v8Undefined(); | |
| 2752 } | |
| 2753 | |
| 2754 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateMethodCallb
ack(const v8::Arguments& args) | |
| 2755 { | |
| 2756 return TestObjV8Internal::withScriptExecutionContextAndScriptStateMethod(arg
s); | |
| 2757 } | |
| 2758 | |
| 2759 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
nMethod(const v8::Arguments& args) | |
| 2760 { | |
| 2761 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2762 ExceptionCode ec = 0; | |
| 2763 { | |
| 2764 ScriptState* currentState = ScriptState::current(); | |
| 2765 if (!currentState) | |
| 2766 return v8Undefined(); | |
| 2767 ScriptState& state = *currentState; | |
| 2768 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2769 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateObjExc
eption(&state, scriptContext, ec); | |
| 2770 if (UNLIKELY(ec)) | |
| 2771 goto fail; | |
| 2772 if (state.hadException()) { | |
| 2773 v8::Local<v8::Value> exception = state.exception(); | |
| 2774 state.clearException(); | |
| 2775 return throwError(exception, args.GetIsolate()); | |
| 2776 } | |
| 2777 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2778 } | |
| 2779 fail: | |
| 2780 return setDOMException(ec, args.GetIsolate()); | |
| 2781 } | |
| 2782 | |
| 2783 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateObjExceptio
nMethodCallback(const v8::Arguments& args) | |
| 2784 { | |
| 2785 return TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExcepti
onMethod(args); | |
| 2786 } | |
| 2787 | |
| 2788 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesM
ethod(const v8::Arguments& args) | |
| 2789 { | |
| 2790 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2791 ScriptState* currentState = ScriptState::current(); | |
| 2792 if (!currentState) | |
| 2793 return v8Undefined(); | |
| 2794 ScriptState& state = *currentState; | |
| 2795 ScriptExecutionContext* scriptContext = getScriptExecutionContext(); | |
| 2796 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSp
aces(&state, scriptContext); | |
| 2797 if (state.hadException()) { | |
| 2798 v8::Local<v8::Value> exception = state.exception(); | |
| 2799 state.clearException(); | |
| 2800 return throwError(exception, args.GetIsolate()); | |
| 2801 } | |
| 2802 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 2803 } | |
| 2804 | |
| 2805 static v8::Handle<v8::Value> withScriptExecutionContextAndScriptStateWithSpacesM
ethodCallback(const v8::Arguments& args) | |
| 2806 { | |
| 2807 return TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpaces
Method(args); | |
| 2808 } | |
| 2809 | |
| 2810 static v8::Handle<v8::Value> methodWithOptionalArgMethod(const v8::Arguments& ar
gs) | |
| 2811 { | |
| 2812 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2813 if (args.Length() <= 0) { | |
| 2814 imp->methodWithOptionalArg(); | |
| 2815 return v8Undefined(); | |
| 2816 } | |
| 2817 V8TRYCATCH(int, opt, toInt32(args[0])); | |
| 2818 imp->methodWithOptionalArg(opt); | |
| 2819 return v8Undefined(); | |
| 2820 } | |
| 2821 | |
| 2822 static v8::Handle<v8::Value> methodWithOptionalArgMethodCallback(const v8::Argum
ents& args) | |
| 2823 { | |
| 2824 return TestObjV8Internal::methodWithOptionalArgMethod(args); | |
| 2825 } | |
| 2826 | |
| 2827 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgMethod(const
v8::Arguments& args) | |
| 2828 { | |
| 2829 if (args.Length() < 1) | |
| 2830 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2831 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2832 V8TRYCATCH(int, nonOpt, toInt32(args[0])); | |
| 2833 if (args.Length() <= 1) { | |
| 2834 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | |
| 2835 return v8Undefined(); | |
| 2836 } | |
| 2837 V8TRYCATCH(int, opt, toInt32(args[1])); | |
| 2838 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | |
| 2839 return v8Undefined(); | |
| 2840 } | |
| 2841 | |
| 2842 static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgMethodCallbac
k(const v8::Arguments& args) | |
| 2843 { | |
| 2844 return TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(args)
; | |
| 2845 } | |
| 2846 | |
| 2847 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsMethod(co
nst v8::Arguments& args) | |
| 2848 { | |
| 2849 if (args.Length() < 1) | |
| 2850 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2851 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2852 V8TRYCATCH(int, nonOpt, toInt32(args[0])); | |
| 2853 if (args.Length() <= 1) { | |
| 2854 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | |
| 2855 return v8Undefined(); | |
| 2856 } | |
| 2857 V8TRYCATCH(int, opt1, toInt32(args[1])); | |
| 2858 if (args.Length() <= 2) { | |
| 2859 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); | |
| 2860 return v8Undefined(); | |
| 2861 } | |
| 2862 V8TRYCATCH(int, opt2, toInt32(args[2])); | |
| 2863 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); | |
| 2864 return v8Undefined(); | |
| 2865 } | |
| 2866 | |
| 2867 static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsMethodCal
lback(const v8::Arguments& args) | |
| 2868 { | |
| 2869 return TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(a
rgs); | |
| 2870 } | |
| 2871 | |
| 2872 static v8::Handle<v8::Value> methodWithOptionalStringMethod(const v8::Arguments&
args) | |
| 2873 { | |
| 2874 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2875 if (args.Length() <= 0) { | |
| 2876 imp->methodWithOptionalString(); | |
| 2877 return v8Undefined(); | |
| 2878 } | |
| 2879 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
| 2880 imp->methodWithOptionalString(str); | |
| 2881 return v8Undefined(); | |
| 2882 } | |
| 2883 | |
| 2884 static v8::Handle<v8::Value> methodWithOptionalStringMethodCallback(const v8::Ar
guments& args) | |
| 2885 { | |
| 2886 return TestObjV8Internal::methodWithOptionalStringMethod(args); | |
| 2887 } | |
| 2888 | |
| 2889 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedMethod(const v8:
:Arguments& args) | |
| 2890 { | |
| 2891 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2892 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
| 2893 imp->methodWithOptionalStringIsUndefined(str); | |
| 2894 return v8Undefined(); | |
| 2895 } | |
| 2896 | |
| 2897 static v8::Handle<v8::Value> methodWithOptionalStringIsUndefinedMethodCallback(c
onst v8::Arguments& args) | |
| 2898 { | |
| 2899 return TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(args); | |
| 2900 } | |
| 2901 | |
| 2902 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringMethod(const v8
::Arguments& args) | |
| 2903 { | |
| 2904 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2905 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, argumentOrNull(args
, 0)); | |
| 2906 imp->methodWithOptionalStringIsNullString(str); | |
| 2907 return v8Undefined(); | |
| 2908 } | |
| 2909 | |
| 2910 static v8::Handle<v8::Value> methodWithOptionalStringIsNullStringMethodCallback(
const v8::Arguments& args) | |
| 2911 { | |
| 2912 return TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(args); | |
| 2913 } | |
| 2914 | |
| 2915 static v8::Handle<v8::Value> methodWithCallbackArgMethod(const v8::Arguments& ar
gs) | |
| 2916 { | |
| 2917 if (args.Length() < 1) | |
| 2918 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2919 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2920 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 2921 return throwTypeError(0, args.GetIsolate()); | |
| 2922 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
| 2923 imp->methodWithCallbackArg(callback); | |
| 2924 return v8Undefined(); | |
| 2925 } | |
| 2926 | |
| 2927 static v8::Handle<v8::Value> methodWithCallbackArgMethodCallback(const v8::Argum
ents& args) | |
| 2928 { | |
| 2929 return TestObjV8Internal::methodWithCallbackArgMethod(args); | |
| 2930 } | |
| 2931 | |
| 2932 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgMethod(const
v8::Arguments& args) | |
| 2933 { | |
| 2934 if (args.Length() < 2) | |
| 2935 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2936 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2937 V8TRYCATCH(int, nonCallback, toInt32(args[0])); | |
| 2938 if (args.Length() <= 1 || !args[1]->IsFunction()) | |
| 2939 return throwTypeError(0, args.GetIsolate()); | |
| 2940 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExe
cutionContext()); | |
| 2941 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); | |
| 2942 return v8Undefined(); | |
| 2943 } | |
| 2944 | |
| 2945 static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgMethodCallbac
k(const v8::Arguments& args) | |
| 2946 { | |
| 2947 return TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(args)
; | |
| 2948 } | |
| 2949 | |
| 2950 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgMethod(const v8::Ar
guments& args) | |
| 2951 { | |
| 2952 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 2953 RefPtr<TestCallback> callback; | |
| 2954 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | |
| 2955 if (!args[0]->IsFunction()) | |
| 2956 return throwTypeError(0, args.GetIsolate()); | |
| 2957 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); | |
| 2958 } | |
| 2959 imp->methodWithCallbackAndOptionalArg(callback); | |
| 2960 return v8Undefined(); | |
| 2961 } | |
| 2962 | |
| 2963 static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgMethodCallback(cons
t v8::Arguments& args) | |
| 2964 { | |
| 2965 return TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(args); | |
| 2966 } | |
| 2967 | |
| 2968 static v8::Handle<v8::Value> staticMethodWithCallbackAndOptionalArgMethod(const
v8::Arguments& args) | |
| 2969 { | |
| 2970 RefPtr<TestCallback> callback; | |
| 2971 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { | |
| 2972 if (!args[0]->IsFunction()) | |
| 2973 return throwTypeError(0, args.GetIsolate()); | |
| 2974 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); | |
| 2975 } | |
| 2976 TestObj::staticMethodWithCallbackAndOptionalArg(callback); | |
| 2977 return v8Undefined(); | |
| 2978 } | |
| 2979 | |
| 2980 static v8::Handle<v8::Value> staticMethodWithCallbackAndOptionalArgMethodCallbac
k(const v8::Arguments& args) | |
| 2981 { | |
| 2982 return TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(args)
; | |
| 2983 } | |
| 2984 | |
| 2985 static v8::Handle<v8::Value> staticMethodWithCallbackArgMethod(const v8::Argumen
ts& args) | |
| 2986 { | |
| 2987 if (args.Length() < 1) | |
| 2988 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 2989 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 2990 return throwTypeError(0, args.GetIsolate()); | |
| 2991 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
| 2992 TestObj::staticMethodWithCallbackArg(callback); | |
| 2993 return v8Undefined(); | |
| 2994 } | |
| 2995 | |
| 2996 static v8::Handle<v8::Value> staticMethodWithCallbackArgMethodCallback(const v8:
:Arguments& args) | |
| 2997 { | |
| 2998 return TestObjV8Internal::staticMethodWithCallbackArgMethod(args); | |
| 2999 } | |
| 3000 | |
| 3001 static v8::Handle<v8::Value> methodWithEnforceRangeInt32Method(const v8::Argumen
ts& args) | |
| 3002 { | |
| 3003 if (args.Length() < 1) | |
| 3004 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3005 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3006 V8TRYCATCH_WITH_TYPECHECK(int, value, toInt32(args[0], EnforceRange, ok), ar
gs.GetIsolate()); | |
| 3007 imp->methodWithEnforceRangeInt32(value); | |
| 3008 return v8Undefined(); | |
| 3009 } | |
| 3010 | |
| 3011 static v8::Handle<v8::Value> methodWithEnforceRangeInt32MethodCallback(const v8:
:Arguments& args) | |
| 3012 { | |
| 3013 return TestObjV8Internal::methodWithEnforceRangeInt32Method(args); | |
| 3014 } | |
| 3015 | |
| 3016 static v8::Handle<v8::Value> methodWithEnforceRangeUInt32Method(const v8::Argume
nts& args) | |
| 3017 { | |
| 3018 if (args.Length() < 1) | |
| 3019 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3020 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3021 V8TRYCATCH_WITH_TYPECHECK(unsigned, value, toUInt32(args[0], EnforceRange, o
k), args.GetIsolate()); | |
| 3022 imp->methodWithEnforceRangeUInt32(value); | |
| 3023 return v8Undefined(); | |
| 3024 } | |
| 3025 | |
| 3026 static v8::Handle<v8::Value> methodWithEnforceRangeUInt32MethodCallback(const v8
::Arguments& args) | |
| 3027 { | |
| 3028 return TestObjV8Internal::methodWithEnforceRangeUInt32Method(args); | |
| 3029 } | |
| 3030 | |
| 3031 static v8::Handle<v8::Value> methodWithEnforceRangeInt64Method(const v8::Argumen
ts& args) | |
| 3032 { | |
| 3033 if (args.Length() < 1) | |
| 3034 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3035 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3036 V8TRYCATCH_WITH_TYPECHECK(long long, value, toInt64(args[0], EnforceRange, o
k), args.GetIsolate()); | |
| 3037 imp->methodWithEnforceRangeInt64(value); | |
| 3038 return v8Undefined(); | |
| 3039 } | |
| 3040 | |
| 3041 static v8::Handle<v8::Value> methodWithEnforceRangeInt64MethodCallback(const v8:
:Arguments& args) | |
| 3042 { | |
| 3043 return TestObjV8Internal::methodWithEnforceRangeInt64Method(args); | |
| 3044 } | |
| 3045 | |
| 3046 static v8::Handle<v8::Value> methodWithEnforceRangeUInt64Method(const v8::Argume
nts& args) | |
| 3047 { | |
| 3048 if (args.Length() < 1) | |
| 3049 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3050 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3051 V8TRYCATCH_WITH_TYPECHECK(unsigned long long, value, toUInt64(args[0], Enfor
ceRange, ok), args.GetIsolate()); | |
| 3052 imp->methodWithEnforceRangeUInt64(value); | |
| 3053 return v8Undefined(); | |
| 3054 } | |
| 3055 | |
| 3056 static v8::Handle<v8::Value> methodWithEnforceRangeUInt64MethodCallback(const v8
::Arguments& args) | |
| 3057 { | |
| 3058 return TestObjV8Internal::methodWithEnforceRangeUInt64Method(args); | |
| 3059 } | |
| 3060 | |
| 3061 #if ENABLE(Condition1) | |
| 3062 | |
| 3063 static v8::Handle<v8::Value> conditionalMethod1Method(const v8::Arguments& args) | |
| 3064 { | |
| 3065 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3066 return v8String(imp->conditionalMethod1(), args.GetIsolate(), ReturnUnsafeHa
ndle); | |
| 3067 } | |
| 3068 | |
| 3069 #endif // ENABLE(Condition1) | |
| 3070 | |
| 3071 #if ENABLE(Condition1) | |
| 3072 | |
| 3073 static v8::Handle<v8::Value> conditionalMethod1MethodCallback(const v8::Argument
s& args) | |
| 3074 { | |
| 3075 return TestObjV8Internal::conditionalMethod1Method(args); | |
| 3076 } | |
| 3077 | |
| 3078 #endif // ENABLE(Condition1) | |
| 3079 | |
| 3080 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 3081 | |
| 3082 static v8::Handle<v8::Value> conditionalMethod2Method(const v8::Arguments& args) | |
| 3083 { | |
| 3084 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3085 imp->conditionalMethod2(); | |
| 3086 return v8Undefined(); | |
| 3087 } | |
| 3088 | |
| 3089 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 3090 | |
| 3091 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 3092 | |
| 3093 static v8::Handle<v8::Value> conditionalMethod2MethodCallback(const v8::Argument
s& args) | |
| 3094 { | |
| 3095 return TestObjV8Internal::conditionalMethod2Method(args); | |
| 3096 } | |
| 3097 | |
| 3098 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 3099 | |
| 3100 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 3101 | |
| 3102 static v8::Handle<v8::Value> conditionalMethod3Method(const v8::Arguments& args) | |
| 3103 { | |
| 3104 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3105 imp->conditionalMethod3(); | |
| 3106 return v8Undefined(); | |
| 3107 } | |
| 3108 | |
| 3109 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 3110 | |
| 3111 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 3112 | |
| 3113 static v8::Handle<v8::Value> conditionalMethod3MethodCallback(const v8::Argument
s& args) | |
| 3114 { | |
| 3115 return TestObjV8Internal::conditionalMethod3Method(args); | |
| 3116 } | |
| 3117 | |
| 3118 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 3119 | |
| 3120 static v8::Handle<v8::Value> overloadedMethod1Method(const v8::Arguments& args) | |
| 3121 { | |
| 3122 if (args.Length() < 2) | |
| 3123 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3124 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3125 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
| 3126 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]); | |
| 3127 imp->overloadedMethod(objArg, strArg); | |
| 3128 return v8Undefined(); | |
| 3129 } | |
| 3130 | |
| 3131 static v8::Handle<v8::Value> overloadedMethod2Method(const v8::Arguments& args) | |
| 3132 { | |
| 3133 if (args.Length() < 1) | |
| 3134 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3135 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3136 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
| 3137 if (args.Length() <= 1) { | |
| 3138 imp->overloadedMethod(objArg); | |
| 3139 return v8Undefined(); | |
| 3140 } | |
| 3141 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3142 imp->overloadedMethod(objArg, longArg); | |
| 3143 return v8Undefined(); | |
| 3144 } | |
| 3145 | |
| 3146 static v8::Handle<v8::Value> overloadedMethod3Method(const v8::Arguments& args) | |
| 3147 { | |
| 3148 if (args.Length() < 1) | |
| 3149 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3150 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3151 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3152 imp->overloadedMethod(strArg); | |
| 3153 return v8Undefined(); | |
| 3154 } | |
| 3155 | |
| 3156 static v8::Handle<v8::Value> overloadedMethod4Method(const v8::Arguments& args) | |
| 3157 { | |
| 3158 if (args.Length() < 1) | |
| 3159 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3160 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3161 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3162 imp->overloadedMethod(longArg); | |
| 3163 return v8Undefined(); | |
| 3164 } | |
| 3165 | |
| 3166 static v8::Handle<v8::Value> overloadedMethod5Method(const v8::Arguments& args) | |
| 3167 { | |
| 3168 if (args.Length() < 1) | |
| 3169 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3170 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3171 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 3172 return throwTypeError(0, args.GetIsolate()); | |
| 3173 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExe
cutionContext()); | |
| 3174 imp->overloadedMethod(callback); | |
| 3175 return v8Undefined(); | |
| 3176 } | |
| 3177 | |
| 3178 static v8::Handle<v8::Value> overloadedMethod6Method(const v8::Arguments& args) | |
| 3179 { | |
| 3180 if (args.Length() < 1) | |
| 3181 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3182 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3183 V8TRYCATCH(RefPtr<DOMStringList>, listArg, toDOMStringList(args[0], args.Get
Isolate())); | |
| 3184 imp->overloadedMethod(listArg); | |
| 3185 return v8Undefined(); | |
| 3186 } | |
| 3187 | |
| 3188 static v8::Handle<v8::Value> overloadedMethod7Method(const v8::Arguments& args) | |
| 3189 { | |
| 3190 if (args.Length() < 1) | |
| 3191 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3192 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3193 V8TRYCATCH(Vector<String>, arrayArg, toNativeArray<String>(args[0])); | |
| 3194 imp->overloadedMethod(arrayArg); | |
| 3195 return v8Undefined(); | |
| 3196 } | |
| 3197 | |
| 3198 static v8::Handle<v8::Value> overloadedMethod8Method(const v8::Arguments& args) | |
| 3199 { | |
| 3200 if (args.Length() < 1) | |
| 3201 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3202 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3203 V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate
(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::
Cast(args[0])) : 0); | |
| 3204 imp->overloadedMethod(objArg); | |
| 3205 return v8Undefined(); | |
| 3206 } | |
| 3207 | |
| 3208 static v8::Handle<v8::Value> overloadedMethod9Method(const v8::Arguments& args) | |
| 3209 { | |
| 3210 if (args.Length() < 1) | |
| 3211 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3212 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3213 V8TRYCATCH(Vector<String>, arrayArg, toNativeArray<String>(args[0])); | |
| 3214 imp->overloadedMethod(arrayArg); | |
| 3215 return v8Undefined(); | |
| 3216 } | |
| 3217 | |
| 3218 static v8::Handle<v8::Value> overloadedMethod10Method(const v8::Arguments& args) | |
| 3219 { | |
| 3220 if (args.Length() < 1) | |
| 3221 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3222 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3223 V8TRYCATCH(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(args[0])); | |
| 3224 imp->overloadedMethod(arrayArg); | |
| 3225 return v8Undefined(); | |
| 3226 } | |
| 3227 | |
| 3228 static v8::Handle<v8::Value> overloadedMethod11Method(const v8::Arguments& args) | |
| 3229 { | |
| 3230 if (args.Length() < 1) | |
| 3231 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3232 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3233 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3234 imp->overloadedMethod(strArg); | |
| 3235 return v8Undefined(); | |
| 3236 } | |
| 3237 | |
| 3238 static v8::Handle<v8::Value> overloadedMethodMethod(const v8::Arguments& args) | |
| 3239 { | |
| 3240 if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args
[0], args.GetIsolate(), worldType(args.GetIsolate()))) && (args[1]->IsNull() ||
args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject()))) | |
| 3241 return overloadedMethod1Method(args); | |
| 3242 if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args
[0], args.GetIsolate(), worldType(args.GetIsolate())))) || (args.Length() == 2 &
& (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate(), world
Type(args.GetIsolate()))))) | |
| 3243 return overloadedMethod2Method(args); | |
| 3244 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) | |
| 3245 return overloadedMethod3Method(args); | |
| 3246 if (args.Length() == 1) | |
| 3247 return overloadedMethod4Method(args); | |
| 3248 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction()))) | |
| 3249 return overloadedMethod5Method(args); | |
| 3250 if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstanc
e(args[0], args.GetIsolate(), worldType(args.GetIsolate()))))) | |
| 3251 return overloadedMethod6Method(args); | |
| 3252 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray()))) | |
| 3253 return overloadedMethod7Method(args); | |
| 3254 if ((args.Length() == 1 && (V8TestObj::HasInstance(args[0], args.GetIsolate(
), worldType(args.GetIsolate()))))) | |
| 3255 return overloadedMethod8Method(args); | |
| 3256 if ((args.Length() == 1 && (args[0]->IsArray()))) | |
| 3257 return overloadedMethod9Method(args); | |
| 3258 if ((args.Length() == 1 && (args[0]->IsArray()))) | |
| 3259 return overloadedMethod10Method(args); | |
| 3260 if (args.Length() == 1) | |
| 3261 return overloadedMethod11Method(args); | |
| 3262 if (args.Length() < 1) | |
| 3263 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3264 return throwTypeError(0, args.GetIsolate()); | |
| 3265 } | |
| 3266 | |
| 3267 static v8::Handle<v8::Value> overloadedMethodMethodCallback(const v8::Arguments&
args) | |
| 3268 { | |
| 3269 return TestObjV8Internal::overloadedMethodMethod(args); | |
| 3270 } | |
| 3271 | |
| 3272 static v8::Handle<v8::Value> classMethodMethod(const v8::Arguments& args) | |
| 3273 { | |
| 3274 TestObj::classMethod(); | |
| 3275 return v8Undefined(); | |
| 3276 } | |
| 3277 | |
| 3278 static v8::Handle<v8::Value> classMethodMethodCallback(const v8::Arguments& args
) | |
| 3279 { | |
| 3280 return TestObjV8Internal::classMethodMethod(args); | |
| 3281 } | |
| 3282 | |
| 3283 static v8::Handle<v8::Value> classMethodWithOptionalMethod(const v8::Arguments&
args) | |
| 3284 { | |
| 3285 if (args.Length() <= 0) { | |
| 3286 return v8Integer(TestObj::classMethodWithOptional(), args.GetIsolate()); | |
| 3287 } | |
| 3288 V8TRYCATCH(int, arg, toInt32(args[0])); | |
| 3289 return v8Integer(TestObj::classMethodWithOptional(arg), args.GetIsolate()); | |
| 3290 } | |
| 3291 | |
| 3292 static v8::Handle<v8::Value> classMethodWithOptionalMethodCallback(const v8::Arg
uments& args) | |
| 3293 { | |
| 3294 return TestObjV8Internal::classMethodWithOptionalMethod(args); | |
| 3295 } | |
| 3296 | |
| 3297 static v8::Handle<v8::Value> classMethod2MethodCallback(const v8::Arguments& arg
s) | |
| 3298 { | |
| 3299 return V8TestObj::classMethod2MethodCustom(args); | |
| 3300 } | |
| 3301 | |
| 3302 #if ENABLE(Condition1) | |
| 3303 | |
| 3304 static v8::Handle<v8::Value> overloadedMethod11Method(const v8::Arguments& args) | |
| 3305 { | |
| 3306 if (args.Length() < 1) | |
| 3307 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3308 V8TRYCATCH(int, arg, toInt32(args[0])); | |
| 3309 TestObj::overloadedMethod1(arg); | |
| 3310 return v8Undefined(); | |
| 3311 } | |
| 3312 | |
| 3313 #endif // ENABLE(Condition1) | |
| 3314 | |
| 3315 #if ENABLE(Condition1) | |
| 3316 | |
| 3317 static v8::Handle<v8::Value> overloadedMethod12Method(const v8::Arguments& args) | |
| 3318 { | |
| 3319 if (args.Length() < 1) | |
| 3320 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3321 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, args[0]); | |
| 3322 TestObj::overloadedMethod1(type); | |
| 3323 return v8Undefined(); | |
| 3324 } | |
| 3325 | |
| 3326 #endif // ENABLE(Condition1) | |
| 3327 | |
| 3328 #if ENABLE(Condition1) | |
| 3329 | |
| 3330 static v8::Handle<v8::Value> overloadedMethod1Method(const v8::Arguments& args) | |
| 3331 { | |
| 3332 if (args.Length() == 1) | |
| 3333 return overloadedMethod11Method(args); | |
| 3334 if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || a
rgs[0]->IsString() || args[0]->IsObject()))) | |
| 3335 return overloadedMethod12Method(args); | |
| 3336 if (args.Length() < 1) | |
| 3337 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3338 return throwTypeError(0, args.GetIsolate()); | |
| 3339 } | |
| 3340 | |
| 3341 #endif // ENABLE(Condition1) | |
| 3342 | |
| 3343 #if ENABLE(Condition1) | |
| 3344 | |
| 3345 static v8::Handle<v8::Value> overloadedMethod1MethodCallback(const v8::Arguments
& args) | |
| 3346 { | |
| 3347 return TestObjV8Internal::overloadedMethod1Method(args); | |
| 3348 } | |
| 3349 | |
| 3350 #endif // ENABLE(Condition1) | |
| 3351 | |
| 3352 static v8::Handle<v8::Value> classMethodWithClampMethod(const v8::Arguments& arg
s) | |
| 3353 { | |
| 3354 if (args.Length() < 2) | |
| 3355 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3356 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3357 unsigned short objArgsShort = 0; | |
| 3358 V8TRYCATCH(double, objArgsShortNativeValue, args[0]->NumberValue()); | |
| 3359 if (!std::isnan(objArgsShortNativeValue)) | |
| 3360 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | |
| 3361 unsigned long objArgsLong = 0; | |
| 3362 V8TRYCATCH(double, objArgsLongNativeValue, args[1]->NumberValue()); | |
| 3363 if (!std::isnan(objArgsLongNativeValue)) | |
| 3364 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | |
| 3365 imp->classMethodWithClamp(objArgsShort, objArgsLong); | |
| 3366 return v8Undefined(); | |
| 3367 } | |
| 3368 | |
| 3369 static v8::Handle<v8::Value> classMethodWithClampMethodCallback(const v8::Argume
nts& args) | |
| 3370 { | |
| 3371 return TestObjV8Internal::classMethodWithClampMethod(args); | |
| 3372 } | |
| 3373 | |
| 3374 static v8::Handle<v8::Value> enabledAtRuntimeMethod1Method(const v8::Arguments&
args) | |
| 3375 { | |
| 3376 if (args.Length() < 1) | |
| 3377 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3378 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3379 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3380 imp->enabledAtRuntimeMethod1(longArg); | |
| 3381 return v8Undefined(); | |
| 3382 } | |
| 3383 | |
| 3384 static v8::Handle<v8::Value> enabledAtRuntimeMethod1MethodCallback(const v8::Arg
uments& args) | |
| 3385 { | |
| 3386 return TestObjV8Internal::enabledAtRuntimeMethod1Method(args); | |
| 3387 } | |
| 3388 | |
| 3389 static v8::Handle<v8::Value> enabledAtRuntimeMethod2Method(const v8::Arguments&
args) | |
| 3390 { | |
| 3391 if (args.Length() < 1) | |
| 3392 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3393 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3394 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3395 imp->enabledAtRuntimeMethod2(longArg); | |
| 3396 return v8Undefined(); | |
| 3397 } | |
| 3398 | |
| 3399 static v8::Handle<v8::Value> enabledAtRuntimeMethod2MethodCallback(const v8::Arg
uments& args) | |
| 3400 { | |
| 3401 return TestObjV8Internal::enabledAtRuntimeMethod2Method(args); | |
| 3402 } | |
| 3403 | |
| 3404 static v8::Handle<v8::Value> enabledPerContextMethod1Method(const v8::Arguments&
args) | |
| 3405 { | |
| 3406 if (args.Length() < 1) | |
| 3407 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3408 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3409 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3410 imp->enabledPerContextMethod1(longArg); | |
| 3411 return v8Undefined(); | |
| 3412 } | |
| 3413 | |
| 3414 static v8::Handle<v8::Value> enabledPerContextMethod1MethodCallback(const v8::Ar
guments& args) | |
| 3415 { | |
| 3416 return TestObjV8Internal::enabledPerContextMethod1Method(args); | |
| 3417 } | |
| 3418 | |
| 3419 static v8::Handle<v8::Value> enabledPerContextMethod2Method(const v8::Arguments&
args) | |
| 3420 { | |
| 3421 if (args.Length() < 1) | |
| 3422 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3423 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3424 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3425 imp->enabledPerContextMethod2(longArg); | |
| 3426 return v8Undefined(); | |
| 3427 } | |
| 3428 | |
| 3429 static v8::Handle<v8::Value> enabledPerContextMethod2MethodCallback(const v8::Ar
guments& args) | |
| 3430 { | |
| 3431 return TestObjV8Internal::enabledPerContextMethod2Method(args); | |
| 3432 } | |
| 3433 | |
| 3434 static v8::Handle<v8::Value> methodWithUnsignedLongSequenceMethod(const v8::Argu
ments& args) | |
| 3435 { | |
| 3436 if (args.Length() < 1) | |
| 3437 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3438 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3439 V8TRYCATCH(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(a
rgs[0])); | |
| 3440 imp->methodWithUnsignedLongSequence(unsignedLongSequence); | |
| 3441 return v8Undefined(); | |
| 3442 } | |
| 3443 | |
| 3444 static v8::Handle<v8::Value> methodWithUnsignedLongSequenceMethodCallback(const
v8::Arguments& args) | |
| 3445 { | |
| 3446 return TestObjV8Internal::methodWithUnsignedLongSequenceMethod(args); | |
| 3447 } | |
| 3448 | |
| 3449 static v8::Handle<v8::Value> stringArrayFunctionMethod(const v8::Arguments& args
) | |
| 3450 { | |
| 3451 if (args.Length() < 1) | |
| 3452 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3453 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3454 ExceptionCode ec = 0; | |
| 3455 { | |
| 3456 V8TRYCATCH(Vector<String>, values, toNativeArray<String>(args[0])); | |
| 3457 Vector<String> result = imp->stringArrayFunction(values, ec); | |
| 3458 if (UNLIKELY(ec)) | |
| 3459 goto fail; | |
| 3460 return v8Array(result, args.GetIsolate()); | |
| 3461 } | |
| 3462 fail: | |
| 3463 return setDOMException(ec, args.GetIsolate()); | |
| 3464 } | |
| 3465 | |
| 3466 static v8::Handle<v8::Value> stringArrayFunctionMethodCallback(const v8::Argumen
ts& args) | |
| 3467 { | |
| 3468 return TestObjV8Internal::stringArrayFunctionMethod(args); | |
| 3469 } | |
| 3470 | |
| 3471 static v8::Handle<v8::Value> domStringListFunctionMethod(const v8::Arguments& ar
gs) | |
| 3472 { | |
| 3473 if (args.Length() < 1) | |
| 3474 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3475 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3476 ExceptionCode ec = 0; | |
| 3477 { | |
| 3478 V8TRYCATCH(RefPtr<DOMStringList>, values, toDOMStringList(args[0], args.GetI
solate())); | |
| 3479 RefPtr<DOMStringList> result = imp->domStringListFunction(values, ec); | |
| 3480 if (UNLIKELY(ec)) | |
| 3481 goto fail; | |
| 3482 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 3483 } | |
| 3484 fail: | |
| 3485 return setDOMException(ec, args.GetIsolate()); | |
| 3486 } | |
| 3487 | |
| 3488 static v8::Handle<v8::Value> domStringListFunctionMethodCallback(const v8::Argum
ents& args) | |
| 3489 { | |
| 3490 return TestObjV8Internal::domStringListFunctionMethod(args); | |
| 3491 } | |
| 3492 | |
| 3493 static v8::Handle<v8::Value> getSVGDocumentMethod(const v8::Arguments& args) | |
| 3494 { | |
| 3495 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3496 ExceptionCode ec = 0; | |
| 3497 { | |
| 3498 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(ec))) | |
| 3499 return v8::Handle<v8::Value>(v8Null(args.GetIsolate())); | |
| 3500 RefPtr<SVGDocument> result = imp->getSVGDocument(ec); | |
| 3501 if (UNLIKELY(ec)) | |
| 3502 goto fail; | |
| 3503 return toV8(result.release(), args.Holder(), args.GetIsolate()); | |
| 3504 } | |
| 3505 fail: | |
| 3506 return setDOMException(ec, args.GetIsolate()); | |
| 3507 } | |
| 3508 | |
| 3509 static v8::Handle<v8::Value> getSVGDocumentMethodCallback(const v8::Arguments& a
rgs) | |
| 3510 { | |
| 3511 return TestObjV8Internal::getSVGDocumentMethod(args); | |
| 3512 } | |
| 3513 | |
| 3514 static v8::Handle<v8::Value> convert1Method(const v8::Arguments& args) | |
| 3515 { | |
| 3516 if (args.Length() < 1) | |
| 3517 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3518 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3519 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
| 3520 imp->convert1(value); | |
| 3521 return v8Undefined(); | |
| 3522 } | |
| 3523 | |
| 3524 static v8::Handle<v8::Value> convert1MethodCallback(const v8::Arguments& args) | |
| 3525 { | |
| 3526 return TestObjV8Internal::convert1Method(args); | |
| 3527 } | |
| 3528 | |
| 3529 static v8::Handle<v8::Value> convert2Method(const v8::Arguments& args) | |
| 3530 { | |
| 3531 if (args.Length() < 1) | |
| 3532 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3533 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3534 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
| 3535 imp->convert2(value); | |
| 3536 return v8Undefined(); | |
| 3537 } | |
| 3538 | |
| 3539 static v8::Handle<v8::Value> convert2MethodCallback(const v8::Arguments& args) | |
| 3540 { | |
| 3541 return TestObjV8Internal::convert2Method(args); | |
| 3542 } | |
| 3543 | |
| 3544 static v8::Handle<v8::Value> convert4Method(const v8::Arguments& args) | |
| 3545 { | |
| 3546 if (args.Length() < 1) | |
| 3547 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3548 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3549 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
| 3550 imp->convert4(value); | |
| 3551 return v8Undefined(); | |
| 3552 } | |
| 3553 | |
| 3554 static v8::Handle<v8::Value> convert4MethodCallback(const v8::Arguments& args) | |
| 3555 { | |
| 3556 return TestObjV8Internal::convert4Method(args); | |
| 3557 } | |
| 3558 | |
| 3559 static v8::Handle<v8::Value> convert5Method(const v8::Arguments& args) | |
| 3560 { | |
| 3561 if (args.Length() < 1) | |
| 3562 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3563 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3564 V8TRYCATCH(TestNode*, value, V8TestNode::HasInstance(args[0], args.GetIsolat
e(), worldType(args.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>
::Cast(args[0])) : 0); | |
| 3565 imp->convert5(value); | |
| 3566 return v8Undefined(); | |
| 3567 } | |
| 3568 | |
| 3569 static v8::Handle<v8::Value> convert5MethodCallback(const v8::Arguments& args) | |
| 3570 { | |
| 3571 return TestObjV8Internal::convert5Method(args); | |
| 3572 } | |
| 3573 | |
| 3574 static v8::Handle<v8::Value> mutablePointFunctionMethod(const v8::Arguments& arg
s) | |
| 3575 { | |
| 3576 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3577 return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutableP
ointFunction())), args.Holder(), args.GetIsolate()); | |
| 3578 } | |
| 3579 | |
| 3580 static v8::Handle<v8::Value> mutablePointFunctionMethodCallback(const v8::Argume
nts& args) | |
| 3581 { | |
| 3582 return TestObjV8Internal::mutablePointFunctionMethod(args); | |
| 3583 } | |
| 3584 | |
| 3585 static v8::Handle<v8::Value> immutablePointFunctionMethod(const v8::Arguments& a
rgs) | |
| 3586 { | |
| 3587 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3588 return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutabl
ePointFunction())), args.Holder(), args.GetIsolate()); | |
| 3589 } | |
| 3590 | |
| 3591 static v8::Handle<v8::Value> immutablePointFunctionMethodCallback(const v8::Argu
ments& args) | |
| 3592 { | |
| 3593 return TestObjV8Internal::immutablePointFunctionMethod(args); | |
| 3594 } | |
| 3595 | |
| 3596 static v8::Handle<v8::Value> orangeMethod(const v8::Arguments& args) | |
| 3597 { | |
| 3598 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3599 imp->banana(); | |
| 3600 return v8Undefined(); | |
| 3601 } | |
| 3602 | |
| 3603 static v8::Handle<v8::Value> orangeMethodCallback(const v8::Arguments& args) | |
| 3604 { | |
| 3605 return TestObjV8Internal::orangeMethod(args); | |
| 3606 } | |
| 3607 | |
| 3608 static v8::Handle<v8::Value> strictFunctionMethod(const v8::Arguments& args) | |
| 3609 { | |
| 3610 if (args.Length() < 3) | |
| 3611 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3612 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3613 ExceptionCode ec = 0; | |
| 3614 { | |
| 3615 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]); | |
| 3616 V8TRYCATCH(float, a, static_cast<float>(args[1]->NumberValue())); | |
| 3617 V8TRYCATCH(int, b, toInt32(args[2])); | |
| 3618 bool result = imp->strictFunction(str, a, b, ec); | |
| 3619 if (UNLIKELY(ec)) | |
| 3620 goto fail; | |
| 3621 return v8Boolean(result, args.GetIsolate()); | |
| 3622 } | |
| 3623 fail: | |
| 3624 return setDOMException(ec, args.GetIsolate()); | |
| 3625 } | |
| 3626 | |
| 3627 static v8::Handle<v8::Value> strictFunctionMethodCallback(const v8::Arguments& a
rgs) | |
| 3628 { | |
| 3629 return TestObjV8Internal::strictFunctionMethod(args); | |
| 3630 } | |
| 3631 | |
| 3632 static v8::Handle<v8::Value> variadicStringMethodMethod(const v8::Arguments& arg
s) | |
| 3633 { | |
| 3634 if (args.Length() < 1) | |
| 3635 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3636 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3637 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, head, args[0]); | |
| 3638 V8TRYCATCH(Vector<String>, tail, toNativeArguments<String>(args, 1)); | |
| 3639 imp->variadicStringMethod(head, tail); | |
| 3640 return v8Undefined(); | |
| 3641 } | |
| 3642 | |
| 3643 static v8::Handle<v8::Value> variadicStringMethodMethodCallback(const v8::Argume
nts& args) | |
| 3644 { | |
| 3645 return TestObjV8Internal::variadicStringMethodMethod(args); | |
| 3646 } | |
| 3647 | |
| 3648 static v8::Handle<v8::Value> variadicDoubleMethodMethod(const v8::Arguments& arg
s) | |
| 3649 { | |
| 3650 if (args.Length() < 1) | |
| 3651 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3652 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3653 V8TRYCATCH(double, head, static_cast<double>(args[0]->NumberValue())); | |
| 3654 V8TRYCATCH(Vector<double>, tail, toNativeArguments<double>(args, 1)); | |
| 3655 imp->variadicDoubleMethod(head, tail); | |
| 3656 return v8Undefined(); | |
| 3657 } | |
| 3658 | |
| 3659 static v8::Handle<v8::Value> variadicDoubleMethodMethodCallback(const v8::Argume
nts& args) | |
| 3660 { | |
| 3661 return TestObjV8Internal::variadicDoubleMethodMethod(args); | |
| 3662 } | |
| 3663 | |
| 3664 static v8::Handle<v8::Value> variadicNodeMethodMethod(const v8::Arguments& args) | |
| 3665 { | |
| 3666 if (args.Length() < 1) | |
| 3667 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3668 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3669 V8TRYCATCH(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(), worl
dType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0
])) : 0); | |
| 3670 Vector<RefPtr<Node> > tail; | |
| 3671 for (int i = 1; i < args.Length(); ++i) { | |
| 3672 if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetI
solate()))) | |
| 3673 return throwTypeError(0, args.GetIsolate()); | |
| 3674 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(args[i]))); | |
| 3675 } | |
| 3676 imp->variadicNodeMethod(head, tail); | |
| 3677 return v8Undefined(); | |
| 3678 } | |
| 3679 | |
| 3680 static v8::Handle<v8::Value> variadicNodeMethodMethodCallback(const v8::Argument
s& args) | |
| 3681 { | |
| 3682 return TestObjV8Internal::variadicNodeMethodMethod(args); | |
| 3683 } | |
| 3684 | |
| 3685 static v8::Handle<v8::Value> perWorldMethodMethod(const v8::Arguments& args) | |
| 3686 { | |
| 3687 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3688 imp->perWorldMethod(); | |
| 3689 return v8Undefined(); | |
| 3690 } | |
| 3691 | |
| 3692 static v8::Handle<v8::Value> perWorldMethodMethodForMainWorld(const v8::Argument
s& args) | |
| 3693 { | |
| 3694 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3695 imp->perWorldMethod(); | |
| 3696 return v8Undefined(); | |
| 3697 } | |
| 3698 | |
| 3699 static v8::Handle<v8::Value> perWorldMethodMethodCallback(const v8::Arguments& a
rgs) | |
| 3700 { | |
| 3701 return TestObjV8Internal::perWorldMethodMethod(args); | |
| 3702 } | |
| 3703 | |
| 3704 static v8::Handle<v8::Value> perWorldMethodMethodCallbackForMainWorld(const v8::
Arguments& args) | |
| 3705 { | |
| 3706 return TestObjV8Internal::perWorldMethodMethodForMainWorld(args); | |
| 3707 } | |
| 3708 | |
| 3709 static v8::Handle<v8::Value> overloadedPerWorldMethod1Method(const v8::Arguments
& args) | |
| 3710 { | |
| 3711 if (args.Length() < 1) | |
| 3712 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3713 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3714 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3715 imp->overloadedPerWorldMethod(longArg); | |
| 3716 return v8Undefined(); | |
| 3717 } | |
| 3718 | |
| 3719 static v8::Handle<v8::Value> overloadedPerWorldMethod1MethodForMainWorld(const v
8::Arguments& args) | |
| 3720 { | |
| 3721 if (args.Length() < 1) | |
| 3722 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3723 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3724 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3725 imp->overloadedPerWorldMethod(longArg); | |
| 3726 return v8Undefined(); | |
| 3727 } | |
| 3728 | |
| 3729 static v8::Handle<v8::Value> overloadedPerWorldMethod2Method(const v8::Arguments
& args) | |
| 3730 { | |
| 3731 if (args.Length() < 2) | |
| 3732 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3733 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3734 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3735 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3736 imp->overloadedPerWorldMethod(strArg, longArg); | |
| 3737 return v8Undefined(); | |
| 3738 } | |
| 3739 | |
| 3740 static v8::Handle<v8::Value> overloadedPerWorldMethod2MethodForMainWorld(const v
8::Arguments& args) | |
| 3741 { | |
| 3742 if (args.Length() < 2) | |
| 3743 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3744 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3745 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3746 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3747 imp->overloadedPerWorldMethod(strArg, longArg); | |
| 3748 return v8Undefined(); | |
| 3749 } | |
| 3750 | |
| 3751 static v8::Handle<v8::Value> overloadedPerWorldMethodMethod(const v8::Arguments&
args) | |
| 3752 { | |
| 3753 if (args.Length() == 1) | |
| 3754 return overloadedPerWorldMethod1Method(args); | |
| 3755 if (args.Length() == 2) | |
| 3756 return overloadedPerWorldMethod2Method(args); | |
| 3757 if (args.Length() < 1) | |
| 3758 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3759 return throwTypeError(0, args.GetIsolate()); | |
| 3760 } | |
| 3761 | |
| 3762 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodForMainWorld(const v8
::Arguments& args) | |
| 3763 { | |
| 3764 if (args.Length() == 1) | |
| 3765 return overloadedPerWorldMethod1MethodForMainWorld(args); | |
| 3766 if (args.Length() == 2) | |
| 3767 return overloadedPerWorldMethod2MethodForMainWorld(args); | |
| 3768 if (args.Length() < 1) | |
| 3769 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3770 return throwTypeError(0, args.GetIsolate()); | |
| 3771 } | |
| 3772 | |
| 3773 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodCallback(const v8::Ar
guments& args) | |
| 3774 { | |
| 3775 return TestObjV8Internal::overloadedPerWorldMethodMethod(args); | |
| 3776 } | |
| 3777 | |
| 3778 static v8::Handle<v8::Value> overloadedPerWorldMethodMethodCallbackForMainWorld(
const v8::Arguments& args) | |
| 3779 { | |
| 3780 return TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(args); | |
| 3781 } | |
| 3782 | |
| 3783 static v8::Handle<v8::Value> activityLoggedMethod1Method(const v8::Arguments& ar
gs) | |
| 3784 { | |
| 3785 if (args.Length() < 1) | |
| 3786 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3787 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3788 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3789 imp->activityLoggedMethod1(longArg); | |
| 3790 return v8Undefined(); | |
| 3791 } | |
| 3792 | |
| 3793 static v8::Handle<v8::Value> activityLoggedMethod1MethodCallback(const v8::Argum
ents& args) | |
| 3794 { | |
| 3795 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
| 3796 if (contextData && contextData->activityLogger()) { | |
| 3797 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
| 3798 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", a
rgs.Length(), loggerArgs.data(), "Method"); | |
| 3799 } | |
| 3800 return TestObjV8Internal::activityLoggedMethod1Method(args); | |
| 3801 } | |
| 3802 | |
| 3803 static v8::Handle<v8::Value> activityLoggedMethod2Method(const v8::Arguments& ar
gs) | |
| 3804 { | |
| 3805 if (args.Length() < 1) | |
| 3806 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3807 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3808 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3809 imp->activityLoggedMethod2(longArg); | |
| 3810 return v8Undefined(); | |
| 3811 } | |
| 3812 | |
| 3813 static v8::Handle<v8::Value> activityLoggedMethod2MethodForMainWorld(const v8::A
rguments& args) | |
| 3814 { | |
| 3815 if (args.Length() < 1) | |
| 3816 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3817 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3818 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3819 imp->activityLoggedMethod2(longArg); | |
| 3820 return v8Undefined(); | |
| 3821 } | |
| 3822 | |
| 3823 static v8::Handle<v8::Value> activityLoggedMethod2MethodCallback(const v8::Argum
ents& args) | |
| 3824 { | |
| 3825 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
| 3826 if (contextData && contextData->activityLogger()) { | |
| 3827 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
| 3828 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a
rgs.Length(), loggerArgs.data(), "Method"); | |
| 3829 } | |
| 3830 return TestObjV8Internal::activityLoggedMethod2Method(args); | |
| 3831 } | |
| 3832 | |
| 3833 static v8::Handle<v8::Value> activityLoggedMethod2MethodCallbackForMainWorld(con
st v8::Arguments& args) | |
| 3834 { | |
| 3835 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
| 3836 if (contextData && contextData->activityLogger()) { | |
| 3837 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
| 3838 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", a
rgs.Length(), loggerArgs.data(), "Method"); | |
| 3839 } | |
| 3840 return TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(args); | |
| 3841 } | |
| 3842 | |
| 3843 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethod(const v8:
:Arguments& args) | |
| 3844 { | |
| 3845 if (args.Length() < 1) | |
| 3846 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3847 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3848 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3849 imp->activityLoggedInIsolatedWorldMethod(longArg); | |
| 3850 return v8Undefined(); | |
| 3851 } | |
| 3852 | |
| 3853 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethodForMainWor
ld(const v8::Arguments& args) | |
| 3854 { | |
| 3855 if (args.Length() < 1) | |
| 3856 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3857 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3858 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3859 imp->activityLoggedInIsolatedWorldMethod(longArg); | |
| 3860 return v8Undefined(); | |
| 3861 } | |
| 3862 | |
| 3863 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethodCallback(c
onst v8::Arguments& args) | |
| 3864 { | |
| 3865 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
| 3866 if (contextData && contextData->activityLogger()) { | |
| 3867 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
| 3868 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", args.Length(), loggerArgs.data(), "Method"); | |
| 3869 } | |
| 3870 return TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(args); | |
| 3871 } | |
| 3872 | |
| 3873 static v8::Handle<v8::Value> activityLoggedInIsolatedWorldMethodMethodCallbackFo
rMainWorld(const v8::Arguments& args) | |
| 3874 { | |
| 3875 return TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWo
rld(args); | |
| 3876 } | |
| 3877 | |
| 3878 static v8::Handle<v8::Value> overloadedActivityLoggedMethod1Method(const v8::Arg
uments& args) | |
| 3879 { | |
| 3880 if (args.Length() < 1) | |
| 3881 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3882 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3883 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3884 imp->overloadedActivityLoggedMethod(longArg); | |
| 3885 return v8Undefined(); | |
| 3886 } | |
| 3887 | |
| 3888 static v8::Handle<v8::Value> overloadedActivityLoggedMethod1MethodForMainWorld(c
onst v8::Arguments& args) | |
| 3889 { | |
| 3890 if (args.Length() < 1) | |
| 3891 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3892 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3893 V8TRYCATCH(int, longArg, toInt32(args[0])); | |
| 3894 imp->overloadedActivityLoggedMethod(longArg); | |
| 3895 return v8Undefined(); | |
| 3896 } | |
| 3897 | |
| 3898 static v8::Handle<v8::Value> overloadedActivityLoggedMethod2Method(const v8::Arg
uments& args) | |
| 3899 { | |
| 3900 if (args.Length() < 2) | |
| 3901 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3902 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3903 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3904 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3905 imp->overloadedActivityLoggedMethod(strArg, longArg); | |
| 3906 return v8Undefined(); | |
| 3907 } | |
| 3908 | |
| 3909 static v8::Handle<v8::Value> overloadedActivityLoggedMethod2MethodForMainWorld(c
onst v8::Arguments& args) | |
| 3910 { | |
| 3911 if (args.Length() < 2) | |
| 3912 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3913 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3914 V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]); | |
| 3915 V8TRYCATCH(int, longArg, toInt32(args[1])); | |
| 3916 imp->overloadedActivityLoggedMethod(strArg, longArg); | |
| 3917 return v8Undefined(); | |
| 3918 } | |
| 3919 | |
| 3920 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethod(const v8::Argu
ments& args) | |
| 3921 { | |
| 3922 if (args.Length() == 1) | |
| 3923 return overloadedActivityLoggedMethod1Method(args); | |
| 3924 if (args.Length() == 2) | |
| 3925 return overloadedActivityLoggedMethod2Method(args); | |
| 3926 if (args.Length() < 1) | |
| 3927 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3928 return throwTypeError(0, args.GetIsolate()); | |
| 3929 } | |
| 3930 | |
| 3931 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethodForMainWorld(co
nst v8::Arguments& args) | |
| 3932 { | |
| 3933 if (args.Length() == 1) | |
| 3934 return overloadedActivityLoggedMethod1MethodForMainWorld(args); | |
| 3935 if (args.Length() == 2) | |
| 3936 return overloadedActivityLoggedMethod2MethodForMainWorld(args); | |
| 3937 if (args.Length() < 1) | |
| 3938 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3939 return throwTypeError(0, args.GetIsolate()); | |
| 3940 } | |
| 3941 | |
| 3942 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethodCallback(const
v8::Arguments& args) | |
| 3943 { | |
| 3944 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
| 3945 if (contextData && contextData->activityLogger()) { | |
| 3946 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
| 3947 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", args.Length(), loggerArgs.data(), "Method"); | |
| 3948 } | |
| 3949 return TestObjV8Internal::overloadedActivityLoggedMethodMethod(args); | |
| 3950 } | |
| 3951 | |
| 3952 static v8::Handle<v8::Value> overloadedActivityLoggedMethodMethodCallbackForMain
World(const v8::Arguments& args) | |
| 3953 { | |
| 3954 V8PerContextData* contextData = V8PerContextData::from(args.GetIsolate()->Ge
tCurrentContext()); | |
| 3955 if (contextData && contextData->activityLogger()) { | |
| 3956 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(args); | |
| 3957 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", args.Length(), loggerArgs.data(), "Method"); | |
| 3958 } | |
| 3959 return TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(a
rgs); | |
| 3960 } | |
| 3961 | |
| 3962 static v8::Handle<v8::Value> deprecatedMethodMethod(const v8::Arguments& args) | |
| 3963 { | |
| 3964 TestObj* imp = V8TestObj::toNative(args.Holder()); | |
| 3965 imp->deprecatedMethod(); | |
| 3966 return v8Undefined(); | |
| 3967 } | |
| 3968 | |
| 3969 static v8::Handle<v8::Value> deprecatedMethodMethodCallback(const v8::Arguments&
args) | |
| 3970 { | |
| 3971 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::Method); | |
| 3972 return TestObjV8Internal::deprecatedMethodMethod(args); | |
| 3973 } | |
| 3974 | |
| 3975 static v8::Handle<v8::Value> deprecatedStaticMethodMethod(const v8::Arguments& a
rgs) | |
| 3976 { | |
| 3977 TestObj::deprecatedStaticMethod(); | |
| 3978 return v8Undefined(); | |
| 3979 } | |
| 3980 | |
| 3981 static v8::Handle<v8::Value> deprecatedStaticMethodMethodCallback(const v8::Argu
ments& args) | |
| 3982 { | |
| 3983 UseCounter::countDeprecation(activeDOMWindow(), UseCounter::StaticMethod); | |
| 3984 return TestObjV8Internal::deprecatedStaticMethodMethod(args); | |
| 3985 } | |
| 3986 | |
| 3987 static v8::Handle<v8::Value> constructor(const v8::Arguments& args) | |
| 3988 { | |
| 3989 if (args.Length() < 1) | |
| 3990 return throwNotEnoughArgumentsError(args.GetIsolate()); | |
| 3991 if (args.Length() <= 0 || !args[0]->IsFunction()) | |
| 3992 return throwTypeError(0, args.GetIsolate()); | |
| 3993 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScrip
tExecutionContext()); | |
| 3994 | |
| 3995 RefPtr<TestObj> impl = TestObj::create(testCallback); | |
| 3996 v8::Handle<v8::Object> wrapper = args.Holder(); | |
| 3997 | |
| 3998 V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestObj::info, w
rapper, args.GetIsolate(), WrapperConfiguration::Dependent); | |
| 3999 return wrapper; | |
| 4000 } | |
| 4001 | |
| 4002 } // namespace TestObjV8Internal | |
| 4003 | |
| 4004 static const V8DOMConfiguration::BatchedAttribute V8TestObjAttrs[] = { | |
| 4005 // Attribute 'readOnlyLongAttr' (Type: 'attribute' ExtAttr: '') | |
| 4006 {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4007 // Attribute 'readOnlyStringAttr' (Type: 'attribute' ExtAttr: '') | |
| 4008 {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttrGetterCallba
ck, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), stati
c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4009 // Attribute 'readOnlyTestObjAttr' (Type: 'attribute' ExtAttr: '') | |
| 4010 {"readOnlyTestObjAttr", TestObjV8Internal::readOnlyTestObjAttrAttrGetterCall
back, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4011 // Attribute 'staticReadOnlyLongAttr' (Type: 'attribute' ExtAttr: '') | |
| 4012 {"staticReadOnlyLongAttr", TestObjV8Internal::staticReadOnlyLongAttrAttrGett
erCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT
), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4013 // Attribute 'staticStringAttr' (Type: 'attribute' ExtAttr: '') | |
| 4014 {"staticStringAttr", TestObjV8Internal::staticStringAttrAttrGetterCallback,
TestObjV8Internal::staticStringAttrAttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
| 4015 // Attribute 'TestSubObj' (Type: 'attribute' ExtAttr: '') | |
| 4016 {"TestSubObj", TestObjV8Internal::TestObjConstructorGetter, 0, 0, 0, &V8Test
SubObj::info, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope
rtyAttribute>(v8::None | v8::DontEnum), 0 /* on instance */}, | |
| 4017 // Attribute 'enumAttr' (Type: 'attribute' ExtAttr: '') | |
| 4018 {"enumAttr", TestObjV8Internal::enumAttrAttrGetterCallback, TestObjV8Interna
l::enumAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instanc
e */}, | |
| 4019 // Attribute 'readOnlyEnumAttr' (Type: 'attribute' ExtAttr: '') | |
| 4020 {"readOnlyEnumAttr", TestObjV8Internal::readOnlyEnumAttrAttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4021 // Attribute 'shortAttr' (Type: 'attribute' ExtAttr: '') | |
| 4022 {"shortAttr", TestObjV8Internal::shortAttrAttrGetterCallback, TestObjV8Inter
nal::shortAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on inst
ance */}, | |
| 4023 // Attribute 'unsignedShortAttr' (Type: 'attribute' ExtAttr: '') | |
| 4024 {"unsignedShortAttr", TestObjV8Internal::unsignedShortAttrAttrGetterCallback
, TestObjV8Internal::unsignedShortAttrAttrSetterCallback, 0, 0, 0 /* no data */,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>
(v8::None), 0 /* on instance */}, | |
| 4025 // Attribute 'longAttr' (Type: 'attribute' ExtAttr: '') | |
| 4026 {"longAttr", TestObjV8Internal::longAttrAttrGetterCallback, TestObjV8Interna
l::longAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instanc
e */}, | |
| 4027 // Attribute 'longLongAttr' (Type: 'attribute' ExtAttr: '') | |
| 4028 {"longLongAttr", TestObjV8Internal::longLongAttrAttrGetterCallback, TestObjV
8Internal::longLongAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | |
| 4029 // Attribute 'unsignedLongLongAttr' (Type: 'attribute' ExtAttr: '') | |
| 4030 {"unsignedLongLongAttr", TestObjV8Internal::unsignedLongLongAttrAttrGetterCa
llback, TestObjV8Internal::unsignedLongLongAttrAttrSetterCallback, 0, 0, 0 /* no
data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA
ttribute>(v8::None), 0 /* on instance */}, | |
| 4031 // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '') | |
| 4032 {"stringAttr", TestObjV8Internal::stringAttrAttrGetterCallback, TestObjV8Int
ernal::stringAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
| 4033 // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: 'MeasureAs') | |
| 4034 {"testObjAttr", TestObjV8Internal::testObjAttrAttrGetterCallback, TestObjV8I
nternal::testObjAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::A
ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o
n instance */}, | |
| 4035 // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '') | |
| 4036 {"XMLObjAttr", TestObjV8Internal::XMLObjAttrAttrGetterCallback, TestObjV8Int
ernal::XMLObjAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
| 4037 // Attribute 'create' (Type: 'attribute' ExtAttr: '') | |
| 4038 {"create", TestObjV8Internal::createAttrGetterCallback, TestObjV8Internal::c
reateAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v
8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4039 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 4040 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttrGetterCall
back, TestObjV8Internal::reflectedStringAttrAttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
| 4041 // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 4042 {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttrGetter
Callback, TestObjV8Internal::reflectedIntegralAttrAttrSetterCallback, 0, 0, 0 /*
no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}, | |
| 4043 // Attribute 'reflectedUnsignedIntegralAttr' (Type: 'attribute' ExtAttr: 'Re
flect') | |
| 4044 {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegr
alAttrAttrGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4045 // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 4046 {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttrGetterCa
llback, TestObjV8Internal::reflectedBooleanAttrAttrSetterCallback, 0, 0, 0 /* no
data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA
ttribute>(v8::None), 0 /* on instance */}, | |
| 4047 // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'URL Reflect') | |
| 4048 {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttrGetterCallback,
TestObjV8Internal::reflectedURLAttrAttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
| 4049 // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect') | |
| 4050 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttrGetterCall
back, TestObjV8Internal::reflectedStringAttrAttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
| 4051 // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Refl
ect') | |
| 4052 {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAt
trAttrGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttrSetterCa
llback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), stat
ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4053 // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Refle
ct') | |
| 4054 {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttr
AttrGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttrSetterCallb
ack, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_
cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4055 // Attribute 'reflectedCustomURLAttr' (Type: 'attribute' ExtAttr: 'URL Refle
ct') | |
| 4056 {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttrGett
erCallback, TestObjV8Internal::reflectedCustomURLAttrAttrSetterCallback, 0, 0, 0
/* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4057 // Attribute 'typedArrayAttr' (Type: 'attribute' ExtAttr: '') | |
| 4058 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttrGetterCallback, Test
ObjV8Internal::typedArrayAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | |
| 4059 // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: 'GetterRa
isesException') | |
| 4060 {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttrGe
tterCallback, TestObjV8Internal::attrWithGetterExceptionAttrSetterCallback, 0, 0
, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::
PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4061 // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: 'SetterRa
isesException') | |
| 4062 {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttrGe
tterCallback, TestObjV8Internal::attrWithSetterExceptionAttrSetterCallback, 0, 0
, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::
PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4063 // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: 'Ge
tterRaisesException') | |
| 4064 {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExc
eptionAttrGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4065 // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: 'Se
tterRaisesException') | |
| 4066 {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExc
eptionAttrGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4067 // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom') | |
| 4068 {"customAttr", TestObjV8Internal::customAttrAttrGetterCallback, TestObjV8Int
ernal::customAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
| 4069 // Attribute 'withScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWit
h') | |
| 4070 {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttr
GetterCallback, TestObjV8Internal::withScriptStateAttributeAttrSetterCallback, 0
, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v
8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4071 // Attribute 'withScriptExecutionContextAttribute' (Type: 'attribute' ExtAtt
r: 'CallWith') | |
| 4072 {"withScriptExecutionContextAttribute", TestObjV8Internal::withScriptExecuti
onContextAttributeAttrGetterCallback, TestObjV8Internal::withScriptExecutionCont
extAttributeAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessCon
trol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instan
ce */}, | |
| 4073 // Attribute 'withScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'G
etterRaisesException CallWith') | |
| 4074 {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttribu
teRaisesAttrGetterCallback, TestObjV8Internal::withScriptStateAttributeRaisesAtt
rSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4075 // Attribute 'withScriptExecutionContextAttributeRaises' (Type: 'attribute'
ExtAttr: 'GetterRaisesException CallWith') | |
| 4076 {"withScriptExecutionContextAttributeRaises", TestObjV8Internal::withScriptE
xecutionContextAttributeRaisesAttrGetterCallback, TestObjV8Internal::withScriptE
xecutionContextAttributeRaisesAttrSetterCallback, 0, 0, 0 /* no data */, static_
cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::Non
e), 0 /* on instance */}, | |
| 4077 // Attribute 'withScriptExecutionContextAndScriptStateAttribute' (Type: 'att
ribute' ExtAttr: 'CallWith') | |
| 4078 {"withScriptExecutionContextAndScriptStateAttribute", TestObjV8Internal::wit
hScriptExecutionContextAndScriptStateAttributeAttrGetterCallback, TestObjV8Inter
nal::withScriptExecutionContextAndScriptStateAttributeAttrSetterCallback, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4079 // Attribute 'withScriptExecutionContextAndScriptStateAttributeRaises' (Type
: 'attribute' ExtAttr: 'GetterRaisesException CallWith') | |
| 4080 {"withScriptExecutionContextAndScriptStateAttributeRaises", TestObjV8Interna
l::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetterCallback, Te
stObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSett
erCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4081 // Attribute 'withScriptExecutionContextAndScriptStateWithSpacesAttribute' (
Type: 'attribute' ExtAttr: 'CallWith') | |
| 4082 {"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjV8Int
ernal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetterCall
back, TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttri
buteAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8
::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4083 // Attribute 'enforcedRangeLongAttr' (Type: 'attribute' ExtAttr: 'EnforceRan
ge') | |
| 4084 {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttrGetter
Callback, TestObjV8Internal::enforcedRangeLongAttrAttrSetterCallback, 0, 0, 0 /*
no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}, | |
| 4085 // Attribute 'enforcedRangeUnsignedLongAttr' (Type: 'attribute' ExtAttr: 'En
forceRange') | |
| 4086 {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLo
ngAttrAttrGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4087 // Attribute 'enforcedRangeLongLongAttr' (Type: 'attribute' ExtAttr: 'Enforc
eRange') | |
| 4088 {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAt
trGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttrSetterCallback
, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4089 // Attribute 'enforcedRangeUnsignedLongLongAttr' (Type: 'attribute' ExtAttr:
'EnforceRange') | |
| 4090 {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsign
edLongLongAttrAttrGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongLo
ngAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(
v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}
, | |
| 4091 #if ENABLE(Condition1) | |
| 4092 // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 4093 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttrGetterCallback,
TestObjV8Internal::conditionalAttr1AttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
| 4094 #endif // ENABLE(Condition1) | |
| 4095 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 4096 // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 4097 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttrGetterCallback,
TestObjV8Internal::conditionalAttr2AttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
| 4098 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 4099 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 4100 // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 4101 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttrGetterCallback,
TestObjV8Internal::conditionalAttr3AttrSetterCallback, 0, 0, 0 /* no data */, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | |
| 4102 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 4103 #if ENABLE(Condition1) | |
| 4104 // Attribute 'conditionalAttr4' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 4105 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectA::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one | v8::DontEnum), 0 /* on instance */}, | |
| 4106 #endif // ENABLE(Condition1) | |
| 4107 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 4108 // Attribute 'conditionalAttr5' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 4109 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectB::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one | v8::DontEnum), 0 /* on instance */}, | |
| 4110 #endif // ENABLE(Condition1) && ENABLE(Condition2) | |
| 4111 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 4112 // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional') | |
| 4113 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectC::info, stati
c_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::N
one | v8::DontEnum), 0 /* on instance */}, | |
| 4114 #endif // ENABLE(Condition1) || ENABLE(Condition2) | |
| 4115 // Attribute 'cachedAttribute1' (Type: 'attribute' ExtAttr: 'CachedAttribute
') | |
| 4116 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4117 // Attribute 'cachedAttribute2' (Type: 'attribute' ExtAttr: 'CachedAttribute
') | |
| 4118 {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttrGetterCallback,
0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_ca
st<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4119 // Attribute 'anyAttribute' (Type: 'attribute' ExtAttr: '') | |
| 4120 {"anyAttribute", TestObjV8Internal::anyAttributeAttrGetterCallback, TestObjV
8Internal::anyAttributeAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | |
| 4121 // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '') | |
| 4122 {"floatArray", TestObjV8Internal::floatArrayAttrGetterCallback, TestObjV8Int
ernal::floatArrayAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
| 4123 // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '') | |
| 4124 {"doubleArray", TestObjV8Internal::doubleArrayAttrGetterCallback, TestObjV8I
nternal::doubleArrayAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::A
ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o
n instance */}, | |
| 4125 // Attribute 'contentDocument' (Type: 'attribute' ExtAttr: 'CheckSecurityFor
Node') | |
| 4126 {"contentDocument", TestObjV8Internal::contentDocumentAttrGetterCallback, 0,
0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4127 // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '') | |
| 4128 {"mutablePoint", TestObjV8Internal::mutablePointAttrGetterCallback, TestObjV
8Internal::mutablePointAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | |
| 4129 // Attribute 'immutablePoint' (Type: 'attribute' ExtAttr: 'Immutable') | |
| 4130 {"immutablePoint", TestObjV8Internal::immutablePointAttrGetterCallback, Test
ObjV8Internal::immutablePointAttrSetterCallback, 0, 0, 0 /* no data */, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | |
| 4131 // Attribute 'strawberry' (Type: 'attribute' ExtAttr: 'ImplementedAs') | |
| 4132 {"strawberry", TestObjV8Internal::strawberryAttrGetterCallback, TestObjV8Int
ernal::strawberryAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | |
| 4133 // Attribute 'strictFloat' (Type: 'attribute' ExtAttr: 'StrictTypeChecking') | |
| 4134 {"strictFloat", TestObjV8Internal::strictFloatAttrGetterCallback, TestObjV8I
nternal::strictFloatAttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::A
ccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* o
n instance */}, | |
| 4135 // Attribute 'description' (Type: 'attribute' ExtAttr: '') | |
| 4136 {"description", TestObjV8Internal::descriptionAttrGetterCallback, 0, 0, 0, 0
/* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4137 // Attribute 'id' (Type: 'attribute' ExtAttr: '') | |
| 4138 {"id", TestObjV8Internal::idAttrGetterCallback, TestObjV8Internal::idAttrSet
terCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4139 // Attribute 'hash' (Type: 'attribute' ExtAttr: '') | |
| 4140 {"hash", TestObjV8Internal::hashAttrGetterCallback, 0, 0, 0, 0 /* no data */
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, | |
| 4141 // Attribute 'replaceableAttribute' (Type: 'attribute' ExtAttr: 'Replaceable
') | |
| 4142 {"replaceableAttribute", TestObjV8Internal::replaceableAttributeAttrGetterCa
llback, TestObjV8Internal::TestObjReplaceableAttrSetterCallback, 0, 0, 0 /* no d
ata */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAtt
ribute>(v8::None), 0 /* on instance */}, | |
| 4143 // Attribute 'nullableDoubleAttribute' (Type: 'attribute' ExtAttr: '') | |
| 4144 {"nullableDoubleAttribute", TestObjV8Internal::nullableDoubleAttributeAttrGe
tterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4145 // Attribute 'nullableLongAttribute' (Type: 'attribute' ExtAttr: '') | |
| 4146 {"nullableLongAttribute", TestObjV8Internal::nullableLongAttributeAttrGetter
Callback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4147 // Attribute 'nullableBooleanAttribute' (Type: 'attribute' ExtAttr: '') | |
| 4148 {"nullableBooleanAttribute", TestObjV8Internal::nullableBooleanAttributeAttr
GetterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEF
AULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4149 // Attribute 'nullableStringAttribute' (Type: 'attribute' ExtAttr: '') | |
| 4150 {"nullableStringAttribute", TestObjV8Internal::nullableStringAttributeAttrGe
tterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4151 // Attribute 'nullableLongSettableAttribute' (Type: 'attribute' ExtAttr: '') | |
| 4152 {"nullableLongSettableAttribute", TestObjV8Internal::nullableLongSettableAtt
ributeAttrGetterCallback, TestObjV8Internal::nullableLongSettableAttributeAttrSe
tterCallback, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4153 // Attribute 'nullableStringValue' (Type: 'attribute' ExtAttr: 'GetterRaises
Exception') | |
| 4154 {"nullableStringValue", TestObjV8Internal::nullableStringValueAttrGetterCall
back, TestObjV8Internal::nullableStringValueAttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
| 4155 // Attribute 'perWorldReadOnlyAttribute' (Type: 'attribute' ExtAttr: 'PerWor
ldBindings') | |
| 4156 {"perWorldReadOnlyAttribute", TestObjV8Internal::perWorldReadOnlyAttributeAt
trGetterCallback, 0, TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterCallb
ackForMainWorld, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4157 // Attribute 'perWorldAttribute' (Type: 'attribute' ExtAttr: 'PerWorldBindin
gs') | |
| 4158 {"perWorldAttribute", TestObjV8Internal::perWorldAttributeAttrGetterCallback
, TestObjV8Internal::perWorldAttributeAttrSetterCallback, TestObjV8Internal::per
WorldAttributeAttrGetterCallbackForMainWorld, TestObjV8Internal::perWorldAttribu
teAttrSetterCallbackForMainWorld, 0 /* no data */, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, | |
| 4159 // Attribute 'activityLoggedAttr1' (Type: 'attribute' ExtAttr: 'ActivityLog'
) | |
| 4160 {"activityLoggedAttr1", TestObjV8Internal::activityLoggedAttr1AttrGetterCall
back, TestObjV8Internal::activityLoggedAttr1AttrSetterCallback, 0, 0, 0 /* no da
ta */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | |
| 4161 // Attribute 'activityLoggedAttr2' (Type: 'attribute' ExtAttr: 'PerWorldBind
ings ActivityLog') | |
| 4162 {"activityLoggedAttr2", TestObjV8Internal::activityLoggedAttr2AttrGetterCall
back, TestObjV8Internal::activityLoggedAttr2AttrSetterCallback, TestObjV8Interna
l::activityLoggedAttr2AttrGetterCallbackForMainWorld, TestObjV8Internal::activit
yLoggedAttr2AttrSetterCallbackForMainWorld, 0 /* no data */, static_cast<v8::Acc
essControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | |
| 4163 // Attribute 'activityLoggedInIsolatedWorldsAttr' (Type: 'attribute' ExtAttr
: 'PerWorldBindings ActivityLog') | |
| 4164 {"activityLoggedInIsolatedWorldsAttr", TestObjV8Internal::activityLoggedInIs
olatedWorldsAttrAttrGetterCallback, TestObjV8Internal::activityLoggedInIsolatedW
orldsAttrAttrSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAt
trAttrGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWor
ldsAttrAttrSetterCallbackForMainWorld, 0 /* no data */, static_cast<v8::AccessCo
ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on insta
nce */}, | |
| 4165 // Attribute 'activityLoggedAttrSetter1' (Type: 'attribute' ExtAttr: 'Activi
tyLog') | |
| 4166 {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1At
trGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttrSetterCallback
, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4167 // Attribute 'activityLoggedAttrSetter2' (Type: 'attribute' ExtAttr: 'PerWor
ldBindings ActivityLog') | |
| 4168 {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2At
trGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttrSetterCallback
, TestObjV8Internal::activityLoggedAttrSetter2AttrGetterCallbackForMainWorld, Te
stObjV8Internal::activityLoggedAttrSetter2AttrSetterCallbackForMainWorld, 0 /* n
o data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, | |
| 4169 // Attribute 'activityLoggedInIsolatedWorldsAttrSetter' (Type: 'attribute' E
xtAttr: 'PerWorldBindings ActivityLog') | |
| 4170 {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLogg
edInIsolatedWorldsAttrSetterAttrGetterCallback, TestObjV8Internal::activityLogge
dInIsolatedWorldsAttrSetterAttrSetterCallback, TestObjV8Internal::activityLogged
InIsolatedWorldsAttrSetterAttrGetterCallbackForMainWorld, TestObjV8Internal::act
ivityLoggedInIsolatedWorldsAttrSetterAttrSetterCallbackForMainWorld, 0 /* no dat
a */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, | |
| 4171 // Attribute 'activityLoggedAttrGetter1' (Type: 'attribute' ExtAttr: 'Activi
tyLog') | |
| 4172 {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1At
trGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttrSetterCallback
, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4173 // Attribute 'activityLoggedAttrGetter2' (Type: 'attribute' ExtAttr: 'PerWor
ldBindings ActivityLog') | |
| 4174 {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2At
trGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttrSetterCallback
, TestObjV8Internal::activityLoggedAttrGetter2AttrGetterCallbackForMainWorld, Te
stObjV8Internal::activityLoggedAttrGetter2AttrSetterCallbackForMainWorld, 0 /* n
o data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, | |
| 4175 // Attribute 'activityLoggedInIsolatedWorldsAttrGetter' (Type: 'attribute' E
xtAttr: 'PerWorldBindings ActivityLog') | |
| 4176 {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLogg
edInIsolatedWorldsAttrGetterAttrGetterCallback, TestObjV8Internal::activityLogge
dInIsolatedWorldsAttrGetterAttrSetterCallback, TestObjV8Internal::activityLogged
InIsolatedWorldsAttrGetterAttrGetterCallbackForMainWorld, TestObjV8Internal::act
ivityLoggedInIsolatedWorldsAttrGetterAttrSetterCallbackForMainWorld, 0 /* no dat
a */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, | |
| 4177 // Attribute 'deprecatedStaticReadOnlyAttr' (Type: 'attribute' ExtAttr: 'Dep
recateAs') | |
| 4178 {"deprecatedStaticReadOnlyAttr", TestObjV8Internal::deprecatedStaticReadOnly
AttrAttrGetterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}, | |
| 4179 // Attribute 'deprecatedStaticAttr' (Type: 'attribute' ExtAttr: 'DeprecateAs
') | |
| 4180 {"deprecatedStaticAttr", TestObjV8Internal::deprecatedStaticAttrAttrGetterCa
llback, TestObjV8Internal::deprecatedStaticAttrAttrSetterCallback, 0, 0, 0 /* no
data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyA
ttribute>(v8::None), 0 /* on instance */}, | |
| 4181 // Attribute 'deprecatedReadonlyAttr' (Type: 'attribute' ExtAttr: 'Deprecate
As') | |
| 4182 {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttrGett
erCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT
), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
| 4183 // Attribute 'deprecatedAttr' (Type: 'attribute' ExtAttr: 'DeprecateAs') | |
| 4184 {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttrGetterCallback, Test
ObjV8Internal::deprecatedAttrAttrSetterCallback, 0, 0, 0 /* no data */, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | |
| 4185 }; | |
| 4186 | |
| 4187 static const V8DOMConfiguration::BatchedMethod V8TestObjMethods[] = { | |
| 4188 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, | |
| 4189 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, | |
| 4190 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0}, | |
| 4191 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCall
back, 0, 1}, | |
| 4192 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod
Callback, 0, 1}, | |
| 4193 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0,
1}, | |
| 4194 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1}, | |
| 4195 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1}, | |
| 4196 {"namedItem", TestObjV8Internal::namedItemMethodCallback, 0, 1}, | |
| 4197 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback
, 0, 0}, | |
| 4198 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0}, | |
| 4199 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba
ck, 0, 3}, | |
| 4200 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2
}, | |
| 4201 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback
, 0, 2}, | |
| 4202 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback
, 0, 0}, | |
| 4203 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback,
0, 0}, | |
| 4204 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep
tionMethodCallback, 0, 0}, | |
| 4205 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti
onMethodCallback, 0, 0}, | |
| 4206 {"withScriptExecutionContext", TestObjV8Internal::withScriptExecutionContext
MethodCallback, 0, 0}, | |
| 4207 {"withScriptExecutionContextAndScriptState", TestObjV8Internal::withScriptEx
ecutionContextAndScriptStateMethodCallback, 0, 0}, | |
| 4208 {"withScriptExecutionContextAndScriptStateObjException", TestObjV8Internal::
withScriptExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0}, | |
| 4209 {"withScriptExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::wi
thScriptExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0}, | |
| 4210 {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCall
back, 0, 0}, | |
| 4211 {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonO
ptionalArgAndOptionalArgMethodCallback, 0, 1}, | |
| 4212 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWith
NonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1}, | |
| 4213 {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMeth
odCallback, 0, 0}, | |
| 4214 {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptiona
lStringIsUndefinedMethodCallback, 0, 0}, | |
| 4215 {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOption
alStringIsNullStringMethodCallback, 0, 0}, | |
| 4216 {"methodWithCallbackArg", TestObjV8Internal::methodWithCallbackArgMethodCall
back, 0, 1}, | |
| 4217 {"methodWithNonCallbackArgAndCallbackArg", TestObjV8Internal::methodWithNonC
allbackArgAndCallbackArgMethodCallback, 0, 2}, | |
| 4218 {"methodWithCallbackAndOptionalArg", TestObjV8Internal::methodWithCallbackAn
dOptionalArgMethodCallback, 0, 0}, | |
| 4219 {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt
32MethodCallback, 0, 1}, | |
| 4220 {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUI
nt32MethodCallback, 0, 1}, | |
| 4221 {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt
64MethodCallback, 0, 1}, | |
| 4222 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI
nt64MethodCallback, 0, 1}, | |
| 4223 #if ENABLE(Condition1) | |
| 4224 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback,
0, 0}, | |
| 4225 #endif | |
| 4226 #if ENABLE(Condition1) && ENABLE(Condition2) | |
| 4227 {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback,
0, 0}, | |
| 4228 #endif | |
| 4229 #if ENABLE(Condition1) || ENABLE(Condition2) | |
| 4230 {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback,
0, 0}, | |
| 4231 #endif | |
| 4232 {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 2
}, | |
| 4233 {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallba
ck, 0, 2}, | |
| 4234 {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLong
SequenceMethodCallback, 0, 1}, | |
| 4235 {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback
, 0, 1}, | |
| 4236 {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0}, | |
| 4237 {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallba
ck, 0, 0}, | |
| 4238 {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCa
llback, 0, 0}, | |
| 4239 {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0}, | |
| 4240 {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3}, | |
| 4241 {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallba
ck, 0, 2}, | |
| 4242 {"variadicDoubleMethod", TestObjV8Internal::variadicDoubleMethodMethodCallba
ck, 0, 2}, | |
| 4243 {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV
8Internal::perWorldMethodMethodCallbackForMainWorld, 0}, | |
| 4244 {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMeth
odCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorl
d, 1}, | |
| 4245 {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCall
back, 0, 1}, | |
| 4246 {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCall
back, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1}, | |
| 4247 {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInI
solatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWor
ldMethodMethodCallbackForMainWorld, 1}, | |
| 4248 {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLogg
edMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodC
allbackForMainWorld, 1}, | |
| 4249 {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0
}, | |
| 4250 }; | |
| 4251 | |
| 4252 static const V8DOMConfiguration::BatchedConstant V8TestObjConsts[] = { | |
| 4253 #if ENABLE(Condition1) | |
| 4254 {"CONDITIONAL_CONST", 0}, | |
| 4255 #endif | |
| 4256 {"CONST_VALUE_0", 0}, | |
| 4257 {"CONST_VALUE_1", 1}, | |
| 4258 {"CONST_VALUE_2", 2}, | |
| 4259 {"CONST_VALUE_4", 4}, | |
| 4260 {"CONST_VALUE_8", 8}, | |
| 4261 {"CONST_VALUE_9", -1}, | |
| 4262 {"CONST_VALUE_10", "my constant string"}, | |
| 4263 {"CONST_VALUE_11", -1}, | |
| 4264 {"CONST_VALUE_12", 1}, | |
| 4265 {"CONST_VALUE_13", 0X20}, | |
| 4266 {"CONST_VALUE_14", 6844}, | |
| 4267 {"CONST_JAVASCRIPT", 15}, | |
| 4268 {"DEPRECATED_CONSTANT", 1}, | |
| 4269 }; | |
| 4270 | |
| 4271 | |
| 4272 #if ENABLE(Condition1) | |
| 4273 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWr
ongUseDoNotCheckConstants); | |
| 4274 #endif | |
| 4275 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDo
NotCheckConstants); | |
| 4276 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDo
NotCheckConstants); | |
| 4277 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDo
NotCheckConstants); | |
| 4278 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDo
NotCheckConstants); | |
| 4279 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDo
NotCheckConstants); | |
| 4280 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseD
oNotCheckConstants); | |
| 4281 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST
_VALUE_10IsWrongUseDoNotCheckConstants); | |
| 4282 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11I
sWrongUseDoNotCheckConstants); | |
| 4283 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrong
UseDoNotCheckConstants); | |
| 4284 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrong
UseDoNotCheckConstants); | |
| 4285 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWro
ngUseDoNotCheckConstants); | |
| 4286 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCh
eckConstants); | |
| 4287 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TestObjEnumDEPRECATED_CONSTANT
IsWrongUseDoNotCheckConstants); | |
| 4288 | |
| 4289 v8::Handle<v8::Value> V8TestObj::constructorCallback(const v8::Arguments& args) | |
| 4290 { | |
| 4291 if (!args.IsConstructCall()) | |
| 4292 return throwTypeError("DOM object constructor cannot be called as a func
tion.", args.GetIsolate()); | |
| 4293 | |
| 4294 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) | |
| 4295 return args.Holder(); | |
| 4296 | |
| 4297 return TestObjV8Internal::constructor(args); | |
| 4298 } | |
| 4299 | |
| 4300 v8::Handle<v8::Value> V8TestObj::indexedPropertyGetter(uint32_t index, const v8:
:AccessorInfo& info) | |
| 4301 { | |
| 4302 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | |
| 4303 TestObj* collection = toNative(info.Holder()); | |
| 4304 RefPtr<Node> element = collection->item(index); | |
| 4305 if (!element) | |
| 4306 return v8Undefined(); | |
| 4307 return toV8Fast(element.release(), info, collection); | |
| 4308 } | |
| 4309 | |
| 4310 v8::Handle<v8::Value> V8TestObj::namedPropertyGetter(v8::Local<v8::String> name,
const v8::AccessorInfo& info) | |
| 4311 { | |
| 4312 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | |
| 4313 return v8Undefined(); | |
| 4314 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 4315 return v8Undefined(); | |
| 4316 | |
| 4317 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | |
| 4318 TestObj* collection = toNative(info.Holder()); | |
| 4319 AtomicString propertyName = toWebCoreAtomicString(name); | |
| 4320 String element = collection->namedItem(propertyName); | |
| 4321 if (element.isNull()) | |
| 4322 return v8Undefined(); | |
| 4323 return v8String(element, info.GetIsolate()); | |
| 4324 } | |
| 4325 | |
| 4326 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
stent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType current
WorldType) | |
| 4327 { | |
| 4328 desc->ReadOnlyPrototype(); | |
| 4329 | |
| 4330 v8::Local<v8::Signature> defaultSignature; | |
| 4331 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject",
v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount, | |
| 4332 V8TestObjAttrs, WTF_ARRAY_LENGTH(V8TestObjAttrs), | |
| 4333 V8TestObjMethods, WTF_ARRAY_LENGTH(V8TestObjMethods), isolate, currentWo
rldType); | |
| 4334 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | |
| 4335 desc->SetCallHandler(V8TestObj::constructorCallback); | |
| 4336 desc->SetLength(1); | |
| 4337 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | |
| 4338 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); | |
| 4339 UNUSED_PARAM(instance); // In some cases, it will not be used. | |
| 4340 UNUSED_PARAM(proto); // In some cases, it will not be used. | |
| 4341 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) { | |
| 4342 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 4343 // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'Enable
dAtRuntime') | |
| 4344 {"enabledAtRuntimeAttr1", TestObjV8Internal::enabledAtRuntimeAttr1AttrGe
tterCallback, TestObjV8Internal::enabledAtRuntimeAttr1AttrSetterCallback, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}; | |
| 4345 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | |
| 4346 } | |
| 4347 if (RuntimeEnabledFeatures::featureNameEnabled()) { | |
| 4348 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 4349 // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'Enable
dAtRuntime') | |
| 4350 {"enabledAtRuntimeAttr2", TestObjV8Internal::enabledAtRuntimeAttr2AttrGe
tterCallback, TestObjV8Internal::enabledAtRuntimeAttr2AttrSetterCallback, 0, 0,
0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}; | |
| 4351 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | |
| 4352 } | |
| 4353 desc->InstanceTemplate()->SetIndexedPropertyHandler(V8TestObj::indexedProper
tyGetter, 0, 0, 0, nodeCollectionIndexedPropertyEnumerator<TestObj>); | |
| 4354 desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestObj::namedPropertyGe
tter, 0, 0, 0, 0); | |
| 4355 | |
| 4356 // Custom Signature 'voidMethodWithArgs' | |
| 4357 const int voidMethodWithArgsArgc = 3; | |
| 4358 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType)
}; | |
| 4359 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(d
esc, voidMethodWithArgsArgc, voidMethodWithArgsArgv); | |
| 4360 proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMe
thodWithArgsSignature, 3)); | |
| 4361 | |
| 4362 // Custom Signature 'longMethodWithArgs' | |
| 4363 const int longMethodWithArgsArgc = 3; | |
| 4364 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType)
}; | |
| 4365 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(d
esc, longMethodWithArgsArgc, longMethodWithArgsArgv); | |
| 4366 proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMe
thodWithArgsSignature, 3)); | |
| 4367 | |
| 4368 // Custom Signature 'objMethodWithArgs' | |
| 4369 const int objMethodWithArgsArgc = 3; | |
| 4370 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc
] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8
PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType) }
; | |
| 4371 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(de
sc, objMethodWithArgsArgc, objMethodWithArgsArgv); | |
| 4372 proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate:
:New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMetho
dWithArgsSignature, 3)); | |
| 4373 | |
| 4374 // Custom Signature 'methodThatRequiresAllArgsAndThrows' | |
| 4375 const int methodThatRequiresAllArgsAndThrowsArgc = 2; | |
| 4376 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[meth
odThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8Pe
rIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, currentWorldType) }; | |
| 4377 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::
Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresA
llArgsAndThrowsArgv); | |
| 4378 proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::
FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMetho
dCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2)); | |
| 4379 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v
8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalA
rgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); | |
| 4380 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::Function
Template::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Un
defined(), v8::Local<v8::Signature>(), 1)); | |
| 4381 desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(Te
stObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signatu
re>(), 0)); | |
| 4382 desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemp
late::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(
), v8::Local<v8::Signature>(), 0)); | |
| 4383 desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(T
estObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signa
ture>(), 1)); | |
| 4384 #if ENABLE(Condition1) | |
| 4385 desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::
New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local
<v8::Signature>(), 1)); | |
| 4386 #endif // ENABLE(Condition1) | |
| 4387 if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled()) | |
| 4388 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod1"), v8::Functio
nTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod1MethodCallback, v8Undef
ined(), defaultSignature, 1)); | |
| 4389 if (RuntimeEnabledFeatures::featureNameEnabled()) | |
| 4390 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod2"), v8::Functio
nTemplate::New(TestObjV8Internal::enabledAtRuntimeMethod2MethodCallback, v8Undef
ined(), defaultSignature, 1)); | |
| 4391 | |
| 4392 // Custom Signature 'domStringListFunction' | |
| 4393 const int domStringListFunctionArgc = 1; | |
| 4394 v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunc
tionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::inf
o, currentWorldType) }; | |
| 4395 v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::Ne
w(desc, domStringListFunctionArgc, domStringListFunctionArgv); | |
| 4396 proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTempl
ate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(),
domStringListFunctionSignature, 1)); | |
| 4397 | |
| 4398 // Custom Signature 'convert1' | |
| 4399 const int convert1Argc = 1; | |
| 4400 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
| 4401 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, conve
rt1Argc, convert1Argv); | |
| 4402 proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1)); | |
| 4403 | |
| 4404 // Custom Signature 'convert2' | |
| 4405 const int convert2Argc = 1; | |
| 4406 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
| 4407 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, conve
rt2Argc, convert2Argv); | |
| 4408 proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1)); | |
| 4409 | |
| 4410 // Custom Signature 'convert4' | |
| 4411 const int convert4Argc = 1; | |
| 4412 v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
| 4413 v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, conve
rt4Argc, convert4Argv); | |
| 4414 proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert4MethodCallback, v8Undefined(), convert4Signature, 1)); | |
| 4415 | |
| 4416 // Custom Signature 'convert5' | |
| 4417 const int convert5Argc = 1; | |
| 4418 v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | |
| 4419 v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, conve
rt5Argc, convert5Argv); | |
| 4420 proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert5MethodCallback, v8Undefined(), convert5Signature, 1)); | |
| 4421 | |
| 4422 // Custom Signature 'variadicNodeMethod' | |
| 4423 const int variadicNodeMethodArgc = 2; | |
| 4424 v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodAr
gc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorld
Type), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorldT
ype) }; | |
| 4425 v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(d
esc, variadicNodeMethodArgc, variadicNodeMethodArgv); | |
| 4426 proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate
::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variad
icNodeMethodSignature, 2)); | |
| 4427 desc->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTempl
ate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(),
v8::Local<v8::Signature>(), 0)); | |
| 4428 V8DOMConfiguration::batchConfigureConstants(desc, proto, V8TestObjConsts, WT
F_ARRAY_LENGTH(V8TestObjConsts), isolate); | |
| 4429 | |
| 4430 // Custom toString template | |
| 4431 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | |
| 4432 return desc; | |
| 4433 } | |
| 4434 | |
| 4435 v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate(v8::Isolate* isolate
, WrapperWorldType currentWorldType) | |
| 4436 { | |
| 4437 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | |
| 4438 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | |
| 4439 if (result != data->templateMap(currentWorldType).end()) | |
| 4440 return result->value; | |
| 4441 | |
| 4442 v8::HandleScope handleScope; | |
| 4443 v8::Persistent<v8::FunctionTemplate> templ = | |
| 4444 ConfigureV8TestObjTemplate(data->rawTemplate(&info, currentWorldType), i
solate, currentWorldType); | |
| 4445 data->templateMap(currentWorldType).add(&info, templ); | |
| 4446 return templ; | |
| 4447 } | |
| 4448 | |
| 4449 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, W
rapperWorldType currentWorldType) | |
| 4450 { | |
| 4451 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWor
ldType); | |
| 4452 } | |
| 4453 | |
| 4454 bool V8TestObj::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate*
isolate) | |
| 4455 { | |
| 4456 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) | |
| 4457 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo
rld) | |
| 4458 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl
d); | |
| 4459 } | |
| 4460 | |
| 4461 void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, Tes
tObj* impl, v8::Isolate* isolate) | |
| 4462 { | |
| 4463 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); | |
| 4464 if (ContextFeatures::enabledPerContextAttr1Enabled(impl->document())) { | |
| 4465 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 4466 // Attribute 'enabledPerContextAttr1' (Type: 'attribute' ExtAttr: 'Enabl
edPerContext') | |
| 4467 {"enabledPerContextAttr1", TestObjV8Internal::enabledPerContextAttr1Attr
GetterCallback, TestObjV8Internal::enabledPerContextAttr1AttrSetterCallback, 0,
0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8:
:PropertyAttribute>(v8::None), 0 /* on instance */}; | |
| 4468 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e); | |
| 4469 } | |
| 4470 if (ContextFeatures::featureNameEnabled(impl->document())) { | |
| 4471 static const V8DOMConfiguration::BatchedAttribute attrData =\ | |
| 4472 // Attribute 'enabledPerContextAttr2' (Type: 'attribute' ExtAttr: 'Enabl
edPerContext') | |
| 4473 {"enabledPerContextAttr2", TestObjV8Internal::enabledPerContextAttr2Attr
GetterCallback, TestObjV8Internal::enabledPerContextAttr2AttrSetterCallback, 0,
0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8:
:PropertyAttribute>(v8::None), 0 /* on instance */}; | |
| 4474 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e); | |
| 4475 } | |
| 4476 } | |
| 4477 | |
| 4478 void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> prot
o, v8::Isolate* isolate) | |
| 4479 { | |
| 4480 UNUSED_PARAM(proto); | |
| 4481 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i
solate, worldType(isolate))); | |
| 4482 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | |
| 4483 | |
| 4484 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo
ntext()); | |
| 4485 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe
thod1Enabled(toDocument(context))) { | |
| 4486 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); | |
| 4487 } | |
| 4488 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) { | |
| 4489 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); | |
| 4490 } | |
| 4491 } | |
| 4492 | |
| 4493 | |
| 4494 v8::Handle<v8::Object> V8TestObj::createWrapper(PassRefPtr<TestObj> impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 4495 { | |
| 4496 ASSERT(impl.get()); | |
| 4497 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); | |
| 4498 | |
| 4499 #if ENABLE(BINDING_INTEGRITY) | |
| 4500 checkTypeOrDieTrying(impl.get()); | |
| 4501 #endif | |
| 4502 | |
| 4503 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, impl.get(), isolate); | |
| 4504 if (UNLIKELY(wrapper.IsEmpty())) | |
| 4505 return wrapper; | |
| 4506 | |
| 4507 installPerContextProperties(wrapper, impl.get(), isolate); | |
| 4508 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD
ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep
endent); | |
| 4509 return wrapper; | |
| 4510 } | |
| 4511 void V8TestObj::derefObject(void* object) | |
| 4512 { | |
| 4513 static_cast<TestObj*>(object)->deref(); | |
| 4514 } | |
| 4515 | |
| 4516 } // namespace WebCore | |
| OLD | NEW |