| OLD | NEW |
| 1 /* | 1 /* |
| 2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| 11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 Library General Public License for more details. | 13 Library General Public License for more details. |
| 14 | 14 |
| 15 You should have received a copy of the GNU Library General Public License | 15 You should have received a copy of the GNU Library General Public License |
| 16 along with this library; see the file COPYING.LIB. If not, write to | 16 along with this library; see the file COPYING.LIB. If not, write to |
| 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 18 Boston, MA 02111-1307, USA. | 18 Boston, MA 02111-1307, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include "config.h" | 21 #include "config.h" |
| 22 #include "V8TestObject.h" | 22 #include "V8TestObject.h" |
| 23 | 23 |
| 24 #include "HTMLNames.h" | 24 #include "HTMLNames.h" |
| 25 #include "RuntimeEnabledFeatures.h" | 25 #include "RuntimeEnabledFeatures.h" |
| 26 #include "V8DOMStringList.h" | 26 #include "V8DOMStringList.h" |
| 27 #include "V8Document.h" | 27 #include "V8Document.h" |
| 28 #include "V8EventTarget.h" |
| 28 #include "V8MessagePort.h" | 29 #include "V8MessagePort.h" |
| 29 #include "V8Node.h" | 30 #include "V8Node.h" |
| 30 #include "V8SVGDocument.h" | 31 #include "V8SVGDocument.h" |
| 31 #include "V8SVGPoint.h" | 32 #include "V8SVGPoint.h" |
| 32 #include "V8TestCallback.h" | 33 #include "V8TestCallback.h" |
| 33 #include "V8TestInterface.h" | 34 #include "V8TestInterface.h" |
| 34 #include "V8TestNode.h" | 35 #include "V8TestNode.h" |
| 35 #include "V8TestObjectectA.h" | 36 #include "V8TestObjectectA.h" |
| 36 #include "V8TestObjectectB.h" | 37 #include "V8TestObjectectB.h" |
| 37 #include "V8TestObjectectC.h" | 38 #include "V8TestObjectectC.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 82 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
| 82 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 83 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
| 83 // in the global namespace. | 84 // in the global namespace. |
| 84 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 85 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
| 85 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object) | 86 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object) |
| 86 { | 87 { |
| 87 WebCore::initializeScriptWrappableForInterface(object); | 88 WebCore::initializeScriptWrappableForInterface(object); |
| 88 } | 89 } |
| 89 | 90 |
| 90 namespace WebCore { | 91 namespace WebCore { |
| 91 WrapperTypeInfo V8TestObject::info = { V8TestObject::GetTemplate, V8TestObject::
derefObject, 0, 0, 0, V8TestObject::installPerContextPrototypeProperties, 0, Wra
pperTypeObjectPrototype }; | 92 WrapperTypeInfo V8TestObject::info = { V8TestObject::GetTemplate, V8TestObject::
derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextP
rototypeProperties, &V8EventTarget::info, WrapperTypeObjectPrototype }; |
| 92 | 93 |
| 93 namespace TestObjV8Internal { | 94 namespace TestObjV8Internal { |
| 94 | 95 |
| 95 template <typename T> void V8_USE(T) { } | 96 template <typename T> void V8_USE(T) { } |
| 96 | 97 |
| 97 static void readOnlyLongAttrAttrGetter(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 98 static void readOnlyLongAttrAttrGetter(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
| 98 { | 99 { |
| 99 TestObj* imp = V8TestObject::toNative(info.Holder()); | 100 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 100 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); | 101 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); |
| 101 return; | 102 return; |
| (...skipping 5500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5602 } | 5603 } |
| 5603 | 5604 |
| 5604 TestObjV8Internal::constructor(args); | 5605 TestObjV8Internal::constructor(args); |
| 5605 } | 5606 } |
| 5606 | 5607 |
| 5607 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle
<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorld
Type) | 5608 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle
<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorld
Type) |
| 5608 { | 5609 { |
| 5609 desc->ReadOnlyPrototype(); | 5610 desc->ReadOnlyPrototype(); |
| 5610 | 5611 |
| 5611 v8::Local<v8::Signature> defaultSignature; | 5612 v8::Local<v8::Signature> defaultSignature; |
| 5612 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject",
v8::Local<v8::FunctionTemplate>(), V8TestObject::internalFieldCount, | 5613 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestObject",
V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::internalFi
eldCount, |
| 5613 V8TestObjectAttrs, WTF_ARRAY_LENGTH(V8TestObjectAttrs), | 5614 V8TestObjectAttrs, WTF_ARRAY_LENGTH(V8TestObjectAttrs), |
| 5614 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), isolate, cur
rentWorldType); | 5615 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), isolate, cur
rentWorldType); |
| 5615 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | 5616 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. |
| 5616 desc->SetCallHandler(V8TestObject::constructorCallback); | 5617 desc->SetCallHandler(V8TestObject::constructorCallback); |
| 5617 desc->SetLength(1); | 5618 desc->SetLength(1); |
| 5618 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | 5619 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); |
| 5619 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); | 5620 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); |
| 5620 UNUSED_PARAM(instance); // In some cases, it will not be used. | 5621 UNUSED_PARAM(instance); // In some cases, it will not be used. |
| 5621 UNUSED_PARAM(proto); // In some cases, it will not be used. | 5622 UNUSED_PARAM(proto); // In some cases, it will not be used. |
| 5622 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) { | 5623 if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5763 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i
solate, worldType(isolate))); | 5764 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(i
solate, worldType(isolate))); |
| 5764 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | 5765 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. |
| 5765 | 5766 |
| 5766 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo
ntext()); | 5767 ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationCo
ntext()); |
| 5767 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe
thod1Enabled(toDocument(context))) | 5768 if (context && context->isDocument() && ContextFeatures::enabledPerContextMe
thod1Enabled(toDocument(context))) |
| 5768 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); | 5769 proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod1MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); |
| 5769 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) | 5770 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) |
| 5770 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); | 5771 proto->Set(v8::String::NewSymbol("enabledPerContextMethod2"), v8::Functi
onTemplate::New(TestObjV8Internal::enabledPerContextMethod2MethodCallback, v8Und
efined(), defaultSignature, 1)->GetFunction()); |
| 5771 } | 5772 } |
| 5772 | 5773 |
| 5774 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object) |
| 5775 { |
| 5776 return toNative(object); |
| 5777 } |
| 5778 |
| 5773 | 5779 |
| 5774 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) | 5780 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 5775 { | 5781 { |
| 5776 ASSERT(impl.get()); | 5782 ASSERT(impl.get()); |
| 5777 ASSERT(DOMDataStore::getWrapper<V8TestObject>(impl.get(), isolate).IsEmpty()
); | 5783 ASSERT(DOMDataStore::getWrapper<V8TestObject>(impl.get(), isolate).IsEmpty()
); |
| 5778 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 5784 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 5779 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 5785 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 5780 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 5786 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have |
| 5781 // the same object de-ref functions, though, so use that as the basis of
the check. | 5787 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 5782 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 5788 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); |
| 5783 } | 5789 } |
| 5784 | 5790 |
| 5785 | 5791 |
| 5786 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 5792 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); |
| 5787 if (UNLIKELY(wrapper.IsEmpty())) | 5793 if (UNLIKELY(wrapper.IsEmpty())) |
| 5788 return wrapper; | 5794 return wrapper; |
| 5789 installPerContextProperties(wrapper, impl.get(), isolate); | 5795 installPerContextProperties(wrapper, impl.get(), isolate); |
| 5790 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper,
isolate, WrapperConfiguration::Independent); | 5796 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper,
isolate, WrapperConfiguration::Independent); |
| 5791 return wrapper; | 5797 return wrapper; |
| 5792 } | 5798 } |
| 5793 void V8TestObject::derefObject(void* object) | 5799 void V8TestObject::derefObject(void* object) |
| 5794 { | 5800 { |
| 5795 fromInternalPointer(object)->deref(); | 5801 fromInternalPointer(object)->deref(); |
| 5796 } | 5802 } |
| 5797 | 5803 |
| 5798 } // namespace WebCore | 5804 } // namespace WebCore |
| OLD | NEW |