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

Side by Side Diff: Source/bindings/tests/results/V8TestObject.cpp

Issue 16708002: Simplify Custom Element constructors to be functions, not wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address morrita1's first round of feedback Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 1356
1357 static void anyAttributeAttrGetterCallback(v8::Local<v8::String> name, const v8: :PropertyCallbackInfo<v8::Value>& info) 1357 static void anyAttributeAttrGetterCallback(v8::Local<v8::String> name, const v8: :PropertyCallbackInfo<v8::Value>& info)
1358 { 1358 {
1359 TestObjV8Internal::anyAttributeAttrGetter(name, info); 1359 TestObjV8Internal::anyAttributeAttrGetter(name, info);
1360 } 1360 }
1361 1361
1362 static void anyAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val ue> value, const v8::PropertyCallbackInfo<void>& info) 1362 static void anyAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Val ue> value, const v8::PropertyCallbackInfo<void>& info)
1363 { 1363 {
1364 TestObj* imp = V8TestObject::toNative(info.Holder()); 1364 TestObj* imp = V8TestObject::toNative(info.Holder());
1365 V8TRYCATCH_VOID(ScriptValue, v, ScriptValue(value)); 1365 V8TRYCATCH_VOID(ScriptValue, v, ScriptValue(value));
1366 imp->setAnyAttribute(WTF::getPtr(v)); 1366 imp->setAnyAttribute(v);
1367 return; 1367 return;
1368 } 1368 }
1369 1369
1370 static void anyAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::Local <v8::Value> value, const v8::PropertyCallbackInfo<void>& info) 1370 static void anyAttributeAttrSetterCallback(v8::Local<v8::String> name, v8::Local <v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
1371 { 1371 {
1372 TestObjV8Internal::anyAttributeAttrSetter(name, value, info); 1372 TestObjV8Internal::anyAttributeAttrSetter(name, value, info);
1373 } 1373 }
1374 1374
1375 static void callbackFunctionAttributeAttrGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info)
1376 {
1377 TestObj* imp = V8TestObject::toNative(info.Holder());
1378 v8SetReturnValue(info, imp->callbackFunctionAttribute().v8Value());
1379 return;
1380 }
1381
1382 static void callbackFunctionAttributeAttrGetterCallback(v8::Local<v8::String> na me, const v8::PropertyCallbackInfo<v8::Value>& info)
1383 {
1384 TestObjV8Internal::callbackFunctionAttributeAttrGetter(name, info);
1385 }
1386
1387 static void callbackFunctionAttributeAttrSetter(v8::Local<v8::String> name, v8:: Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
1388 {
1389 TestObj* imp = V8TestObject::toNative(info.Holder());
1390 V8TRYCATCH_VOID(ScriptValue, v, ScriptValue(value));
1391 imp->setCallbackFunctionAttribute(v);
1392 return;
1393 }
1394
1395 static void callbackFunctionAttributeAttrSetterCallback(v8::Local<v8::String> na me, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
1396 {
1397 TestObjV8Internal::callbackFunctionAttributeAttrSetter(name, value, info);
1398 }
1399
1375 static void enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8 ::PropertyCallbackInfo<v8::Value>& info) 1400 static void enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8 ::PropertyCallbackInfo<v8::Value>& info)
1376 { 1401 {
1377 TestObj* imp = V8TestObject::toNative(info.Holder()); 1402 TestObj* imp = V8TestObject::toNative(info.Holder());
1378 v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr1()); 1403 v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr1());
1379 return; 1404 return;
1380 } 1405 }
1381 1406
1382 static void enabledAtRuntimeAttr1AttrGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 1407 static void enabledAtRuntimeAttr1AttrGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1383 { 1408 {
1384 TestObjV8Internal::enabledAtRuntimeAttr1AttrGetter(name, info); 1409 TestObjV8Internal::enabledAtRuntimeAttr1AttrGetter(name, info);
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after
3331 3356
3332 #if ENABLE(Condition1) || ENABLE(Condition2) 3357 #if ENABLE(Condition1) || ENABLE(Condition2)
3333 3358
3334 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& args) 3359 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& args)
3335 { 3360 {
3336 TestObjV8Internal::conditionalMethod3Method(args); 3361 TestObjV8Internal::conditionalMethod3Method(args);
3337 } 3362 }
3338 3363
3339 #endif // ENABLE(Condition1) || ENABLE(Condition2) 3364 #endif // ENABLE(Condition1) || ENABLE(Condition2)
3340 3365
3366 static void anyReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& args )
3367 {
3368 TestObj* imp = V8TestObject::toNative(args.Holder());
3369 v8SetReturnValue(args, imp->anyReturnValue().v8Value());
3370 return;
3371 }
3372
3373 static void anyReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& args)
3374 {
3375 TestObjV8Internal::anyReturnValueMethod(args);
3376 }
3377
3378 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8: :Value>& args)
3379 {
3380 TestObj* imp = V8TestObject::toNative(args.Holder());
3381 v8SetReturnValue(args, imp->callbackFunctionReturnValue().v8Value());
3382 return;
3383 }
3384
3385 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback Info<v8::Value>& args)
3386 {
3387 TestObjV8Internal::callbackFunctionReturnValueMethod(args);
3388 }
3389
3390 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va lue>& args)
3391 {
3392 if (args.Length() < 1) {
3393 throwNotEnoughArgumentsError(args.GetIsolate());
3394 return;
3395 }
3396 TestObj* imp = V8TestObject::toNative(args.Holder());
3397 V8TRYCATCH_VOID(ScriptValue, f, ScriptValue(args[0]));
3398 imp->callbackFunctionArgument(f);
3399
3400 return;
3401 }
3402
3403 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf o<v8::Value>& args)
3404 {
3405 TestObjV8Internal::callbackFunctionArgumentMethod(args);
3406 }
3407
3341 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 3408 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
3342 { 3409 {
3343 if (args.Length() < 2) { 3410 if (args.Length() < 2) {
3344 throwNotEnoughArgumentsError(args.GetIsolate()); 3411 throwNotEnoughArgumentsError(args.GetIsolate());
3345 return; 3412 return;
3346 } 3413 }
3347 TestObj* imp = V8TestObject::toNative(args.Holder()); 3414 TestObj* imp = V8TestObject::toNative(args.Holder());
3348 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0); 3415 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[0], args.Ge tIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(args[0])) : 0);
3349 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]); 3416 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[1]);
3350 imp->overloadedMethod(objArg, strArg); 3417 imp->overloadedMethod(objArg, strArg);
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
4528 #if ENABLE(Condition1) || ENABLE(Condition2) 4595 #if ENABLE(Condition1) || ENABLE(Condition2)
4529 // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional') 4596 // Attribute 'conditionalAttr6' (Type: 'attribute' ExtAttr: 'Conditional')
4530 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectectC::info, st atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8 ::None | v8::DontEnum), 0 /* on instance */}, 4597 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I nternal::TestObjReplaceableAttrSetterCallback, 0, 0, &V8TestObjectectC::info, st atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8 ::None | v8::DontEnum), 0 /* on instance */},
4531 #endif // ENABLE(Condition1) || ENABLE(Condition2) 4598 #endif // ENABLE(Condition1) || ENABLE(Condition2)
4532 // Attribute 'cachedAttribute1' (Type: 'attribute' ExtAttr: '') 4599 // Attribute 'cachedAttribute1' (Type: 'attribute' ExtAttr: '')
4533 {"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 */}, 4600 {"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 */},
4534 // Attribute 'cachedAttribute2' (Type: 'attribute' ExtAttr: '') 4601 // Attribute 'cachedAttribute2' (Type: 'attribute' ExtAttr: '')
4535 {"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 */}, 4602 {"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 */},
4536 // Attribute 'anyAttribute' (Type: 'attribute' ExtAttr: '') 4603 // Attribute 'anyAttribute' (Type: 'attribute' ExtAttr: '')
4537 {"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 */}, 4604 {"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 */},
4605 // Attribute 'callbackFunctionAttribute' (Type: 'attribute' ExtAttr: '')
4606 {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAt trGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttrSetterCallback , 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4538 // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '') 4607 // Attribute 'floatArray' (Type: 'attribute' ExtAttr: '')
4539 {"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 */}, 4608 {"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 */},
4540 // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '') 4609 // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '')
4541 {"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 */}, 4610 {"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 */},
4542 // Attribute 'messagePortArray' (Type: 'attribute' ExtAttr: '') 4611 // Attribute 'messagePortArray' (Type: 'attribute' ExtAttr: '')
4543 {"messagePortArray", TestObjV8Internal::messagePortArrayAttrGetterCallback, TestObjV8Internal::messagePortArrayAttrSetterCallback, 0, 0, 0 /* no data */, st atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8 ::None), 0 /* on instance */}, 4612 {"messagePortArray", TestObjV8Internal::messagePortArrayAttrGetterCallback, TestObjV8Internal::messagePortArrayAttrSetterCallback, 0, 0, 0 /* no data */, st atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8 ::None), 0 /* on instance */},
4544 // Attribute 'contentDocument' (Type: 'attribute' ExtAttr: 'CheckSecurityFor Node') 4613 // Attribute 'contentDocument' (Type: 'attribute' ExtAttr: 'CheckSecurityFor Node')
4545 {"contentDocument", TestObjV8Internal::contentDocumentAttrGetterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast <v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 4614 {"contentDocument", TestObjV8Internal::contentDocumentAttrGetterCallback, 0, 0, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast <v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4546 // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '') 4615 // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '')
4547 {"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 */}, 4616 {"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 */},
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
4641 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI nt64MethodCallback, 0, 1}, 4710 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUI nt64MethodCallback, 0, 1},
4642 #if ENABLE(Condition1) 4711 #if ENABLE(Condition1)
4643 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0}, 4712 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0},
4644 #endif 4713 #endif
4645 #if ENABLE(Condition1) && ENABLE(Condition2) 4714 #if ENABLE(Condition1) && ENABLE(Condition2)
4646 {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback, 0, 0}, 4715 {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback, 0, 0},
4647 #endif 4716 #endif
4648 #if ENABLE(Condition1) || ENABLE(Condition2) 4717 #if ENABLE(Condition1) || ENABLE(Condition2)
4649 {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback, 0, 0}, 4718 {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback, 0, 0},
4650 #endif 4719 #endif
4720 {"anyReturnValue", TestObjV8Internal::anyReturnValueMethodCallback, 0, 0},
4721 {"callbackFunctionReturnValue", TestObjV8Internal::callbackFunctionReturnVal ueMethodCallback, 0, 0},
4722 {"callbackFunctionArgument", TestObjV8Internal::callbackFunctionArgumentMeth odCallback, 0, 1},
4651 {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 2 }, 4723 {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 2 },
4652 {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallba ck, 0, 2}, 4724 {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallba ck, 0, 2},
4653 {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLong SequenceMethodCallback, 0, 1}, 4725 {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLong SequenceMethodCallback, 0, 1},
4654 {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback , 0, 1}, 4726 {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback , 0, 1},
4655 {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0}, 4727 {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0},
4656 {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallba ck, 0, 0}, 4728 {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallba ck, 0, 0},
4657 {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCa llback, 0, 0}, 4729 {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCa llback, 0, 0},
4658 {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0}, 4730 {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0},
4659 {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3}, 4731 {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3},
4660 {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallba ck, 0, 2}, 4732 {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallba ck, 0, 2},
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
4942 installPerContextProperties(wrapper, impl.get(), isolate); 5014 installPerContextProperties(wrapper, impl.get(), isolate);
4943 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap perConfiguration::Independent); 5015 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap perConfiguration::Independent);
4944 return wrapper; 5016 return wrapper;
4945 } 5017 }
4946 void V8TestObject::derefObject(void* object) 5018 void V8TestObject::derefObject(void* object)
4947 { 5019 {
4948 static_cast<TestObj*>(object)->deref(); 5020 static_cast<TestObj*>(object)->deref();
4949 } 5021 }
4950 5022
4951 } // namespace WebCore 5023 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698