| 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 7228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7239 imp->unforgeableVoidMethod(); | 7239 imp->unforgeableVoidMethod(); |
| 7240 } | 7240 } |
| 7241 | 7241 |
| 7242 static void unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 7242 static void unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 7243 { | 7243 { |
| 7244 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 7244 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 7245 TestObjectPythonV8Internal::unforgeableVoidMethodMethod(info); | 7245 TestObjectPythonV8Internal::unforgeableVoidMethodMethod(info); |
| 7246 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 7246 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 7247 } | 7247 } |
| 7248 | 7248 |
| 7249 static void voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethod(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 7250 { |
| 7251 if (UNLIKELY(info.Length() < 1)) { |
| 7252 throwTypeError(ExceptionMessages::failedToExecute("voidMethodSequenceTes
tInterfaceWillBeGarbageCollectedArg", "TestObjectPython", ExceptionMessages::not
EnoughArguments(1, info.Length())), info.GetIsolate()); |
| 7253 return; |
| 7254 } |
| 7255 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
| 7256 V8TRYCATCH_VOID(WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarba
geCollected> >, sequenceTestInterfaceWillBeGarbageCollectedArg, (toMemberNativeA
rray<TestInterfaceWillBeGarbageCollected, V8TestInterfaceWillBeGarbageCollected>
(info[0], 1, info.GetIsolate()))); |
| 7257 imp->voidMethodSequenceTestInterfaceWillBeGarbageCollectedArg(sequenceTestIn
terfaceWillBeGarbageCollectedArg); |
| 7258 } |
| 7259 |
| 7260 static void voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethodCallba
ck(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 7261 { |
| 7262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 7263 TestObjectPythonV8Internal::voidMethodSequenceTestInterfaceWillBeGarbageColl
ectedArgMethod(info); |
| 7264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 7265 } |
| 7266 |
| 7249 } // namespace TestObjectPythonV8Internal | 7267 } // namespace TestObjectPythonV8Internal |
| 7250 | 7268 |
| 7251 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib
utes[] = { | 7269 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib
utes[] = { |
| 7252 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 7270 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7253 {"readonlyTestInterfaceEmptyAttribute", TestObjectPythonV8Internal::readonly
TestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, | 7271 {"readonlyTestInterfaceEmptyAttribute", TestObjectPythonV8Internal::readonly
TestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, |
| 7254 {"readonlyLongAttribute", TestObjectPythonV8Internal::readonlyLongAttributeA
ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 7272 {"readonlyLongAttribute", TestObjectPythonV8Internal::readonlyLongAttributeA
ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 7255 {"dateAttribute", TestObjectPythonV8Internal::dateAttributeAttributeGetterCa
llback, TestObjectPythonV8Internal::dateAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::None), 0 /* on instance */}, | 7273 {"dateAttribute", TestObjectPythonV8Internal::dateAttributeAttributeGetterCa
llback, TestObjectPythonV8Internal::dateAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::None), 0 /* on instance */}, |
| 7256 {"stringAttribute", TestObjectPythonV8Internal::stringAttributeAttributeGett
erCallback, TestObjectPythonV8Internal::stringAttributeAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, | 7274 {"stringAttribute", TestObjectPythonV8Internal::stringAttributeAttributeGett
erCallback, TestObjectPythonV8Internal::stringAttributeAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, |
| 7257 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim
eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro
l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, | 7275 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim
eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro
l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, |
| 7258 {"booleanAttribute", TestObjectPythonV8Internal::booleanAttributeAttributeGe
tterCallback, TestObjectPythonV8Internal::booleanAttributeAttributeSetterCallbac
k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::None), 0 /* on instance */}, | 7276 {"booleanAttribute", TestObjectPythonV8Internal::booleanAttributeAttributeGe
tterCallback, TestObjectPythonV8Internal::booleanAttributeAttributeSetterCallbac
k, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Propert
yAttribute>(v8::None), 0 /* on instance */}, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7543 {"raisesExceptionVoidMethod", TestObjectPythonV8Internal::raisesExceptionVoi
dMethodMethodCallback, 0, 0}, | 7561 {"raisesExceptionVoidMethod", TestObjectPythonV8Internal::raisesExceptionVoi
dMethodMethodCallback, 0, 0}, |
| 7544 {"raisesExceptionStringMethod", TestObjectPythonV8Internal::raisesExceptionS
tringMethodMethodCallback, 0, 0}, | 7562 {"raisesExceptionStringMethod", TestObjectPythonV8Internal::raisesExceptionS
tringMethodMethodCallback, 0, 0}, |
| 7545 {"raisesExceptionVoidMethodOptionalLongArg", TestObjectPythonV8Internal::rai
sesExceptionVoidMethodOptionalLongArgMethodCallback, 0, 0}, | 7563 {"raisesExceptionVoidMethodOptionalLongArg", TestObjectPythonV8Internal::rai
sesExceptionVoidMethodOptionalLongArgMethodCallback, 0, 0}, |
| 7546 {"raisesExceptionVoidMethodTestCallbackInterfaceArg", TestObjectPythonV8Inte
rnal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback, 0, 1}, | 7564 {"raisesExceptionVoidMethodTestCallbackInterfaceArg", TestObjectPythonV8Inte
rnal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback, 0, 1}, |
| 7547 {"raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", TestObjectPyth
onV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCal
lback, 0, 0}, | 7565 {"raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", TestObjectPyth
onV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCal
lback, 0, 0}, |
| 7548 {"raisesExceptionTestInterfaceEmptyVoidMethod", TestObjectPythonV8Internal::
raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback, 0, 0}, | 7566 {"raisesExceptionTestInterfaceEmptyVoidMethod", TestObjectPythonV8Internal::
raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback, 0, 0}, |
| 7549 {"strictTypeCheckingVoidMethodTestInterfaceEmptyArg", TestObjectPythonV8Inte
rnal::strictTypeCheckingVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, | 7567 {"strictTypeCheckingVoidMethodTestInterfaceEmptyArg", TestObjectPythonV8Inte
rnal::strictTypeCheckingVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, |
| 7550 {"strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArg", TestObjectPyth
onV8Internal::strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArgMethodCal
lback, 0, 1}, | 7568 {"strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArg", TestObjectPyth
onV8Internal::strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArgMethodCal
lback, 0, 1}, |
| 7551 {"treatReturnedNullStringAsNullStringMethod", TestObjectPythonV8Internal::tr
eatReturnedNullStringAsNullStringMethodMethodCallback, 0, 0}, | 7569 {"treatReturnedNullStringAsNullStringMethod", TestObjectPythonV8Internal::tr
eatReturnedNullStringAsNullStringMethodMethodCallback, 0, 0}, |
| 7552 {"treatReturnedNullStringAsUndefinedStringMethod", TestObjectPythonV8Interna
l::treatReturnedNullStringAsUndefinedStringMethodMethodCallback, 0, 0}, | 7570 {"treatReturnedNullStringAsUndefinedStringMethod", TestObjectPythonV8Interna
l::treatReturnedNullStringAsUndefinedStringMethodMethodCallback, 0, 0}, |
| 7571 {"voidMethodSequenceTestInterfaceWillBeGarbageCollectedArg", TestObjectPytho
nV8Internal::voidMethodSequenceTestInterfaceWillBeGarbageCollectedArgMethodCallb
ack, 0, 1}, |
| 7553 }; | 7572 }; |
| 7554 | 7573 |
| 7555 static void configureV8TestObjectPythonTemplate(v8::Handle<v8::FunctionTemplate>
functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) | 7574 static void configureV8TestObjectPythonTemplate(v8::Handle<v8::FunctionTemplate>
functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| 7556 { | 7575 { |
| 7557 functionTemplate->ReadOnlyPrototype(); | 7576 functionTemplate->ReadOnlyPrototype(); |
| 7558 | 7577 |
| 7559 v8::Local<v8::Signature> defaultSignature; | 7578 v8::Local<v8::Signature> defaultSignature; |
| 7560 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestObjectPython", v8::Local<v8::FunctionTemplate>(), V8TestObjectPython::
internalFieldCount, | 7579 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestObjectPython", v8::Local<v8::FunctionTemplate>(), V8TestObjectPython::
internalFieldCount, |
| 7561 V8TestObjectPythonAttributes, WTF_ARRAY_LENGTH(V8TestObjectPythonAttribu
tes), | 7580 V8TestObjectPythonAttributes, WTF_ARRAY_LENGTH(V8TestObjectPythonAttribu
tes), |
| 7562 V8TestObjectPythonAccessors, WTF_ARRAY_LENGTH(V8TestObjectPythonAccessor
s), | 7581 V8TestObjectPythonAccessors, WTF_ARRAY_LENGTH(V8TestObjectPythonAccessor
s), |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7722 fromInternalPointer(object)->deref(); | 7741 fromInternalPointer(object)->deref(); |
| 7723 } | 7742 } |
| 7724 | 7743 |
| 7725 template<> | 7744 template<> |
| 7726 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | 7745 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
| 7727 { | 7746 { |
| 7728 return toV8(impl, creationContext, isolate); | 7747 return toV8(impl, creationContext, isolate); |
| 7729 } | 7748 } |
| 7730 | 7749 |
| 7731 } // namespace WebCore | 7750 } // namespace WebCore |
| OLD | NEW |