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 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 | 1609 |
1610 #if ENABLE(Condition1) && ENABLE(Condition2) | 1610 #if ENABLE(Condition1) && ENABLE(Condition2) |
1611 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1611 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1612 { | 1612 { |
1613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1614 TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info); | 1614 TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info); |
1615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1616 } | 1616 } |
1617 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 1617 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
1618 | 1618 |
1619 #if ENABLE(Condition1) || ENABLE(Condition2) | 1619 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1620 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1620 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1621 { | 1621 { |
1622 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1622 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1623 v8SetReturnValueInt(info, imp->conditionalAttr3()); | 1623 v8SetReturnValueInt(info, imp->conditionalAttr3()); |
1624 } | 1624 } |
1625 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 1625 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1626 | 1626 |
1627 #if ENABLE(Condition1) || ENABLE(Condition2) | 1627 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1628 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1628 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1629 { | 1629 { |
1630 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1630 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1631 TestObjV8Internal::conditionalAttr3AttributeGetter(info); | 1631 TestObjV8Internal::conditionalAttr3AttributeGetter(info); |
1632 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1632 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1633 } | 1633 } |
1634 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 1634 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1635 | 1635 |
1636 #if ENABLE(Condition1) || ENABLE(Condition2) | 1636 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1637 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 1637 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
1638 { | 1638 { |
1639 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1639 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1640 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); | 1640 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
1641 imp->setConditionalAttr3(cppValue); | 1641 imp->setConditionalAttr3(cppValue); |
1642 } | 1642 } |
1643 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 1643 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1644 | 1644 |
1645 #if ENABLE(Condition1) || ENABLE(Condition2) | 1645 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1646 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1646 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1647 { | 1647 { |
1648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1649 TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info); | 1649 TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info); |
1650 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1650 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1651 } | 1651 } |
1652 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 1652 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
1653 | 1653 |
1654 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) | 1654 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
1655 { | 1655 { |
1656 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1656 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1657 v8SetReturnValue(info, imp->cachedAttribute1().v8Value()); | 1657 v8SetReturnValue(info, imp->cachedAttribute1().v8Value()); |
1658 } | 1658 } |
1659 | 1659 |
1660 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1660 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1661 { | 1661 { |
1662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
(...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5159 {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttributeG
etterCallback, TestObjV8Internal::enforcedRangeLongAttrAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, | 5159 {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttributeG
etterCallback, TestObjV8Internal::enforcedRangeLongAttrAttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), 0 /* on instance */}, |
5160 {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLo
ngAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5160 {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLo
ngAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
5161 {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAt
tributeGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5161 {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAt
tributeGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, |
5162 {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsign
edLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedL
ongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::
DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5162 {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsign
edLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedL
ongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::
DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
5163 #if ENABLE(Condition1) | 5163 #if ENABLE(Condition1) |
5164 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5164 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
5165 #endif // ENABLE(Condition1) | 5165 #endif // ENABLE(Condition1) |
5166 #if ENABLE(Condition1) && ENABLE(Condition2) | 5166 #if ENABLE(Condition1) && ENABLE(Condition2) |
5167 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5167 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
5168 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 5168 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
5169 #if ENABLE(Condition1) || ENABLE(Condition2) | 5169 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
5170 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5170 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
5171 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 5171 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
5172 #if ENABLE(Condition1) | 5172 #if ENABLE(Condition1) |
5173 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperType
Info*>(&V8TestObjectectA::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::D
EFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, | 5173 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperType
Info*>(&V8TestObjectectA::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::D
EFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
5174 #endif // ENABLE(Condition1) | 5174 #endif // ENABLE(Condition1) |
5175 #if ENABLE(Condition1) && ENABLE(Condition2) | 5175 #if ENABLE(Condition1) && ENABLE(Condition2) |
5176 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperType
Info*>(&V8TestObjectectB::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::D
EFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, | 5176 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperType
Info*>(&V8TestObjectectB::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::D
EFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
5177 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 5177 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
5178 #if ENABLE(Condition1) || ENABLE(Condition2) | 5178 #if ENABLE(Condition1) || ENABLE(Condition2) |
5179 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperType
Info*>(&V8TestObjectectC::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::D
EFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, | 5179 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperType
Info*>(&V8TestObjectectC::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::D
EFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
5180 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 5180 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
5181 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | 5181 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5443 fromInternalPointer(object)->deref(); | 5443 fromInternalPointer(object)->deref(); |
5444 } | 5444 } |
5445 | 5445 |
5446 template<> | 5446 template<> |
5447 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5447 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5448 { | 5448 { |
5449 return toV8(impl, creationContext, isolate); | 5449 return toV8(impl, creationContext, isolate); |
5450 } | 5450 } |
5451 | 5451 |
5452 } // namespace WebCore | 5452 } // namespace WebCore |
OLD | NEW |