| 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 5499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5510 v8SetReturnValueStringOrUndefined(info, imp->treatReturnedNullStringAsUndefi
nedStringMethod(), info.GetIsolate()); | 5510 v8SetReturnValueStringOrUndefined(info, imp->treatReturnedNullStringAsUndefi
nedStringMethod(), info.GetIsolate()); |
| 5511 } | 5511 } |
| 5512 | 5512 |
| 5513 static void treatReturnedNullStringAsUndefinedStringMethodMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 5513 static void treatReturnedNullStringAsUndefinedStringMethodMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
| 5514 { | 5514 { |
| 5515 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5515 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 5516 TestObjectPythonV8Internal::treatReturnedNullStringAsUndefinedStringMethodMe
thod(info); | 5516 TestObjectPythonV8Internal::treatReturnedNullStringAsUndefinedStringMethodMe
thod(info); |
| 5517 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5517 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 5518 } | 5518 } |
| 5519 | 5519 |
| 5520 static void unforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 5521 { |
| 5522 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
| 5523 imp->unforgeableVoidMethod(); |
| 5524 } |
| 5525 |
| 5526 static void unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 5527 { |
| 5528 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 5529 TestObjectPythonV8Internal::unforgeableVoidMethodMethod(info); |
| 5530 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 5531 } |
| 5532 |
| 5520 } // namespace TestObjectPythonV8Internal | 5533 } // namespace TestObjectPythonV8Internal |
| 5521 | 5534 |
| 5522 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib
utes[] = { | 5535 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttrib
utes[] = { |
| 5523 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5536 {"readonlyStringAttribute", TestObjectPythonV8Internal::readonlyStringAttrib
uteAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU
LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 5524 {"readonlyTestInterfaceEmptyAttribute", TestObjectPythonV8Internal::readonly
TestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, | 5537 {"readonlyTestInterfaceEmptyAttribute", TestObjectPythonV8Internal::readonly
TestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, |
| 5525 {"readonlyLongAttribute", TestObjectPythonV8Internal::readonlyLongAttributeA
ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5538 {"readonlyLongAttribute", TestObjectPythonV8Internal::readonlyLongAttributeA
ttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT),
static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 5526 {"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 */}, | 5539 {"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 */}, |
| 5527 {"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 */}, | 5540 {"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 */}, |
| 5528 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim
eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro
l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, | 5541 {"readonlyDOMTimeStampAttribute", TestObjectPythonV8Internal::readonlyDOMTim
eStampAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContro
l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, |
| 5529 {"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 */}, | 5542 {"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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5894 const int perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc = 1; | 5907 const int perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc = 1; |
| 5895 v8::Handle<v8::FunctionTemplate> perWorldBindingsVoidMethodTestInterfaceEmpt
yArgArgv[perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateDa
ta::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWo
rldType) }; | 5908 v8::Handle<v8::FunctionTemplate> perWorldBindingsVoidMethodTestInterfaceEmpt
yArgArgv[perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateDa
ta::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWo
rldType) }; |
| 5896 v8::Handle<v8::Signature> perWorldBindingsVoidMethodTestInterfaceEmptyArgSig
nature = v8::Signature::New(desc, perWorldBindingsVoidMethodTestInterfaceEmptyAr
gArgc, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv); | 5909 v8::Handle<v8::Signature> perWorldBindingsVoidMethodTestInterfaceEmptyArgSig
nature = v8::Signature::New(desc, perWorldBindingsVoidMethodTestInterfaceEmptyAr
gArgc, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv); |
| 5897 if (currentWorldType == MainWorld) { | 5910 if (currentWorldType == MainWorld) { |
| 5898 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac
eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi
ngsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, v8Undefined(), per
WorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1)); | 5911 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac
eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi
ngsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, v8Undefined(), per
WorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1)); |
| 5899 } else { | 5912 } else { |
| 5900 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac
eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi
ngsVoidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), perWorldBinding
sVoidMethodTestInterfaceEmptyArgSignature, 1)); | 5913 proto->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfac
eEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindi
ngsVoidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), perWorldBinding
sVoidMethodTestInterfaceEmptyArgSignature, 1)); |
| 5901 } | 5914 } |
| 5902 proto->Set(v8::String::NewSymbol("readOnlyVoidMethod"), v8::FunctionTemplate
::New(TestObjectPythonV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined(
), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8:
:ReadOnly)); | 5915 proto->Set(v8::String::NewSymbol("readOnlyVoidMethod"), v8::FunctionTemplate
::New(TestObjectPythonV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined(
), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8:
:ReadOnly)); |
| 5903 proto->Set(v8::String::NewSymbol("notEnumerableReadOnlyVoidMethod"), v8::Fun
ctionTemplate::New(TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMe
thodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttri
bute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly)); | 5916 proto->Set(v8::String::NewSymbol("notEnumerableReadOnlyVoidMethod"), v8::Fun
ctionTemplate::New(TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMe
thodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttri
bute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly)); |
| 5917 instance->Set(v8::String::NewSymbol("unforgeableVoidMethod"), v8::FunctionTe
mplate::New(TestObjectPythonV8Internal::unforgeableVoidMethodMethodCallback, v8U
ndefined(), defaultSignature, 0)); |
| 5904 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttribute"),
TestObjectPythonV8Internal::staticStringAttributeAttributeGetterCallback, TestOb
jectPythonV8Internal::staticStringAttributeAttributeSetterCallback, v8::External
::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorS
ignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 5918 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttribute"),
TestObjectPythonV8Internal::staticStringAttributeAttributeGetterCallback, TestOb
jectPythonV8Internal::staticStringAttributeAttributeSetterCallback, v8::External
::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorS
ignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| 5905 desc->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), Te
stObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObject
PythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(
0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignatu
re>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 5919 desc->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), Te
stObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObject
PythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(
0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignatu
re>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| 5906 | 5920 |
| 5907 // Custom toString template | 5921 // Custom toString template |
| 5908 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 5922 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
| 5909 return desc; | 5923 return desc; |
| 5910 } | 5924 } |
| 5911 | 5925 |
| 5912 v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* is
olate, WrapperWorldType currentWorldType) | 5926 v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* is
olate, WrapperWorldType currentWorldType) |
| 5913 { | 5927 { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5976 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &wrapperT
ypeInfo, wrapper, isolate, WrapperConfiguration::Independent); | 5990 V8DOMWrapper::associateObjectWithWrapper<V8TestObjectPython>(impl, &wrapperT
ypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
| 5977 return wrapper; | 5991 return wrapper; |
| 5978 } | 5992 } |
| 5979 | 5993 |
| 5980 void V8TestObjectPython::derefObject(void* object) | 5994 void V8TestObjectPython::derefObject(void* object) |
| 5981 { | 5995 { |
| 5982 fromInternalPointer(object)->deref(); | 5996 fromInternalPointer(object)->deref(); |
| 5983 } | 5997 } |
| 5984 | 5998 |
| 5985 } // namespace WebCore | 5999 } // namespace WebCore |
| OLD | NEW |