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 23 matching lines...) Expand all Loading... |
34 #include "V8TestObjectPython.h" | 34 #include "V8TestObjectPython.h" |
35 | 35 |
36 #include "HTMLNames.h" | 36 #include "HTMLNames.h" |
37 #include "RuntimeEnabledFeatures.h" | 37 #include "RuntimeEnabledFeatures.h" |
38 #include "V8Attr.h" | 38 #include "V8Attr.h" |
39 #include "V8CompareHow.h" | 39 #include "V8CompareHow.h" |
40 #include "V8Document.h" | 40 #include "V8Document.h" |
41 #include "V8DocumentFragment.h" | 41 #include "V8DocumentFragment.h" |
42 #include "V8DocumentType.h" | 42 #include "V8DocumentType.h" |
43 #include "V8Element.h" | 43 #include "V8Element.h" |
44 #include "V8Entity.h" | |
45 #include "V8EventTarget.h" | 44 #include "V8EventTarget.h" |
46 #include "V8HTMLCollection.h" | 45 #include "V8HTMLCollection.h" |
47 #include "V8HTMLElement.h" | 46 #include "V8HTMLElement.h" |
48 #include "V8Node.h" | 47 #include "V8Node.h" |
49 #include "V8NodeFilter.h" | 48 #include "V8NodeFilter.h" |
50 #include "V8ShadowRoot.h" | 49 #include "V8ShadowRoot.h" |
51 #include "V8TestCallbackInterface.h" | 50 #include "V8TestCallbackInterface.h" |
52 #include "V8TestInterface.h" | 51 #include "V8TestInterface.h" |
53 #include "V8TestInterfaceEmpty.h" | 52 #include "V8TestInterfaceEmpty.h" |
54 #include "V8TestInterfacePython.h" | 53 #include "V8TestInterfacePython.h" |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 imp->setElementAttribute(WTF::getPtr(cppValue)); | 986 imp->setElementAttribute(WTF::getPtr(cppValue)); |
988 } | 987 } |
989 | 988 |
990 static void elementAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 989 static void elementAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
991 { | 990 { |
992 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
993 TestObjectPythonV8Internal::elementAttributeAttributeSetter(jsValue, info); | 992 TestObjectPythonV8Internal::elementAttributeAttributeSetter(jsValue, info); |
994 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
995 } | 994 } |
996 | 995 |
997 static void entityAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) | |
998 { | |
999 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | |
1000 v8SetReturnValueFast(info, imp->entityAttribute(), imp); | |
1001 } | |
1002 | |
1003 static void entityAttributeAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | |
1004 { | |
1005 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
1006 TestObjectPythonV8Internal::entityAttributeAttributeGetter(info); | |
1007 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1008 } | |
1009 | |
1010 static void entityAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v
8::PropertyCallbackInfo<void>& info) | |
1011 { | |
1012 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | |
1013 V8TRYCATCH_VOID(Entity*, cppValue, V8Entity::hasInstance(jsValue, info.GetIs
olate()) ? V8Entity::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | |
1014 imp->setEntityAttribute(WTF::getPtr(cppValue)); | |
1015 } | |
1016 | |
1017 static void entityAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo
cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | |
1018 { | |
1019 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
1020 TestObjectPythonV8Internal::entityAttributeAttributeSetter(jsValue, info); | |
1021 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1022 } | |
1023 | |
1024 static void nodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Valu
e>& info) | 996 static void nodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Valu
e>& info) |
1025 { | 997 { |
1026 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 998 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
1027 v8SetReturnValueFast(info, imp->nodeAttribute(), imp); | 999 v8SetReturnValueFast(info, imp->nodeAttribute(), imp); |
1028 } | 1000 } |
1029 | 1001 |
1030 static void nodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8
::PropertyCallbackInfo<v8::Value>& info) | 1002 static void nodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8
::PropertyCallbackInfo<v8::Value>& info) |
1031 { | 1003 { |
1032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1004 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1033 TestObjectPythonV8Internal::nodeAttributeAttributeGetter(info); | 1005 TestObjectPythonV8Internal::nodeAttributeAttributeGetter(info); |
(...skipping 5643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6677 {"xmlAttribute", TestObjectPythonV8Internal::xmlAttributeAttributeGetterCall
back, TestObjectPythonV8Internal::xmlAttributeAttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, | 6649 {"xmlAttribute", TestObjectPythonV8Internal::xmlAttributeAttributeGetterCall
back, TestObjectPythonV8Internal::xmlAttributeAttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, |
6678 {"nodeFilterAttribute", TestObjectPythonV8Internal::nodeFilterAttributeAttri
buteGetterCallback, TestObjectPythonV8Internal::nodeFilterAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6650 {"nodeFilterAttribute", TestObjectPythonV8Internal::nodeFilterAttributeAttri
buteGetterCallback, TestObjectPythonV8Internal::nodeFilterAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6679 {"serializedScriptValueAttribute", TestObjectPythonV8Internal::serializedScr
iptValueAttributeAttributeGetterCallback, TestObjectPythonV8Internal::serialized
ScriptValueAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instanc
e */}, | 6651 {"serializedScriptValueAttribute", TestObjectPythonV8Internal::serializedScr
iptValueAttributeAttributeGetterCallback, TestObjectPythonV8Internal::serialized
ScriptValueAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instanc
e */}, |
6680 {"anyAttribute", TestObjectPythonV8Internal::anyAttributeAttributeGetterCall
back, TestObjectPythonV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, | 6652 {"anyAttribute", TestObjectPythonV8Internal::anyAttributeAttributeGetterCall
back, TestObjectPythonV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0,
static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(
v8::None), 0 /* on instance */}, |
6681 {"promiseAttribute", TestObjectPythonV8Internal::promiseAttributeAttributeGe
tterCallback, TestObjectPythonV8Internal::promiseAttributeAttributeSetterCallbac
k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::None), 0 /* on instance */}, | 6653 {"promiseAttribute", TestObjectPythonV8Internal::promiseAttributeAttributeGe
tterCallback, TestObjectPythonV8Internal::promiseAttributeAttributeSetterCallbac
k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::None), 0 /* on instance */}, |
6682 {"windowAttribute", TestObjectPythonV8Internal::windowAttributeAttributeGett
erCallback, TestObjectPythonV8Internal::windowAttributeAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, | 6654 {"windowAttribute", TestObjectPythonV8Internal::windowAttributeAttributeGett
erCallback, TestObjectPythonV8Internal::windowAttributeAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, |
6683 {"documentAttribute", TestObjectPythonV8Internal::documentAttributeAttribute
GetterCallback, TestObjectPythonV8Internal::documentAttributeAttributeSetterCall
back, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop
ertyAttribute>(v8::None), 0 /* on instance */}, | 6655 {"documentAttribute", TestObjectPythonV8Internal::documentAttributeAttribute
GetterCallback, TestObjectPythonV8Internal::documentAttributeAttributeSetterCall
back, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop
ertyAttribute>(v8::None), 0 /* on instance */}, |
6684 {"documentFragmentAttribute", TestObjectPythonV8Internal::documentFragmentAt
tributeAttributeGetterCallback, TestObjectPythonV8Internal::documentFragmentAttr
ibuteAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAUL
T), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6656 {"documentFragmentAttribute", TestObjectPythonV8Internal::documentFragmentAt
tributeAttributeGetterCallback, TestObjectPythonV8Internal::documentFragmentAttr
ibuteAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAUL
T), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6685 {"documentTypeAttribute", TestObjectPythonV8Internal::documentTypeAttributeA
ttributeGetterCallback, TestObjectPythonV8Internal::documentTypeAttributeAttribu
teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6657 {"documentTypeAttribute", TestObjectPythonV8Internal::documentTypeAttributeA
ttributeGetterCallback, TestObjectPythonV8Internal::documentTypeAttributeAttribu
teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6686 {"elementAttribute", TestObjectPythonV8Internal::elementAttributeAttributeGe
tterCallback, TestObjectPythonV8Internal::elementAttributeAttributeSetterCallbac
k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::None), 0 /* on instance */}, | 6658 {"elementAttribute", TestObjectPythonV8Internal::elementAttributeAttributeGe
tterCallback, TestObjectPythonV8Internal::elementAttributeAttributeSetterCallbac
k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::None), 0 /* on instance */}, |
6687 {"entityAttribute", TestObjectPythonV8Internal::entityAttributeAttributeGett
erCallback, TestObjectPythonV8Internal::entityAttributeAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, | |
6688 {"nodeAttribute", TestObjectPythonV8Internal::nodeAttributeAttributeGetterCa
llback, TestObjectPythonV8Internal::nodeAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::None), 0 /* on instance */}, | 6659 {"nodeAttribute", TestObjectPythonV8Internal::nodeAttributeAttributeGetterCa
llback, TestObjectPythonV8Internal::nodeAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::None), 0 /* on instance */}, |
6689 {"shadowRootAttribute", TestObjectPythonV8Internal::shadowRootAttributeAttri
buteGetterCallback, TestObjectPythonV8Internal::shadowRootAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6660 {"shadowRootAttribute", TestObjectPythonV8Internal::shadowRootAttributeAttri
buteGetterCallback, TestObjectPythonV8Internal::shadowRootAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6690 {"arrayBufferAttribute", TestObjectPythonV8Internal::arrayBufferAttributeAtt
ributeGetterCallback, TestObjectPythonV8Internal::arrayBufferAttributeAttributeS
etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6661 {"arrayBufferAttribute", TestObjectPythonV8Internal::arrayBufferAttributeAtt
ributeGetterCallback, TestObjectPythonV8Internal::arrayBufferAttributeAttributeS
etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6691 {"float32ArrayAttribute", TestObjectPythonV8Internal::float32ArrayAttributeA
ttributeGetterCallback, TestObjectPythonV8Internal::float32ArrayAttributeAttribu
teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6662 {"float32ArrayAttribute", TestObjectPythonV8Internal::float32ArrayAttributeA
ttributeGetterCallback, TestObjectPythonV8Internal::float32ArrayAttributeAttribu
teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6692 {"uint8ArrayAttribute", TestObjectPythonV8Internal::uint8ArrayAttributeAttri
buteGetterCallback, TestObjectPythonV8Internal::uint8ArrayAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6663 {"uint8ArrayAttribute", TestObjectPythonV8Internal::uint8ArrayAttributeAttri
buteGetterCallback, TestObjectPythonV8Internal::uint8ArrayAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6693 {"self", TestObjectPythonV8Internal::selfAttributeGetterCallback, 0, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, | 6664 {"self", TestObjectPythonV8Internal::selfAttributeGetterCallback, 0, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}, |
6694 {"readonlyEventTargetAttribute", TestObjectPythonV8Internal::readonlyEventTa
rgetAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}, | 6665 {"readonlyEventTargetAttribute", TestObjectPythonV8Internal::readonlyEventTa
rgetAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}, |
6695 {"readonlyWindowAttribute", TestObjectPythonV8Internal::readonlyWindowAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6666 {"readonlyWindowAttribute", TestObjectPythonV8Internal::readonlyWindowAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6696 {"htmlCollectionAttribute", TestObjectPythonV8Internal::htmlCollectionAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6667 {"htmlCollectionAttribute", TestObjectPythonV8Internal::htmlCollectionAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
6697 {"htmlElementAttribute", TestObjectPythonV8Internal::htmlElementAttributeAtt
ributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), s
tatic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 6668 {"htmlElementAttribute", TestObjectPythonV8Internal::htmlElementAttributeAtt
ributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), s
tatic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7094 fromInternalPointer(object)->deref(); | 7065 fromInternalPointer(object)->deref(); |
7095 } | 7066 } |
7096 | 7067 |
7097 template<> | 7068 template<> |
7098 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | 7069 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
7099 { | 7070 { |
7100 return toV8(impl, creationContext, isolate); | 7071 return toV8(impl, creationContext, isolate); |
7101 } | 7072 } |
7102 | 7073 |
7103 } // namespace WebCore | 7074 } // namespace WebCore |
OLD | NEW |