OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 static void TestInterfacePythonImplementationConstructorGetter(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) | 635 static void TestInterfacePythonImplementationConstructorGetter(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) |
636 { | 636 { |
637 v8::Handle<v8::Value> data = info.Data(); | 637 v8::Handle<v8::Value> data = info.Data(); |
638 ASSERT(data->IsExternal()); | 638 ASSERT(data->IsExternal()); |
639 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 639 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
640 if (!perContextData) | 640 if (!perContextData) |
641 return; | 641 return; |
642 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 642 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
643 } | 643 } |
644 | 644 |
| 645 static void testImplementedAsConstructorAttributeConstructorGetterCallback(v8::L
ocal<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 646 { |
| 647 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 648 TestInterfacePythonImplementationV8Internal::TestInterfacePythonImplementati
onConstructorGetter(property, info); |
| 649 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 650 } |
| 651 |
645 static void TestInterfacePythonImplementationReplaceableAttributeSetter(v8::Loca
l<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo
<void>& info) | 652 static void TestInterfacePythonImplementationReplaceableAttributeSetter(v8::Loca
l<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo
<void>& info) |
646 { | 653 { |
647 info.This()->ForceSet(name, jsValue); | 654 info.This()->ForceSet(name, jsValue); |
648 } | 655 } |
649 | 656 |
650 static void TestInterfacePythonImplementationReplaceableAttributeSetterCallback(
v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCall
backInfo<void>& info) | 657 static void TestInterfacePythonImplementationReplaceableAttributeSetterCallback(
v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCall
backInfo<void>& info) |
651 { | 658 { |
652 TestInterfacePythonImplementationV8Internal::TestInterfacePythonImplementati
onReplaceableAttributeSetter(name, jsValue, info); | 659 TestInterfacePythonImplementationV8Internal::TestInterfacePythonImplementati
onReplaceableAttributeSetter(name, jsValue, info); |
653 } | 660 } |
654 | 661 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 if (referencedName) { | 903 if (referencedName) { |
897 if (!DOMDataStore::containsWrapper<V8TestInterfacePython>(referencedName
, isolate)) | 904 if (!DOMDataStore::containsWrapper<V8TestInterfacePython>(referencedName
, isolate)) |
898 wrap(referencedName, creationContext, isolate); | 905 wrap(referencedName, creationContext, isolate); |
899 DOMDataStore::setWrapperReference<V8TestInterfacePython>(wrapper, refere
ncedName, isolate); | 906 DOMDataStore::setWrapperReference<V8TestInterfacePython>(wrapper, refere
ncedName, isolate); |
900 } | 907 } |
901 setObjectGroup(object, wrapper, isolate); | 908 setObjectGroup(object, wrapper, isolate); |
902 } | 909 } |
903 | 910 |
904 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfacePythonAtt
ributes[] = { | 911 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfacePythonAtt
ributes[] = { |
905 {"testInterfacePythonAttribute", TestInterfacePythonImplementationV8Internal
::testInterfacePythonAttributeAttributeGetterCallback, TestInterfacePythonImplem
entationV8Internal::testInterfacePythonAttributeAttributeSetterCallback, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, | 912 {"testInterfacePythonAttribute", TestInterfacePythonImplementationV8Internal
::testInterfacePythonAttributeAttributeGetterCallback, TestInterfacePythonImplem
entationV8Internal::testInterfacePythonAttributeAttributeSetterCallback, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, |
906 {"testImplementedAsConstructorAttribute", TestInterfacePythonImplementationV
8Internal::TestInterfacePythonImplementationConstructorGetter, TestInterfacePyth
onImplementationV8Internal::TestInterfacePythonImplementationReplaceableAttribut
eSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestImplementedAs::wrappe
rTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::DontEnum), 0 /* on instance */}, | 913 {"testImplementedAsConstructorAttribute", TestInterfacePythonImplementationV
8Internal::testImplementedAsConstructorAttributeConstructorGetterCallback, TestI
nterfacePythonImplementationV8Internal::TestInterfacePythonImplementationReplace
ableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestImplement
edAs::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
907 {"perWorldBindingsStringAttribute", TestInterfacePythonImplementationV8Inter
nal::perWorldBindingsStringAttributeAttributeGetterCallback, TestInterfacePython
ImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterCallback
, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAt
tributeGetterCallbackForMainWorld, TestInterfacePythonImplementationV8Internal::
perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld, 0, static_ca
st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)
, 0 /* on instance */}, | 914 {"perWorldBindingsStringAttribute", TestInterfacePythonImplementationV8Inter
nal::perWorldBindingsStringAttributeAttributeGetterCallback, TestInterfacePython
ImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterCallback
, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAt
tributeGetterCallbackForMainWorld, TestInterfacePythonImplementationV8Internal::
perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld, 0, static_ca
st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)
, 0 /* on instance */}, |
908 {"implementsReadonlyStringAttribute", TestInterfacePythonImplementationV8Int
ernal::implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8:
:None), 0 /* on instance */}, | 915 {"implementsReadonlyStringAttribute", TestInterfacePythonImplementationV8Int
ernal::implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8:
:None), 0 /* on instance */}, |
909 {"implementsStringAttribute", TestInterfacePythonImplementationV8Internal::i
mplementsStringAttributeAttributeGetterCallback, TestInterfacePythonImplementati
onV8Internal::implementsStringAttributeAttributeSetterCallback, 0, 0, 0, static_
cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::Non
e), 0 /* on instance */}, | 916 {"implementsStringAttribute", TestInterfacePythonImplementationV8Internal::i
mplementsStringAttributeAttributeGetterCallback, TestInterfacePythonImplementati
onV8Internal::implementsStringAttributeAttributeSetterCallback, 0, 0, 0, static_
cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::Non
e), 0 /* on instance */}, |
910 {"implementsNodeAttribute", TestInterfacePythonImplementationV8Internal::imp
lementsNodeAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8
Internal::implementsNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v
8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0
/* on instance */}, | 917 {"implementsNodeAttribute", TestInterfacePythonImplementationV8Internal::imp
lementsNodeAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8
Internal::implementsNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v
8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0
/* on instance */}, |
911 {"implementsEventHandlerAttribute", TestInterfacePythonImplementationV8Inter
nal::implementsEventHandlerAttributeAttributeGetterCallback, TestInterfacePython
ImplementationV8Internal::implementsEventHandlerAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, | 918 {"implementsEventHandlerAttribute", TestInterfacePythonImplementationV8Inter
nal::implementsEventHandlerAttributeAttributeGetterCallback, TestInterfacePython
ImplementationV8Internal::implementsEventHandlerAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, |
912 {"partial2LongAttribute", TestInterfacePythonImplementationV8Internal::parti
al2LongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Inte
rnal::partial2LongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acc
essControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | 919 {"partial2LongAttribute", TestInterfacePythonImplementationV8Internal::parti
al2LongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Inte
rnal::partial2LongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acc
essControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, |
913 }; | 920 }; |
914 | 921 |
915 static const V8DOMConfiguration::MethodConfiguration V8TestInterfacePythonMethod
s[] = { | 922 static const V8DOMConfiguration::MethodConfiguration V8TestInterfacePythonMethod
s[] = { |
916 {"voidMethodTestInterfaceEmptyArg", TestInterfacePythonImplementationV8Inter
nal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, | 923 {"voidMethodTestInterfaceEmptyArg", TestInterfacePythonImplementationV8Inter
nal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 } | 1067 } |
1061 | 1068 |
1062 template<> | 1069 template<> |
1063 v8::Handle<v8::Value> toV8NoInline(TestInterfacePythonImplementation* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | 1070 v8::Handle<v8::Value> toV8NoInline(TestInterfacePythonImplementation* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) |
1064 { | 1071 { |
1065 return toV8(impl, creationContext, isolate); | 1072 return toV8(impl, creationContext, isolate); |
1066 } | 1073 } |
1067 | 1074 |
1068 } // namespace WebCore | 1075 } // namespace WebCore |
1069 #endif // ENABLE(CONDITION) | 1076 #endif // ENABLE(CONDITION) |
OLD | NEW |