| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 { | 538 { |
| 539 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 539 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 540 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); | 540 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); |
| 541 TestObjV8Internal::testObjAttrAttributeGetter(info); | 541 TestObjV8Internal::testObjAttrAttributeGetter(info); |
| 542 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 542 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 543 } | 543 } |
| 544 | 544 |
| 545 static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) | 545 static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) |
| 546 { | 546 { |
| 547 TestObj* imp = V8TestObject::toNative(info.Holder()); | 547 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 548 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 548 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 549 imp->setTestObjAttr(WTF::getPtr(cppValue)); | 549 imp->setTestObjAttr(WTF::getPtr(cppValue)); |
| 550 } | 550 } |
| 551 | 551 |
| 552 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 552 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 553 { | 553 { |
| 554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 555 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); | 555 UseCounter::count(activeExecutionContext(), UseCounter::TestFeature); |
| 556 TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info); | 556 TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info); |
| 557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 558 } | 558 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 594 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
| 595 { | 595 { |
| 596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 596 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 597 TestObjV8Internal::XMLObjAttrAttributeGetter(info); | 597 TestObjV8Internal::XMLObjAttrAttributeGetter(info); |
| 598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 599 } | 599 } |
| 600 | 600 |
| 601 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 601 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
| 602 { | 602 { |
| 603 TestObj* imp = V8TestObject::toNative(info.Holder()); | 603 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 604 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 604 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 605 imp->setXMLObjAttr(WTF::getPtr(cppValue)); | 605 imp->setXMLObjAttr(WTF::getPtr(cppValue)); |
| 606 } | 606 } |
| 607 | 607 |
| 608 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 608 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 609 { | 609 { |
| 610 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 610 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 611 TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info); | 611 TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info); |
| 612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 613 } | 613 } |
| 614 | 614 |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1635 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1636 { | 1636 { |
| 1637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1638 TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info); | 1638 TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info); |
| 1639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 1642 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
| 1643 { | 1643 { |
| 1644 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1644 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1645 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1645 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1646 ExecutionContext* scriptContext = getExecutionContext(); | 1646 ExecutionContext* scriptContext = getExecutionContext(); |
| 1647 imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue)); | 1647 imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue)); |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 1650 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
| 1651 { | 1651 { |
| 1652 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1652 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 1653 TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, inf
o); | 1653 TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, inf
o); |
| 1654 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1654 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 1657 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
| 1658 { | 1658 { |
| 1659 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1659 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1660 v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), i
mp); | 1660 v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), i
mp); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1663 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::L
ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1664 { | 1664 { |
| 1665 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1665 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1666 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(in
fo); | 1666 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(in
fo); |
| 1667 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1667 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1668 } | 1668 } |
| 1669 | 1669 |
| 1670 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1670 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 1671 { | 1671 { |
| 1672 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1672 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1673 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1673 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1674 imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMW
indow(), WTF::getPtr(cppValue)); | 1674 imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMW
indow(), WTF::getPtr(cppValue)); |
| 1675 } | 1675 } |
| 1676 | 1676 |
| 1677 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) | 1677 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) |
| 1678 { | 1678 { |
| 1679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 1680 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js
Value, info); | 1680 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js
Value, info); |
| 1681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1682 } | 1682 } |
| 1683 | 1683 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1702 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1702 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1703 { | 1703 { |
| 1704 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1704 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1705 TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info); | 1705 TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info); |
| 1706 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1706 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1707 } | 1707 } |
| 1708 | 1708 |
| 1709 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) | 1709 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) |
| 1710 { | 1710 { |
| 1711 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1711 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1712 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1712 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1713 ScriptState* currentState = ScriptState::current(); | 1713 ScriptState* currentState = ScriptState::current(); |
| 1714 if (!currentState) | 1714 if (!currentState) |
| 1715 return; | 1715 return; |
| 1716 ScriptState& state = *currentState; | 1716 ScriptState& state = *currentState; |
| 1717 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue)); | 1717 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue)); |
| 1718 if (state.hadException()) | 1718 if (state.hadException()) |
| 1719 throwError(state.exception(), info.GetIsolate()); | 1719 throwError(state.exception(), info.GetIsolate()); |
| 1720 } | 1720 } |
| 1721 | 1721 |
| 1722 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) | 1722 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1740 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1740 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1741 { | 1741 { |
| 1742 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1742 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1743 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info); | 1743 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info); |
| 1744 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1744 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1745 } | 1745 } |
| 1746 | 1746 |
| 1747 static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1747 static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 1748 { | 1748 { |
| 1749 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1749 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1750 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1750 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1751 ExecutionContext* scriptContext = getExecutionContext(); | 1751 ExecutionContext* scriptContext = getExecutionContext(); |
| 1752 imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppVa
lue)); | 1752 imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppVa
lue)); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local
<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>
& info) | 1755 static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local
<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>
& info) |
| 1756 { | 1756 { |
| 1757 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1757 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 1758 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValu
e, info); | 1758 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValu
e, info); |
| 1759 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1759 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1760 } | 1760 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1773 static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1773 static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1774 { | 1774 { |
| 1775 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1775 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1776 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGette
r(info); | 1776 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGette
r(info); |
| 1777 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1777 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1778 } | 1778 } |
| 1779 | 1779 |
| 1780 static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1780 static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 1781 { | 1781 { |
| 1782 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1782 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1783 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1783 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1784 ScriptState* currentState = ScriptState::current(); | 1784 ScriptState* currentState = ScriptState::current(); |
| 1785 if (!currentState) | 1785 if (!currentState) |
| 1786 return; | 1786 return; |
| 1787 ScriptState& state = *currentState; | 1787 ScriptState& state = *currentState; |
| 1788 ExecutionContext* scriptContext = getExecutionContext(); | 1788 ExecutionContext* scriptContext = getExecutionContext(); |
| 1789 imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, W
TF::getPtr(cppValue)); | 1789 imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, W
TF::getPtr(cppValue)); |
| 1790 if (state.hadException()) | 1790 if (state.hadException()) |
| 1791 throwError(state.exception(), info.GetIsolate()); | 1791 throwError(state.exception(), info.GetIsolate()); |
| 1792 } | 1792 } |
| 1793 | 1793 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1820 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCall
back(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1820 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCall
back(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1821 { | 1821 { |
| 1822 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1822 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1823 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttribut
eGetter(info); | 1823 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttribut
eGetter(info); |
| 1824 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1824 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1825 } | 1825 } |
| 1826 | 1826 |
| 1827 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8:
:Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1827 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8:
:Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 1828 { | 1828 { |
| 1829 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1829 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1830 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1830 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1831 ScriptState* currentState = ScriptState::current(); | 1831 ScriptState* currentState = ScriptState::current(); |
| 1832 if (!currentState) | 1832 if (!currentState) |
| 1833 return; | 1833 return; |
| 1834 ScriptState& state = *currentState; | 1834 ScriptState& state = *currentState; |
| 1835 ExecutionContext* scriptContext = getExecutionContext(); | 1835 ExecutionContext* scriptContext = getExecutionContext(); |
| 1836 imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptCont
ext, WTF::getPtr(cppValue)); | 1836 imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptCont
ext, WTF::getPtr(cppValue)); |
| 1837 if (state.hadException()) | 1837 if (state.hadException()) |
| 1838 throwError(state.exception(), info.GetIsolate()); | 1838 throwError(state.exception(), info.GetIsolate()); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1859 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter
Callback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1859 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter
Callback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1860 { | 1860 { |
| 1861 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1861 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 1862 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttr
ibuteGetter(info); | 1862 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttr
ibuteGetter(info); |
| 1863 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 1863 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 1864 } | 1864 } |
| 1865 | 1865 |
| 1866 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter
(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1866 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter
(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 1867 { | 1867 { |
| 1868 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1868 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 1869 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 1869 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 1870 ScriptState* currentState = ScriptState::current(); | 1870 ScriptState* currentState = ScriptState::current(); |
| 1871 if (!currentState) | 1871 if (!currentState) |
| 1872 return; | 1872 return; |
| 1873 ScriptState& state = *currentState; | 1873 ScriptState& state = *currentState; |
| 1874 ExecutionContext* scriptContext = getExecutionContext(); | 1874 ExecutionContext* scriptContext = getExecutionContext(); |
| 1875 imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, script
Context, WTF::getPtr(cppValue)); | 1875 imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, script
Context, WTF::getPtr(cppValue)); |
| 1876 if (state.hadException()) | 1876 if (state.hadException()) |
| 1877 throwError(state.exception(), info.GetIsolate()); | 1877 throwError(state.exception(), info.GetIsolate()); |
| 1878 } | 1878 } |
| 1879 | 1879 |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, cons
t v8::PropertyCallbackInfo<v8::Value>& info) | 2765 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, cons
t v8::PropertyCallbackInfo<v8::Value>& info) |
| 2766 { | 2766 { |
| 2767 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2767 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 2768 TestObjV8Internal::perWorldAttributeAttributeGetter(info); | 2768 TestObjV8Internal::perWorldAttributeAttributeGetter(info); |
| 2769 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 2769 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 2770 } | 2770 } |
| 2771 | 2771 |
| 2772 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) | 2772 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const
v8::PropertyCallbackInfo<void>& info) |
| 2773 { | 2773 { |
| 2774 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2774 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2775 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 2775 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 2776 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); | 2776 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); |
| 2777 } | 2777 } |
| 2778 | 2778 |
| 2779 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::
Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2779 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::
Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 2780 { | 2780 { |
| 2781 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2781 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 2782 TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info); | 2782 TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info); |
| 2783 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 2783 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 2784 } | 2784 } |
| 2785 | 2785 |
| 2786 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 2786 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
| 2787 { | 2787 { |
| 2788 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2788 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2789 v8SetReturnValueForMainWorld(info, imp->perWorldAttribute()); | 2789 v8SetReturnValueForMainWorld(info, imp->perWorldAttribute()); |
| 2790 } | 2790 } |
| 2791 | 2791 |
| 2792 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2792 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 2793 { | 2793 { |
| 2794 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2794 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 2795 TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info); | 2795 TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info); |
| 2796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 2796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 2797 } | 2797 } |
| 2798 | 2798 |
| 2799 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 2799 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
| 2800 { | 2800 { |
| 2801 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2801 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 2802 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<
v8::Object>::Cast(jsValue)) : 0); | 2802 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.
GetIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) :
0); |
| 2803 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); | 2803 imp->setPerWorldAttribute(WTF::getPtr(cppValue)); |
| 2804 } | 2804 } |
| 2805 | 2805 |
| 2806 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 2806 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
| 2807 { | 2807 { |
| 2808 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2808 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 2809 TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, inf
o); | 2809 TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, inf
o); |
| 2810 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 2810 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 2811 } | 2811 } |
| 2812 | 2812 |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3476 { | 3476 { |
| 3477 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); | 3477 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| 3478 if (UNLIKELY(info.Length() < 3)) { | 3478 if (UNLIKELY(info.Length() < 3)) { |
| 3479 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 3479 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
| 3480 exceptionState.throwIfNeeded(); | 3480 exceptionState.throwIfNeeded(); |
| 3481 return; | 3481 return; |
| 3482 } | 3482 } |
| 3483 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3483 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3484 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3484 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
| 3485 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3485 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 3486 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); | 3486 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0)
; |
| 3487 imp->voidMethodWithArgs(longArg, strArg, objArg); | 3487 imp->voidMethodWithArgs(longArg, strArg, objArg); |
| 3488 } | 3488 } |
| 3489 | 3489 |
| 3490 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3490 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3491 { | 3491 { |
| 3492 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3492 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3493 TestObjV8Internal::voidMethodWithArgsMethod(info); | 3493 TestObjV8Internal::voidMethodWithArgsMethod(info); |
| 3494 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3494 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 3495 } | 3495 } |
| 3496 | 3496 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 3511 { | 3511 { |
| 3512 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); | 3512 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| 3513 if (UNLIKELY(info.Length() < 3)) { | 3513 if (UNLIKELY(info.Length() < 3)) { |
| 3514 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 3514 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
| 3515 exceptionState.throwIfNeeded(); | 3515 exceptionState.throwIfNeeded(); |
| 3516 return; | 3516 return; |
| 3517 } | 3517 } |
| 3518 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3518 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3519 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3519 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
| 3520 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3520 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 3521 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); | 3521 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0)
; |
| 3522 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg)); | 3522 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg)); |
| 3523 } | 3523 } |
| 3524 | 3524 |
| 3525 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3525 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 3526 { | 3526 { |
| 3527 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3527 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3528 TestObjV8Internal::longMethodWithArgsMethod(info); | 3528 TestObjV8Internal::longMethodWithArgsMethod(info); |
| 3529 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3529 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 3530 } | 3530 } |
| 3531 | 3531 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3547 { | 3547 { |
| 3548 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWi
thArgs", "TestObject", info.Holder(), info.GetIsolate()); | 3548 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWi
thArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| 3549 if (UNLIKELY(info.Length() < 3)) { | 3549 if (UNLIKELY(info.Length() < 3)) { |
| 3550 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 3550 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
| 3551 exceptionState.throwIfNeeded(); | 3551 exceptionState.throwIfNeeded(); |
| 3552 return; | 3552 return; |
| 3553 } | 3553 } |
| 3554 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3554 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3555 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 3555 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); |
| 3556 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3556 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 3557 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); | 3557 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0)
; |
| 3558 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg)); | 3558 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg)); |
| 3559 } | 3559 } |
| 3560 | 3560 |
| 3561 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3561 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 3562 { | 3562 { |
| 3563 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3563 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3564 TestObjV8Internal::objMethodWithArgsMethod(info); | 3564 TestObjV8Internal::objMethodWithArgsMethod(info); |
| 3565 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3565 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 3566 } | 3566 } |
| 3567 | 3567 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3629 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3629 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 3630 { | 3630 { |
| 3631 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); | 3631 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); |
| 3632 if (UNLIKELY(info.Length() < 2)) { | 3632 if (UNLIKELY(info.Length() < 2)) { |
| 3633 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 3633 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 3634 exceptionState.throwIfNeeded(); | 3634 exceptionState.throwIfNeeded(); |
| 3635 return; | 3635 return; |
| 3636 } | 3636 } |
| 3637 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3637 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3638 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 3638 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 3639 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 3639 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0)
; |
| 3640 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, exceptionState); | 3640 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, exceptionState); |
| 3641 if (exceptionState.throwIfNeeded()) | 3641 if (exceptionState.throwIfNeeded()) |
| 3642 return; | 3642 return; |
| 3643 v8SetReturnValue(info, result.release()); | 3643 v8SetReturnValue(info, result.release()); |
| 3644 } | 3644 } |
| 3645 | 3645 |
| 3646 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3646 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 3647 { | 3647 { |
| 3648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3649 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); | 3649 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4548 imp->overloadedMethod(callbackInterfaceArg.release()); | 4548 imp->overloadedMethod(callbackInterfaceArg.release()); |
| 4549 } | 4549 } |
| 4550 | 4550 |
| 4551 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4551 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 4552 { | 4552 { |
| 4553 if (UNLIKELY(info.Length() < 1)) { | 4553 if (UNLIKELY(info.Length() < 1)) { |
| 4554 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4554 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 4555 return; | 4555 return; |
| 4556 } | 4556 } |
| 4557 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4557 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4558 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); | 4558 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0)
; |
| 4559 imp->overloadedMethod(objArg); | 4559 imp->overloadedMethod(objArg); |
| 4560 } | 4560 } |
| 4561 | 4561 |
| 4562 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4562 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 4563 { | 4563 { |
| 4564 if (UNLIKELY(info.Length() < 1)) { | 4564 if (UNLIKELY(info.Length() < 1)) { |
| 4565 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4565 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
| 4566 return; | 4566 return; |
| 4567 } | 4567 } |
| 4568 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4568 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 4584 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4584 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4585 { | 4585 { |
| 4586 if (((info.Length() == 1))) { | 4586 if (((info.Length() == 1))) { |
| 4587 overloadedMethod1Method(info); | 4587 overloadedMethod1Method(info); |
| 4588 return; | 4588 return; |
| 4589 } | 4589 } |
| 4590 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction())))
{ | 4590 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction())))
{ |
| 4591 overloadedMethod2Method(info); | 4591 overloadedMethod2Method(info); |
| 4592 return; | 4592 return; |
| 4593 } | 4593 } |
| 4594 if (((info.Length() == 1) && (V8TestObject::hasInstance(info[0], info.GetIso
late(), worldType(info.GetIsolate()))))) { | 4594 if (((info.Length() == 1) && (V8TestObject::hasInstance(info[0], info.GetIso
late())))) { |
| 4595 overloadedMethod3Method(info); | 4595 overloadedMethod3Method(info); |
| 4596 return; | 4596 return; |
| 4597 } | 4597 } |
| 4598 if (((info.Length() == 1) && (info[0]->IsArray()))) { | 4598 if (((info.Length() == 1) && (info[0]->IsArray()))) { |
| 4599 overloadedMethod4Method(info); | 4599 overloadedMethod4Method(info); |
| 4600 return; | 4600 return; |
| 4601 } | 4601 } |
| 4602 if (((info.Length() == 1) && (info[0]->IsArray()))) { | 4602 if (((info.Length() == 1) && (info[0]->IsArray()))) { |
| 4603 overloadedMethod5Method(info); | 4603 overloadedMethod5Method(info); |
| 4604 return; | 4604 return; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4622 | 4622 |
| 4623 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4623 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 4624 { | 4624 { |
| 4625 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); | 4625 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); |
| 4626 if (UNLIKELY(info.Length() < 1)) { | 4626 if (UNLIKELY(info.Length() < 1)) { |
| 4627 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4627 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 4628 exceptionState.throwIfNeeded(); | 4628 exceptionState.throwIfNeeded(); |
| 4629 return; | 4629 return; |
| 4630 } | 4630 } |
| 4631 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4631 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4632 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); | 4632 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0)
; |
| 4633 if (UNLIKELY(info.Length() <= 1)) { | 4633 if (UNLIKELY(info.Length() <= 1)) { |
| 4634 imp->overloadedMethodA(objArg); | 4634 imp->overloadedMethodA(objArg); |
| 4635 return; | 4635 return; |
| 4636 } | 4636 } |
| 4637 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), ex
ceptionState); | 4637 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), ex
ceptionState); |
| 4638 imp->overloadedMethodA(objArg, longArg); | 4638 imp->overloadedMethodA(objArg, longArg); |
| 4639 } | 4639 } |
| 4640 | 4640 |
| 4641 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4641 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 4642 { | 4642 { |
| 4643 if (UNLIKELY(info.Length() < 2)) { | 4643 if (UNLIKELY(info.Length() < 2)) { |
| 4644 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI
solate()); | 4644 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI
solate()); |
| 4645 return; | 4645 return; |
| 4646 } | 4646 } |
| 4647 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4647 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4648 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); | 4648 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0)
; |
| 4649 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 4649 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| 4650 imp->overloadedMethodA(objArg, strArg); | 4650 imp->overloadedMethodA(objArg, strArg); |
| 4651 } | 4651 } |
| 4652 | 4652 |
| 4653 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4653 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 4654 { | 4654 { |
| 4655 if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance
(info[0], info.GetIsolate(), worldType(info.GetIsolate())))) || ((info.Length()
== 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolat
e(), worldType(info.GetIsolate()))))) { | 4655 if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance
(info[0], info.GetIsolate()))) || ((info.Length() == 2) && (info[0]->IsNull() ||
V8TestObject::hasInstance(info[0], info.GetIsolate())))) { |
| 4656 overloadedMethodA1Method(info); | 4656 overloadedMethodA1Method(info); |
| 4657 return; | 4657 return; |
| 4658 } | 4658 } |
| 4659 if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance
(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) { | 4659 if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance
(info[0], info.GetIsolate())))) { |
| 4660 overloadedMethodA2Method(info); | 4660 overloadedMethodA2Method(info); |
| 4661 return; | 4661 return; |
| 4662 } | 4662 } |
| 4663 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); | 4663 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); |
| 4664 if (UNLIKELY(info.Length() < 1)) { | 4664 if (UNLIKELY(info.Length() < 1)) { |
| 4665 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4665 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 4666 exceptionState.throwIfNeeded(); | 4666 exceptionState.throwIfNeeded(); |
| 4667 return; | 4667 return; |
| 4668 } | 4668 } |
| 4669 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 4669 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4926 | 4926 |
| 4927 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4927 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 4928 { | 4928 { |
| 4929 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); | 4929 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); |
| 4930 if (UNLIKELY(info.Length() < 1)) { | 4930 if (UNLIKELY(info.Length() < 1)) { |
| 4931 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 4931 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 4932 exceptionState.throwIfNeeded(); | 4932 exceptionState.throwIfNeeded(); |
| 4933 return; | 4933 return; |
| 4934 } | 4934 } |
| 4935 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4935 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4936 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); | 4936 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate()) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(in
fo[0])) : 0); |
| 4937 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); | 4937 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); |
| 4938 if (exceptionState.throwIfNeeded()) | 4938 if (exceptionState.throwIfNeeded()) |
| 4939 return; | 4939 return; |
| 4940 v8SetReturnValue(info, result.release()); | 4940 v8SetReturnValue(info, result.release()); |
| 4941 } | 4941 } |
| 4942 | 4942 |
| 4943 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4943 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 4944 { | 4944 { |
| 4945 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4945 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4946 TestObjV8Internal::domStringListFunctionMethod(info); | 4946 TestObjV8Internal::domStringListFunctionMethod(info); |
| 4947 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 4947 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 4948 } | 4948 } |
| 4949 | 4949 |
| 4950 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4950 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4951 { | 4951 { |
| 4952 if (UNLIKELY(info.Length() < 1)) { | 4952 if (UNLIKELY(info.Length() < 1)) { |
| 4953 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4953 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
| 4954 return; | 4954 return; |
| 4955 } | 4955 } |
| 4956 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4956 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4957 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4957 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate()) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 4958 imp->convert1(value); | 4958 imp->convert1(value); |
| 4959 } | 4959 } |
| 4960 | 4960 |
| 4961 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4961 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4962 { | 4962 { |
| 4963 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4963 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4964 TestObjV8Internal::convert1Method(info); | 4964 TestObjV8Internal::convert1Method(info); |
| 4965 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 4965 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 4966 } | 4966 } |
| 4967 | 4967 |
| 4968 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4968 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 4969 { | 4969 { |
| 4970 if (UNLIKELY(info.Length() < 1)) { | 4970 if (UNLIKELY(info.Length() < 1)) { |
| 4971 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4971 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
| 4972 return; | 4972 return; |
| 4973 } | 4973 } |
| 4974 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4974 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 4975 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4975 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate()) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 4976 imp->convert2(value); | 4976 imp->convert2(value); |
| 4977 } | 4977 } |
| 4978 | 4978 |
| 4979 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4979 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 4980 { | 4980 { |
| 4981 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4981 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 4982 TestObjV8Internal::convert2Method(info); | 4982 TestObjV8Internal::convert2Method(info); |
| 4983 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 4983 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 4984 } | 4984 } |
| 4985 | 4985 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 5059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 5060 } | 5060 } |
| 5061 | 5061 |
| 5062 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 5062 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 5063 { | 5063 { |
| 5064 if (UNLIKELY(info.Length() < 1)) { | 5064 if (UNLIKELY(info.Length() < 1)) { |
| 5065 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); | 5065 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); |
| 5066 return; | 5066 return; |
| 5067 } | 5067 } |
| 5068 TestObj* imp = V8TestObject::toNative(info.Holder()); | 5068 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 5069 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); | 5069 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate())
? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 5070 Vector<RefPtr<Node> > tail; | 5070 Vector<RefPtr<Node> > tail; |
| 5071 for (int i = 1; i < info.Length(); ++i) { | 5071 for (int i = 1; i < info.Length(); ++i) { |
| 5072 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { | 5072 if (!V8Node::hasInstance(info[i], info.GetIsolate())) { |
| 5073 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); | 5073 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); |
| 5074 return; | 5074 return; |
| 5075 } | 5075 } |
| 5076 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); | 5076 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); |
| 5077 } | 5077 } |
| 5078 imp->variadicNodeMethod(head, tail); | 5078 imp->variadicNodeMethod(head, tail); |
| 5079 } | 5079 } |
| 5080 | 5080 |
| 5081 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 5081 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 5082 { | 5082 { |
| 5083 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5083 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 5084 TestObjV8Internal::variadicNodeMethodMethod(info); | 5084 TestObjV8Internal::variadicNodeMethodMethod(info); |
| 5085 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 5085 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 5086 } | 5086 } |
| 5087 | 5087 |
| 5088 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 5088 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| 5089 { | 5089 { |
| 5090 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
ullableArguments", "TestObject", info.Holder(), info.GetIsolate()); | 5090 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
ullableArguments", "TestObject", info.Holder(), info.GetIsolate()); |
| 5091 if (UNLIKELY(info.Length() < 3)) { | 5091 if (UNLIKELY(info.Length() < 3)) { |
| 5092 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); | 5092 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, i
nfo.Length())); |
| 5093 exceptionState.throwIfNeeded(); | 5093 exceptionState.throwIfNeeded(); |
| 5094 return; | 5094 return; |
| 5095 } | 5095 } |
| 5096 TestObj* imp = V8TestObject::toNative(info.Holder()); | 5096 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 5097 bool strIsNull = info[0]->IsNull(); | 5097 bool strIsNull = info[0]->IsNull(); |
| 5098 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); | 5098 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); |
| 5099 String str = strStringResource; | 5099 String str = strStringResource; |
| 5100 bool lIsNull = info[1]->IsNull(); | 5100 bool lIsNull = info[1]->IsNull(); |
| 5101 V8TRYCATCH_EXCEPTION_VOID(int, l, toInt32(info[1], exceptionState), exceptio
nState); | 5101 V8TRYCATCH_EXCEPTION_VOID(int, l, toInt32(info[1], exceptionState), exceptio
nState); |
| 5102 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::hasInstance(info[2], info.GetIs
olate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::O
bject>::Cast(info[2])) : 0); | 5102 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::hasInstance(info[2], info.GetIs
olate()) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0); |
| 5103 if (UNLIKELY(info.Length() <= 3)) { | 5103 if (UNLIKELY(info.Length() <= 3)) { |
| 5104 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l,
obj); | 5104 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l,
obj); |
| 5105 return; | 5105 return; |
| 5106 } | 5106 } |
| 5107 bool dIsNull = info[3]->IsNull(); | 5107 bool dIsNull = info[3]->IsNull(); |
| 5108 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); | 5108 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); |
| 5109 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
, dIsNull ? 0 : &d); | 5109 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
, dIsNull ? 0 : &d); |
| 5110 } | 5110 } |
| 5111 | 5111 |
| 5112 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 5112 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5858 return result->value.newLocal(isolate); | 5858 return result->value.newLocal(isolate); |
| 5859 | 5859 |
| 5860 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 5860 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 5861 v8::EscapableHandleScope handleScope(isolate); | 5861 v8::EscapableHandleScope handleScope(isolate); |
| 5862 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 5862 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 5863 configureV8TestObjectTemplate(templ, isolate, currentWorldType); | 5863 configureV8TestObjectTemplate(templ, isolate, currentWorldType); |
| 5864 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 5864 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 5865 return handleScope.Escape(templ); | 5865 return handleScope.Escape(templ); |
| 5866 } | 5866 } |
| 5867 | 5867 |
| 5868 bool V8TestObject::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isola
te, WrapperWorldType currentWorldType) | 5868 bool V8TestObject::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isola
te) |
| 5869 { | 5869 { |
| 5870 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 5870 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 5871 } | 5871 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 5872 | |
| 5873 bool V8TestObject::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate) | |
| 5874 { | |
| 5875 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 5876 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 5877 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 5878 } | 5872 } |
| 5879 | 5873 |
| 5880 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins
tanceTemplate, TestObj* impl, v8::Isolate* isolate) | 5874 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins
tanceTemplate, TestObj* impl, v8::Isolate* isolate) |
| 5881 { | 5875 { |
| 5882 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); | 5876 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); |
| 5883 if (ContextFeatures::featureNameEnabled(impl->document())) { | 5877 if (ContextFeatures::featureNameEnabled(impl->document())) { |
| 5884 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 5878 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 5885 {"enabledPerContextAttr", TestObjV8Internal::enabledPerContextAttrAttrib
uteGetterCallback, TestObjV8Internal::enabledPerContextAttrAttributeSetterCallba
ck, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}; | 5879 {"enabledPerContextAttr", TestObjV8Internal::enabledPerContextAttrAttrib
uteGetterCallback, TestObjV8Internal::enabledPerContextAttrAttributeSetterCallba
ck, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}; |
| 5886 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 5880 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
| 5887 } | 5881 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5926 fromInternalPointer(object)->deref(); | 5920 fromInternalPointer(object)->deref(); |
| 5927 } | 5921 } |
| 5928 | 5922 |
| 5929 template<> | 5923 template<> |
| 5930 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5924 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
| 5931 { | 5925 { |
| 5932 return toV8(impl, creationContext, isolate); | 5926 return toV8(impl, creationContext, isolate); |
| 5933 } | 5927 } |
| 5934 | 5928 |
| 5935 } // namespace WebCore | 5929 } // namespace WebCore |
| OLD | NEW |