| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "V8Element.h" | 42 #include "V8Element.h" |
| 43 #include "V8EventTarget.h" | 43 #include "V8EventTarget.h" |
| 44 #include "V8HTMLCollection.h" | 44 #include "V8HTMLCollection.h" |
| 45 #include "V8HTMLElement.h" | 45 #include "V8HTMLElement.h" |
| 46 #include "V8Node.h" | 46 #include "V8Node.h" |
| 47 #include "V8NodeFilter.h" | 47 #include "V8NodeFilter.h" |
| 48 #include "V8ShadowRoot.h" | 48 #include "V8ShadowRoot.h" |
| 49 #include "V8TestCallbackInterface.h" | 49 #include "V8TestCallbackInterface.h" |
| 50 #include "V8TestInterface.h" | 50 #include "V8TestInterface.h" |
| 51 #include "V8TestInterfaceEmpty.h" | 51 #include "V8TestInterfaceEmpty.h" |
| 52 #include "V8TestInterfaceGarbageCollected.h" | |
| 53 #include "V8TestInterfacePython.h" | 52 #include "V8TestInterfacePython.h" |
| 53 #include "V8TestInterfaceWillBeGarbageCollected.h" |
| 54 #include "V8TestNode.h" | 54 #include "V8TestNode.h" |
| 55 #include "V8TestObjectA.h" | 55 #include "V8TestObjectA.h" |
| 56 #include "V8Window.h" | 56 #include "V8Window.h" |
| 57 #include "V8XPathNSResolver.h" | 57 #include "V8XPathNSResolver.h" |
| 58 #include "bindings/v8/BindingSecurity.h" | 58 #include "bindings/v8/BindingSecurity.h" |
| 59 #include "bindings/v8/Dictionary.h" | 59 #include "bindings/v8/Dictionary.h" |
| 60 #include "bindings/v8/ExceptionState.h" | 60 #include "bindings/v8/ExceptionState.h" |
| 61 #include "bindings/v8/ScriptCallStackFactory.h" | 61 #include "bindings/v8/ScriptCallStackFactory.h" |
| 62 #include "bindings/v8/ScriptPromise.h" | 62 #include "bindings/v8/ScriptPromise.h" |
| 63 #include "bindings/v8/ScriptState.h" | 63 #include "bindings/v8/ScriptState.h" |
| (...skipping 3834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3898 imp->setTestInterfacePythonAttribute(WTF::getPtr(cppValue)); | 3898 imp->setTestInterfacePythonAttribute(WTF::getPtr(cppValue)); |
| 3899 } | 3899 } |
| 3900 | 3900 |
| 3901 static void testInterfacePythonAttributeAttributeSetterCallback(v8::Local<v8::St
ring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3901 static void testInterfacePythonAttributeAttributeSetterCallback(v8::Local<v8::St
ring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 3902 { | 3902 { |
| 3903 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3903 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 3904 TestObjectPythonV8Internal::testInterfacePythonAttributeAttributeSetter(jsVa
lue, info); | 3904 TestObjectPythonV8Internal::testInterfacePythonAttributeAttributeSetter(jsVa
lue, info); |
| 3905 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3905 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 3906 } | 3906 } |
| 3907 | 3907 |
| 3908 static void testInterfaceGarbageCollectedAttributeAttributeGetter(const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 3908 static void testInterfaceWillBeGarbageCollectedAttributeAttributeGetter(const v8
::PropertyCallbackInfo<v8::Value>& info) |
| 3909 { | 3909 { |
| 3910 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 3910 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
| 3911 bool isNull = false; | 3911 bool isNull = false; |
| 3912 RefPtrWillBeRawPtr<TestInterfaceGarbageCollected> jsValue = imp->testInterfa
ceGarbageCollectedAttribute(isNull); | 3912 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> jsValue = imp->testI
nterfaceWillBeGarbageCollectedAttribute(isNull); |
| 3913 if (isNull) { | 3913 if (isNull) { |
| 3914 v8SetReturnValueNull(info); | 3914 v8SetReturnValueNull(info); |
| 3915 return; | 3915 return; |
| 3916 } | 3916 } |
| 3917 v8SetReturnValueFast(info, jsValue.release(), imp); | 3917 v8SetReturnValueFast(info, jsValue.release(), imp); |
| 3918 } | 3918 } |
| 3919 | 3919 |
| 3920 static void testInterfaceGarbageCollectedAttributeAttributeGetterCallback(v8::Lo
cal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 3920 static void testInterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback(
v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 3921 { | 3921 { |
| 3922 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3922 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 3923 TestObjectPythonV8Internal::testInterfaceGarbageCollectedAttributeAttributeG
etter(info); | 3923 TestObjectPythonV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttr
ibuteGetter(info); |
| 3924 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3924 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 3925 } | 3925 } |
| 3926 | 3926 |
| 3927 static void testInterfaceGarbageCollectedAttributeAttributeSetter(v8::Local<v8::
Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3927 static void testInterfaceWillBeGarbageCollectedAttributeAttributeSetter(v8::Loca
l<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 3928 { | 3928 { |
| 3929 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 3929 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
| 3930 V8TRYCATCH_VOID(TestInterfaceGarbageCollected*, cppValue, V8TestInterfaceGar
bageCollected::hasInstance(jsValue, info.GetIsolate()) ? V8TestInterfaceGarbageC
ollected::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | 3930 V8TRYCATCH_VOID(TestInterfaceWillBeGarbageCollected*, cppValue, V8TestInterf
aceWillBeGarbageCollected::hasInstance(jsValue, info.GetIsolate()) ? V8TestInter
faceWillBeGarbageCollected::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0)
; |
| 3931 imp->setTestInterfaceGarbageCollectedAttribute(WTF::getPtr(cppValue)); | 3931 imp->setTestInterfaceWillBeGarbageCollectedAttribute(WTF::getPtr(cppValue)); |
| 3932 } | 3932 } |
| 3933 | 3933 |
| 3934 static void testInterfaceGarbageCollectedAttributeAttributeSetterCallback(v8::Lo
cal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<vo
id>& info) | 3934 static void testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback(
v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackI
nfo<void>& info) |
| 3935 { | 3935 { |
| 3936 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3936 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 3937 TestObjectPythonV8Internal::testInterfaceGarbageCollectedAttributeAttributeS
etter(jsValue, info); | 3937 TestObjectPythonV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttr
ibuteSetter(jsValue, info); |
| 3938 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3938 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 3939 } | 3939 } |
| 3940 | 3940 |
| 3941 static void TestObjectPythonConstructorGetter(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 3941 static void TestObjectPythonConstructorGetter(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
| 3942 { | 3942 { |
| 3943 v8::Handle<v8::Value> data = info.Data(); | 3943 v8::Handle<v8::Value> data = info.Data(); |
| 3944 ASSERT(data->IsExternal()); | 3944 ASSERT(data->IsExternal()); |
| 3945 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 3945 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
| 3946 if (!perContextData) | 3946 if (!perContextData) |
| 3947 return; | 3947 return; |
| (...skipping 3394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7342 {"strictTypeCheckingFloatAttribute", TestObjectPythonV8Internal::strictTypeC
heckingFloatAttributeAttributeGetterCallback, TestObjectPythonV8Internal::strict
TypeCheckingFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, | 7342 {"strictTypeCheckingFloatAttribute", TestObjectPythonV8Internal::strictTypeC
heckingFloatAttributeAttributeGetterCallback, TestObjectPythonV8Internal::strict
TypeCheckingFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}, |
| 7343 {"strictTypeCheckingTestInterfaceAttribute", TestObjectPythonV8Internal::str
ictTypeCheckingTestInterfaceAttributeAttributeGetterCallback, TestObjectPythonV8
Internal::strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu
te>(v8::None), 0 /* on instance */}, | 7343 {"strictTypeCheckingTestInterfaceAttribute", TestObjectPythonV8Internal::str
ictTypeCheckingTestInterfaceAttributeAttributeGetterCallback, TestObjectPythonV8
Internal::strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu
te>(v8::None), 0 /* on instance */}, |
| 7344 {"treatNullAsNullStringStringAttribute", TestObjectPythonV8Internal::treatNu
llAsNullStringStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal
::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, | 7344 {"treatNullAsNullStringStringAttribute", TestObjectPythonV8Internal::treatNu
llAsNullStringStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal
::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_c
ast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None
), 0 /* on instance */}, |
| 7345 {"treatReturnedNullStringAsNullStringAttribute", TestObjectPythonV8Internal:
:treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObject
PythonV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCal
lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, | 7345 {"treatReturnedNullStringAsNullStringAttribute", TestObjectPythonV8Internal:
:treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObject
PythonV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCal
lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, |
| 7346 {"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectPythonV8Inte
rnal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback,
TestObjectPythonV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAtt
ributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat
ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 7346 {"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectPythonV8Inte
rnal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback,
TestObjectPythonV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAtt
ributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat
ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7347 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu
teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC
allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P
ropertyAttribute>(v8::None), 0 /* on instance */}, | 7347 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu
teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC
allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P
ropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7348 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu
teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC
allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P
ropertyAttribute>(v8::None), 0 /* on instance */}, | 7348 {"urlStringAttribute", TestObjectPythonV8Internal::urlStringAttributeAttribu
teGetterCallback, TestObjectPythonV8Internal::urlStringAttributeAttributeSetterC
allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P
ropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7349 {"unforgeableLongAttribute", TestObjectPythonV8Internal::unforgeableLongAttr
ibuteAttributeGetterCallback, TestObjectPythonV8Internal::unforgeableLongAttribu
teAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS
_OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on insta
nce */}, | 7349 {"unforgeableLongAttribute", TestObjectPythonV8Internal::unforgeableLongAttr
ibuteAttributeGetterCallback, TestObjectPythonV8Internal::unforgeableLongAttribu
teAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS
_OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on insta
nce */}, |
| 7350 {"anotherStringAttribute", TestObjectPythonV8Internal::anotherStringAttribut
eAttributeGetterCallback, TestObjectPythonV8Internal::anotherStringAttributeAttr
ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati
c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 7350 {"anotherStringAttribute", TestObjectPythonV8Internal::anotherStringAttribut
eAttributeGetterCallback, TestObjectPythonV8Internal::anotherStringAttributeAttr
ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati
c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7351 {"testInterfacePythonAttribute", TestObjectPythonV8Internal::testInterfacePy
thonAttributeAttributeGetterCallback, TestObjectPythonV8Internal::testInterfaceP
ythonAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v
8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 7351 {"testInterfacePythonAttribute", TestObjectPythonV8Internal::testInterfacePy
thonAttributeAttributeGetterCallback, TestObjectPythonV8Internal::testInterfaceP
ythonAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v
8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7352 {"testInterfaceGarbageCollectedAttribute", TestObjectPythonV8Internal::testI
nterfaceGarbageCollectedAttributeAttributeGetterCallback, TestObjectPythonV8Inte
rnal::testInterfaceGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, st
atic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8
::None), 0 /* on instance */}, | 7352 {"testInterfaceWillBeGarbageCollectedAttribute", TestObjectPythonV8Internal:
:testInterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback, TestObject
PythonV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCal
lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, |
| 7353 }; | 7353 }; |
| 7354 | 7354 |
| 7355 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectPythonAccesso
rs[] = { | 7355 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectPythonAccesso
rs[] = { |
| 7356 {"exposeJSAccessorsLongAttribute", TestObjectPythonV8Internal::exposeJSAcces
sorsLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::exposeJSAc
cessorsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)}, | 7356 {"exposeJSAccessorsLongAttribute", TestObjectPythonV8Internal::exposeJSAcces
sorsLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::exposeJSAc
cessorsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)}, |
| 7357 }; | 7357 }; |
| 7358 | 7358 |
| 7359 static const V8DOMConfiguration::MethodConfiguration V8TestObjectPythonMethods[]
= { | 7359 static const V8DOMConfiguration::MethodConfiguration V8TestObjectPythonMethods[]
= { |
| 7360 {"voidMethod", TestObjectPythonV8Internal::voidMethodMethodCallback, 0, 0}, | 7360 {"voidMethod", TestObjectPythonV8Internal::voidMethodMethodCallback, 0, 0}, |
| 7361 {"dateMethod", TestObjectPythonV8Internal::dateMethodMethodCallback, 0, 0}, | 7361 {"dateMethod", TestObjectPythonV8Internal::dateMethodMethodCallback, 0, 0}, |
| 7362 {"stringMethod", TestObjectPythonV8Internal::stringMethodMethodCallback, 0,
0}, | 7362 {"stringMethod", TestObjectPythonV8Internal::stringMethodMethodCallback, 0,
0}, |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7680 fromInternalPointer(object)->deref(); | 7680 fromInternalPointer(object)->deref(); |
| 7681 } | 7681 } |
| 7682 | 7682 |
| 7683 template<> | 7683 template<> |
| 7684 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | 7684 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
| 7685 { | 7685 { |
| 7686 return toV8(impl, creationContext, isolate); | 7686 return toV8(impl, creationContext, isolate); |
| 7687 } | 7687 } |
| 7688 | 7688 |
| 7689 } // namespace WebCore | 7689 } // namespace WebCore |
| OLD | NEW |