Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 456683002: bindings: Introduces type-check for the internal pointers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1380
1381 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 1381 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
1382 { 1382 {
1383 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 1383 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
1384 TestInterfaceImplementationV8Internal::namedPropertyEnumerator(info); 1384 TestInterfaceImplementationV8Internal::namedPropertyEnumerator(info);
1385 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1385 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1386 } 1386 }
1387 1387
1388 } // namespace TestInterfaceImplementationV8Internal 1388 } // namespace TestInterfaceImplementationV8Internal
1389 1389
1390 void V8TestInterface::visitDOMWrapper(void* object, const v8::Persistent<v8::Obj ect>& wrapper, v8::Isolate* isolate) 1390 void V8TestInterface::visitDOMWrapper(ScriptWrappableBase* internalPointer, cons t v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
1391 { 1391 {
1392 TestInterfaceImplementation* impl = fromInternalPointer(object); 1392 TestInterfaceImplementation* impl = fromInternalPointer(internalPointer);
1393 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper); 1393 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper);
1394 V8WrapperInstantiationScope scope(creationContext, isolate); 1394 V8WrapperInstantiationScope scope(creationContext, isolate);
1395 TestInterfaceImplementation* referencedName = impl->referencedName(); 1395 TestInterfaceImplementation* referencedName = impl->referencedName();
1396 if (referencedName) { 1396 if (referencedName) {
1397 if (!DOMDataStore::containsWrapper<V8TestInterface>(referencedName, isol ate)) 1397 if (!DOMDataStore::containsWrapper<V8TestInterface>(referencedName, isol ate))
1398 wrap(referencedName, creationContext, isolate); 1398 wrap(referencedName, creationContext, isolate);
1399 DOMDataStore::setWrapperReference<V8TestInterface>(wrapper, referencedNa me, isolate); 1399 DOMDataStore::setWrapperReference<V8TestInterface>(wrapper, referencedNa me, isolate);
1400 } 1400 }
1401 setObjectGroup(object, wrapper, isolate); 1401 setObjectGroup(internalPointer, wrapper, isolate);
1402 } 1402 }
1403 1403
1404 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttribute s[] = { 1404 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttribute s[] = {
1405 {"testInterfaceAttribute", TestInterfaceImplementationV8Internal::testInterf aceAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::test InterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessContro l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguratio n::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 1405 {"testInterfaceAttribute", TestInterfaceImplementationV8Internal::testInterf aceAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::test InterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessContro l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguratio n::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
1406 {"testInterfaceConstructorAttribute", TestInterfaceImplementationV8Internal: :TestInterfaceImplementationConstructorGetter, TestInterfaceImplementationV8Inte rnal::TestInterfaceImplementationForceSetAttributeOnThisCallback, 0, 0, const_ca st<WrapperTypeInfo*>(&V8TestInterface::wrapperTypeInfo), static_cast<v8::AccessC ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMCon figuration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 1406 {"testInterfaceConstructorAttribute", TestInterfaceImplementationV8Internal: :TestInterfaceImplementationConstructorGetter, TestInterfaceImplementationV8Inte rnal::TestInterfaceImplementationForceSetAttributeOnThisCallback, 0, 0, const_ca st<WrapperTypeInfo*>(&V8TestInterface::wrapperTypeInfo), static_cast<v8::AccessC ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMCon figuration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
1407 {"doubleAttribute", TestInterfaceImplementationV8Internal::doubleAttributeAt tributeGetterCallback, TestInterfaceImplementationV8Internal::doubleAttributeAtt ributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat ic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScript s, V8DOMConfiguration::OnInstance}, 1407 {"doubleAttribute", TestInterfaceImplementationV8Internal::doubleAttributeAt tributeGetterCallback, TestInterfaceImplementationV8Internal::doubleAttributeAtt ributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat ic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScript s, V8DOMConfiguration::OnInstance},
1408 {"floatAttribute", TestInterfaceImplementationV8Internal::floatAttributeAttr ibuteGetterCallback, TestInterfaceImplementationV8Internal::floatAttributeAttrib uteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_ cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 1408 {"floatAttribute", TestInterfaceImplementationV8Internal::floatAttributeAttr ibuteGetterCallback, TestInterfaceImplementationV8Internal::floatAttributeAttrib uteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_ cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
1409 {"unrestrictedDoubleAttribute", TestInterfaceImplementationV8Internal::unres trictedDoubleAttributeAttributeGetterCallback, TestInterfaceImplementationV8Inte rnal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v 8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8 DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 1409 {"unrestrictedDoubleAttribute", TestInterfaceImplementationV8Internal::unres trictedDoubleAttributeAttributeGetterCallback, TestInterfaceImplementationV8Inte rnal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v 8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8 DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
1410 {"unrestrictedFloatAttribute", TestInterfaceImplementationV8Internal::unrest rictedFloatAttributeAttributeGetterCallback, TestInterfaceImplementationV8Intern al::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8:: AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOM Configuration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 1410 {"unrestrictedFloatAttribute", TestInterfaceImplementationV8Internal::unrest rictedFloatAttributeAttributeGetterCallback, TestInterfaceImplementationV8Intern al::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8:: AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOM Configuration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
1411 {"implementsReadonlyStringAttribute", TestInterfaceImplementationV8Internal: :implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_ca st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None) , V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 1411 {"implementsReadonlyStringAttribute", TestInterfaceImplementationV8Internal: :implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_ca st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None) , V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e); 1584 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e);
1585 } 1585 }
1586 1586
1587 v8::Handle<v8::Object> V8TestInterface::findInstanceInPrototypeChain(v8::Handle< v8::Value> v8Value, v8::Isolate* isolate) 1587 v8::Handle<v8::Object> V8TestInterface::findInstanceInPrototypeChain(v8::Handle< v8::Value> v8Value, v8::Isolate* isolate)
1588 { 1588 {
1589 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 1589 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
1590 } 1590 }
1591 1591
1592 TestInterfaceImplementation* V8TestInterface::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) 1592 TestInterfaceImplementation* V8TestInterface::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
1593 { 1593 {
1594 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; 1594 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0;
1595 } 1595 }
1596 1596
1597 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceObject, TestInterfaceImplementation* impl, v8::Isolate* isolate) 1597 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceObject, TestInterfaceImplementation* impl, v8::Isolate* isolate)
1598 { 1598 {
1599 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype()); 1599 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype());
1600 if (ContextFeatures::implementsContextNameEnabled(impl->document())) { 1600 if (ContextFeatures::implementsContextNameEnabled(impl->document())) {
1601 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\ 1601 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu ration =\
1602 {"implementsPerContextEnabledNodeAttribute", TestInterfaceImplementation V8Internal::implementsPerContextEnabledNodeAttributeAttributeGetterCallback, Tes tInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttr ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts , V8DOMConfiguration::OnInstance}; 1602 {"implementsPerContextEnabledNodeAttribute", TestInterfaceImplementation V8Internal::implementsPerContextEnabledNodeAttributeAttributeGetterCallback, Tes tInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttr ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts , V8DOMConfiguration::OnInstance};
1603 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, at tributeConfiguration, isolate); 1603 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, at tributeConfiguration, isolate);
1604 } 1604 }
(...skipping 23 matching lines...) Expand all
1628 static const V8DOMConfiguration::MethodConfiguration methodConfiguration = {"partial2StaticVoidMethod", TestInterfaceImplementationV8Internal::partial2S taticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}; 1628 static const V8DOMConfiguration::MethodConfiguration methodConfiguration = {"partial2StaticVoidMethod", TestInterfaceImplementationV8Internal::partial2S taticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts};
1629 V8DOMConfiguration::installMethod(prototypeObject, defaultSignature, v8: :None, methodConfiguration, isolate); 1629 V8DOMConfiguration::installMethod(prototypeObject, defaultSignature, v8: :None, methodConfiguration, isolate);
1630 } 1630 }
1631 } 1631 }
1632 1632
1633 ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> wrapp er) 1633 ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> wrapp er)
1634 { 1634 {
1635 return toNative(wrapper); 1635 return toNative(wrapper);
1636 } 1636 }
1637 1637
1638 void V8TestInterface::derefObject(void* object) 1638 void V8TestInterface::derefObject(ScriptWrappableBase* internalPointer)
1639 { 1639 {
1640 fromInternalPointer(object)->deref(); 1640 fromInternalPointer(internalPointer)->deref();
1641 } 1641 }
1642 1642
1643 template<> 1643 template<>
1644 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate) 1644 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate)
1645 { 1645 {
1646 return toV8(impl, creationContext, isolate); 1646 return toV8(impl, creationContext, isolate);
1647 } 1647 }
1648 1648
1649 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result) 1649 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result)
1650 { 1650 {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 // FIXME: We should support exceptions other than DOM exceptions. 1739 // FIXME: We should support exceptions other than DOM exceptions.
1740 RELEASE_ASSERT_NOT_REACHED(); 1740 RELEASE_ASSERT_NOT_REACHED();
1741 } 1741 }
1742 return false; 1742 return false;
1743 } 1743 }
1744 return true; 1744 return true;
1745 } 1745 }
1746 1746
1747 } // namespace blink 1747 } // namespace blink
1748 #endif // ENABLE(CONDITION) 1748 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.h ('k') | Source/bindings/tests/results/V8TestInterface2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698