OLD | NEW |
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 "V8TestInterface.h" | 7 #include "V8TestInterface.h" |
8 | 8 |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "bindings/core/v8/GeneratedCodeHelper.h" | 10 #include "bindings/core/v8/GeneratedCodeHelper.h" |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 } | 1451 } |
1452 | 1452 |
1453 void partialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) | 1453 void partialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetterCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) |
1454 { | 1454 { |
1455 v8::Local<v8::Value> v8Value = info[0]; | 1455 v8::Local<v8::Value> v8Value = info[0]; |
1456 TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRunt
imeEnabledAttributeAttributeSetter(v8Value, info); | 1456 TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRunt
imeEnabledAttributeAttributeSetter(v8Value, info); |
1457 } | 1457 } |
1458 | 1458 |
1459 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) | 1459 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) |
1460 { | 1460 { |
| 1461 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1462 |
1461 if (UNLIKELY(info.Length() < 1)) { | 1463 if (UNLIKELY(info.Length() < 1)) { |
1462 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr
eateTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodT
estInterfaceEmptyArg", "TestInterface", ExceptionMessages::notEnoughArguments(1,
info.Length())))); | 1464 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", ExceptionMess
ages::notEnoughArguments(1, info.Length()))); |
1463 return; | 1465 return; |
1464 } | 1466 } |
1465 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1467 |
1466 TestInterfaceEmpty* testInterfaceEmptyArg; | 1468 TestInterfaceEmpty* testInterfaceEmptyArg; |
1467 { | 1469 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs
olate(), info[0]); |
1468 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[0]); | 1470 if (!testInterfaceEmptyArg) { |
1469 if (!testInterfaceEmptyArg) { | 1471 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "parameter 1
is not of type 'TestInterfaceEmpty'.")); |
1470 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "paramete
r 1 is not of type 'TestInterfaceEmpty'.")); | 1472 |
1471 return; | 1473 return; |
1472 } | |
1473 } | 1474 } |
| 1475 |
1474 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); | 1476 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); |
1475 } | 1477 } |
1476 | 1478 |
1477 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 1479 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
1478 { | 1480 { |
1479 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod
(info); | 1481 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod
(info); |
1480 } | 1482 } |
1481 | 1483 |
1482 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 1484 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
1483 { | 1485 { |
1484 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD
oubleArgFloatArg", "TestInterface", info.Holder(), info.GetIsolate()); | 1486 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "voidMethodDoubleArgFloatArg"); |
| 1487 |
| 1488 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1489 |
1485 if (UNLIKELY(info.Length() < 2)) { | 1490 if (UNLIKELY(info.Length() < 2)) { |
1486 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 1491 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
1487 return; | 1492 return; |
1488 } | 1493 } |
1489 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1494 |
1490 double doubleArg; | 1495 double doubleArg; |
1491 float floatArg; | 1496 float floatArg; |
1492 { | 1497 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
1493 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionStat
e); | 1498 if (exceptionState.hadException()) |
1494 if (exceptionState.hadException()) | 1499 return; |
1495 return; | 1500 |
1496 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState)
; | 1501 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); |
1497 if (exceptionState.hadException()) | 1502 if (exceptionState.hadException()) |
1498 return; | 1503 return; |
1499 } | 1504 |
1500 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); | 1505 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); |
1501 } | 1506 } |
1502 | 1507 |
1503 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 1508 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
1504 { | 1509 { |
1505 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(inf
o); | 1510 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(inf
o); |
1506 } | 1511 } |
1507 | 1512 |
1508 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
FunctionCallbackInfo<v8::Value>& info) | 1513 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
FunctionCallbackInfo<v8::Value>& info) |
1509 { | 1514 { |
1510 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodU
nrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface", info.Holder(), info.
GetIsolate()); | 1515 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); |
| 1516 |
| 1517 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1518 |
1511 if (UNLIKELY(info.Length() < 2)) { | 1519 if (UNLIKELY(info.Length() < 2)) { |
1512 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 1520 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
1513 return; | 1521 return; |
1514 } | 1522 } |
1515 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1523 |
1516 double unrestrictedDoubleArg; | 1524 double unrestrictedDoubleArg; |
1517 float unrestrictedFloatArg; | 1525 float unrestrictedFloatArg; |
1518 { | 1526 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState)
; |
1519 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionSt
ate); | 1527 if (exceptionState.hadException()) |
1520 if (exceptionState.hadException()) | 1528 return; |
1521 return; | 1529 |
1522 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionStat
e); | 1530 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); |
1523 if (exceptionState.hadException()) | 1531 if (exceptionState.hadException()) |
1524 return; | 1532 return; |
1525 } | 1533 |
1526 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble
Arg, unrestrictedFloatArg); | 1534 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble
Arg, unrestrictedFloatArg); |
1527 } | 1535 } |
1528 | 1536 |
1529 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co
nst v8::FunctionCallbackInfo<v8::Value>& info) | 1537 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co
nst v8::FunctionCallbackInfo<v8::Value>& info) |
1530 { | 1538 { |
1531 TestInterfaceImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrest
rictedFloatArgMethod(info); | 1539 TestInterfaceImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrest
rictedFloatArgMethod(info); |
1532 } | 1540 } |
1533 | 1541 |
1534 static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 1542 static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
1535 { | 1543 { |
1536 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodT
estEnumArg", "TestInterface", info.Holder(), info.GetIsolate()); | 1544 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "voidMethodTestEnumArg"); |
| 1545 |
| 1546 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1547 |
1537 if (UNLIKELY(info.Length() < 1)) { | 1548 if (UNLIKELY(info.Length() < 1)) { |
1538 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 1549 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
1539 return; | 1550 return; |
1540 } | 1551 } |
1541 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1552 |
1542 V8StringResource<> testEnumArg; | 1553 V8StringResource<> testEnumArg; |
1543 { | 1554 testEnumArg = info[0]; |
1544 testEnumArg = info[0]; | 1555 if (!testEnumArg.prepare()) |
1545 if (!testEnumArg.prepare()) | 1556 return; |
1546 return; | 1557 const char* validValues[] = { |
1547 const char* validValues[] = { | 1558 "", |
1548 "", | 1559 "EnumValue1", |
1549 "EnumValue1", | 1560 "EnumValue2", |
1550 "EnumValue2", | 1561 "EnumValue3", |
1551 "EnumValue3", | 1562 }; |
1552 }; | 1563 if (!isValidEnum(testEnumArg, validValues, WTF_ARRAY_LENGTH(validValues), "T
estEnum", exceptionState)) { |
1553 if (!isValidEnum(testEnumArg, validValues, WTF_ARRAY_LENGTH(validValues)
, "TestEnum", exceptionState)) { | 1564 return; |
1554 return; | |
1555 } | |
1556 } | 1565 } |
| 1566 |
1557 impl->voidMethodTestEnumArg(testEnumArg); | 1567 impl->voidMethodTestEnumArg(testEnumArg); |
1558 } | 1568 } |
1559 | 1569 |
1560 static void voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 1570 static void voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
1561 { | 1571 { |
1562 TestInterfaceImplementationV8Internal::voidMethodTestEnumArgMethod(info); | 1572 TestInterfaceImplementationV8Internal::voidMethodTestEnumArgMethod(info); |
1563 } | 1573 } |
1564 | 1574 |
1565 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 1575 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
1566 { | 1576 { |
1567 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1577 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1578 |
1568 impl->voidMethod(); | 1579 impl->voidMethod(); |
1569 } | 1580 } |
1570 | 1581 |
1571 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 1582 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
1572 { | 1583 { |
1573 TestInterfaceImplementationV8Internal::voidMethodMethod(info); | 1584 TestInterfaceImplementationV8Internal::voidMethodMethod(info); |
1574 } | 1585 } |
1575 | 1586 |
1576 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 1587 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
1577 { | 1588 { |
1578 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1589 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1590 |
1579 impl->voidMethod(); | 1591 impl->voidMethod(); |
1580 } | 1592 } |
1581 | 1593 |
1582 static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<
v8::Value>& info) | 1594 static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<
v8::Value>& info) |
1583 { | 1595 { |
1584 TestInterfaceImplementationV8Internal::voidMethodMethodForMainWorld(info); | 1596 TestInterfaceImplementationV8Internal::voidMethodMethodForMainWorld(info); |
1585 } | 1597 } |
1586 | 1598 |
1587 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 1599 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
1588 { | 1600 { |
1589 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1601 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1602 |
1590 impl->alwaysExposedMethod(); | 1603 impl->alwaysExposedMethod(); |
1591 } | 1604 } |
1592 | 1605 |
1593 static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 1606 static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
1594 { | 1607 { |
1595 TestInterfaceImplementationV8Internal::alwaysExposedMethodMethod(info); | 1608 TestInterfaceImplementationV8Internal::alwaysExposedMethodMethod(info); |
1596 } | 1609 } |
1597 | 1610 |
1598 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 1611 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
1599 { | 1612 { |
1600 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1613 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1614 |
1601 impl->workerExposedMethod(); | 1615 impl->workerExposedMethod(); |
1602 } | 1616 } |
1603 | 1617 |
1604 static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 1618 static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
1605 { | 1619 { |
1606 TestInterfaceImplementationV8Internal::workerExposedMethodMethod(info); | 1620 TestInterfaceImplementationV8Internal::workerExposedMethodMethod(info); |
1607 } | 1621 } |
1608 | 1622 |
1609 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 1623 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
1610 { | 1624 { |
1611 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1625 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1626 |
1612 impl->windowExposedMethod(); | 1627 impl->windowExposedMethod(); |
1613 } | 1628 } |
1614 | 1629 |
1615 static void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 1630 static void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
1616 { | 1631 { |
1617 TestInterfaceImplementationV8Internal::windowExposedMethodMethod(info); | 1632 TestInterfaceImplementationV8Internal::windowExposedMethodMethod(info); |
1618 } | 1633 } |
1619 | 1634 |
1620 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 1635 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
1621 { | 1636 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 } | 1668 } |
1654 | 1669 |
1655 static void staticReturnDOMWrapperMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 1670 static void staticReturnDOMWrapperMethodMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
1656 { | 1671 { |
1657 TestInterfaceImplementationV8Internal::staticReturnDOMWrapperMethodMethod(in
fo); | 1672 TestInterfaceImplementationV8Internal::staticReturnDOMWrapperMethodMethod(in
fo); |
1658 } | 1673 } |
1659 | 1674 |
1660 static void methodWithExposedAndRuntimeEnabledFlagMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 1675 static void methodWithExposedAndRuntimeEnabledFlagMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
1661 { | 1676 { |
1662 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1677 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1678 |
1663 impl->methodWithExposedAndRuntimeEnabledFlag(); | 1679 impl->methodWithExposedAndRuntimeEnabledFlag(); |
1664 } | 1680 } |
1665 | 1681 |
1666 static void methodWithExposedAndRuntimeEnabledFlagMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 1682 static void methodWithExposedAndRuntimeEnabledFlagMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
1667 { | 1683 { |
1668 TestInterfaceImplementationV8Internal::methodWithExposedAndRuntimeEnabledFla
gMethod(info); | 1684 TestInterfaceImplementationV8Internal::methodWithExposedAndRuntimeEnabledFla
gMethod(info); |
1669 } | 1685 } |
1670 | 1686 |
1671 static void overloadMethodWithExposedAndRuntimeEnabledFlag1Method(const v8::Func
tionCallbackInfo<v8::Value>& info) | 1687 static void overloadMethodWithExposedAndRuntimeEnabledFlag1Method(const v8::Func
tionCallbackInfo<v8::Value>& info) |
1672 { | 1688 { |
1673 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadMet
hodWithExposedAndRuntimeEnabledFlag", "TestInterface", info.Holder(), info.GetIs
olate()); | 1689 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "overloadMethodWithExposedAndRuntimeEnabledFlag"); |
| 1690 |
1674 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1691 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1692 |
1675 int longArg; | 1693 int longArg; |
1676 { | 1694 longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionSta
te); |
1677 longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptio
nState); | 1695 if (exceptionState.hadException()) |
1678 if (exceptionState.hadException()) | 1696 return; |
1679 return; | 1697 |
1680 } | |
1681 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(longArg); | 1698 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(longArg); |
1682 } | 1699 } |
1683 | 1700 |
1684 static void overloadMethodWithExposedAndRuntimeEnabledFlag2Method(const v8::Func
tionCallbackInfo<v8::Value>& info) | 1701 static void overloadMethodWithExposedAndRuntimeEnabledFlag2Method(const v8::Func
tionCallbackInfo<v8::Value>& info) |
1685 { | 1702 { |
1686 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1703 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1704 |
1687 V8StringResource<> string; | 1705 V8StringResource<> string; |
1688 { | 1706 string = info[0]; |
1689 string = info[0]; | 1707 if (!string.prepare()) |
1690 if (!string.prepare()) | 1708 return; |
1691 return; | 1709 |
1692 } | |
1693 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(string); | 1710 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(string); |
1694 } | 1711 } |
1695 | 1712 |
1696 static void overloadMethodWithExposedAndRuntimeEnabledFlag3Method(const v8::Func
tionCallbackInfo<v8::Value>& info) | 1713 static void overloadMethodWithExposedAndRuntimeEnabledFlag3Method(const v8::Func
tionCallbackInfo<v8::Value>& info) |
1697 { | 1714 { |
1698 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1715 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1716 |
1699 DOMWindow* window; | 1717 DOMWindow* window; |
1700 { | 1718 window = toDOMWindow(info.GetIsolate(), info[0]); |
1701 window = toDOMWindow(info.GetIsolate(), info[0]); | 1719 if (!window) { |
1702 if (!window) { | 1720 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("overloadMethodWithExposedAndRuntimeEnabledFlag", "TestInterface"
, "parameter 1 is not of type 'Window'.")); |
1703 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("overloadMethodWithExposedAndRuntimeEnabledFlag", "TestInterf
ace", "parameter 1 is not of type 'Window'.")); | 1721 |
1704 return; | 1722 return; |
1705 } | |
1706 } | 1723 } |
| 1724 |
1707 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(window); | 1725 impl->overloadMethodWithExposedAndRuntimeEnabledFlag(window); |
1708 } | 1726 } |
1709 | 1727 |
1710 static void overloadMethodWithExposedAndRuntimeEnabledFlagMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 1728 static void overloadMethodWithExposedAndRuntimeEnabledFlagMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
1711 { | 1729 { |
1712 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadMet
hodWithExposedAndRuntimeEnabledFlag", "TestInterface", info.Holder(), info.GetIs
olate()); | 1730 bool isArityError = false; |
1713 switch (std::min(1, info.Length())) { | 1731 switch (std::min(1, info.Length())) { |
1714 case 1: | 1732 case 1: |
1715 if (RuntimeEnabledFeatures::featureName2Enabled()) { | 1733 if (RuntimeEnabledFeatures::featureName2Enabled()) { |
1716 if (V8Window::hasInstance(info[0], info.GetIsolate())) { | 1734 if (V8Window::hasInstance(info[0], info.GetIsolate())) { |
1717 overloadMethodWithExposedAndRuntimeEnabledFlag3Method(info); | 1735 overloadMethodWithExposedAndRuntimeEnabledFlag3Method(info); |
1718 return; | 1736 return; |
1719 } | 1737 } |
1720 } | 1738 } |
1721 if (info[0]->IsNumber()) { | 1739 if (info[0]->IsNumber()) { |
1722 overloadMethodWithExposedAndRuntimeEnabledFlag1Method(info); | 1740 overloadMethodWithExposedAndRuntimeEnabledFlag1Method(info); |
1723 return; | 1741 return; |
1724 } | 1742 } |
1725 if (RuntimeEnabledFeatures::featureNameEnabled()) { | 1743 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
1726 if (true) { | 1744 if (true) { |
1727 overloadMethodWithExposedAndRuntimeEnabledFlag2Method(info); | 1745 overloadMethodWithExposedAndRuntimeEnabledFlag2Method(info); |
1728 return; | 1746 return; |
1729 } | 1747 } |
1730 } | 1748 } |
1731 if (true) { | 1749 if (true) { |
1732 overloadMethodWithExposedAndRuntimeEnabledFlag1Method(info); | 1750 overloadMethodWithExposedAndRuntimeEnabledFlag1Method(info); |
1733 return; | 1751 return; |
1734 } | 1752 } |
1735 break; | 1753 break; |
1736 default: | 1754 default: |
1737 break; | 1755 isArityError = true; |
1738 } | 1756 } |
1739 if (info.Length() < 1) { | 1757 |
1740 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 1758 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "overloadMethodWithExposedAndRuntimeEnabledFlag"); |
1741 return; | 1759 |
| 1760 if (isArityError) { |
| 1761 if (info.Length() < 1) { |
| 1762 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(
1, info.Length())); |
| 1763 return; |
| 1764 } |
1742 } | 1765 } |
1743 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 1766 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
1744 return; | |
1745 } | 1767 } |
1746 | 1768 |
1747 static void overloadMethodWithExposedAndRuntimeEnabledFlagMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 1769 static void overloadMethodWithExposedAndRuntimeEnabledFlagMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
1748 { | 1770 { |
1749 TestInterfaceImplementationV8Internal::overloadMethodWithExposedAndRuntimeEn
abledFlagMethod(info); | 1771 TestInterfaceImplementationV8Internal::overloadMethodWithExposedAndRuntimeEn
abledFlagMethod(info); |
1750 } | 1772 } |
1751 | 1773 |
1752 static void methodWithExposedHavingRuntimeEnabldFlagMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 1774 static void methodWithExposedHavingRuntimeEnabldFlagMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
1753 { | 1775 { |
1754 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1776 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1777 |
1755 impl->methodWithExposedHavingRuntimeEnabldFlag(); | 1778 impl->methodWithExposedHavingRuntimeEnabldFlag(); |
1756 } | 1779 } |
1757 | 1780 |
1758 static void methodWithExposedHavingRuntimeEnabldFlagMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 1781 static void methodWithExposedHavingRuntimeEnabldFlagMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
1759 { | 1782 { |
1760 TestInterfaceImplementationV8Internal::methodWithExposedHavingRuntimeEnabldF
lagMethod(info); | 1783 TestInterfaceImplementationV8Internal::methodWithExposedHavingRuntimeEnabldF
lagMethod(info); |
1761 } | 1784 } |
1762 | 1785 |
1763 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 1786 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
1764 { | 1787 { |
1765 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1788 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1789 |
1766 impl->windowAndServiceWorkerExposedMethod(); | 1790 impl->windowAndServiceWorkerExposedMethod(); |
1767 } | 1791 } |
1768 | 1792 |
1769 static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 1793 static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
1770 { | 1794 { |
1771 TestInterfaceImplementationV8Internal::windowAndServiceWorkerExposedMethodMe
thod(info); | 1795 TestInterfaceImplementationV8Internal::windowAndServiceWorkerExposedMethodMe
thod(info); |
1772 } | 1796 } |
1773 | 1797 |
1774 static void voidMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::
Value>& info) | 1798 static void voidMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
1775 { | 1799 { |
1776 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1800 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1801 |
1777 impl->voidMethodPartialOverload(); | 1802 impl->voidMethodPartialOverload(); |
1778 } | 1803 } |
1779 | 1804 |
1780 static void voidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8::
Value>& info) | 1805 static void voidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
1781 { | 1806 { |
1782 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodP
artialOverload", "TestInterface", info.Holder(), info.GetIsolate()); | 1807 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "voidMethodPartialOverload"); |
| 1808 |
1783 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1809 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1810 |
1784 double doubleArg; | 1811 double doubleArg; |
1785 { | 1812 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
1786 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionStat
e); | 1813 if (exceptionState.hadException()) |
1787 if (exceptionState.hadException()) | 1814 return; |
1788 return; | 1815 |
1789 } | |
1790 impl->voidMethodPartialOverload(doubleArg); | 1816 impl->voidMethodPartialOverload(doubleArg); |
1791 } | 1817 } |
1792 | 1818 |
1793 static void staticVoidMethodPartialOverload1Method(const v8::FunctionCallbackInf
o<v8::Value>& info) | 1819 static void staticVoidMethodPartialOverload1Method(const v8::FunctionCallbackInf
o<v8::Value>& info) |
1794 { | 1820 { |
1795 TestInterfaceImplementation::staticVoidMethodPartialOverload(); | 1821 TestInterfaceImplementation::staticVoidMethodPartialOverload(); |
1796 } | 1822 } |
1797 | 1823 |
1798 static void promiseMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v
8::Value>& info) | 1824 static void promiseMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v
8::Value>& info) |
1799 { | 1825 { |
1800 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1826 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1827 |
1801 v8SetReturnValue(info, impl->promiseMethodPartialOverload().v8Value()); | 1828 v8SetReturnValue(info, impl->promiseMethodPartialOverload().v8Value()); |
1802 } | 1829 } |
1803 | 1830 |
1804 static void promiseMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v
8::Value>& info) | 1831 static void promiseMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v
8::Value>& info) |
1805 { | 1832 { |
| 1833 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "promiseMethodPartialOverload"); |
| 1834 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 1835 ExceptionToRejectPromiseScope rejectPromiseScope(info, scriptState, exceptio
nState); |
| 1836 |
1806 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1837 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1838 |
1807 DOMWindow* window; | 1839 DOMWindow* window; |
1808 { | 1840 window = toDOMWindow(info.GetIsolate(), info[0]); |
1809 window = toDOMWindow(info.GetIsolate(), info[0]); | 1841 if (!window) { |
1810 if (!window) { | 1842 exceptionState.throwTypeError("parameter 1 is not of type 'Window'."); |
1811 v8SetReturnValue(info, ScriptPromise::rejectRaw(ScriptState::current
(info.GetIsolate()), V8ThrowException::createTypeError(info.GetIsolate(), Except
ionMessages::failedToExecute("promiseMethodPartialOverload", "TestInterface", "p
arameter 1 is not of type 'Window'.")))); | 1843 |
1812 return; | 1844 return; |
1813 } | |
1814 } | 1845 } |
| 1846 |
1815 v8SetReturnValue(info, impl->promiseMethodPartialOverload(window).v8Value())
; | 1847 v8SetReturnValue(info, impl->promiseMethodPartialOverload(window).v8Value())
; |
1816 } | 1848 } |
1817 | 1849 |
1818 static void staticPromiseMethodPartialOverload1Method(const v8::FunctionCallback
Info<v8::Value>& info) | 1850 static void staticPromiseMethodPartialOverload1Method(const v8::FunctionCallback
Info<v8::Value>& info) |
1819 { | 1851 { |
1820 v8SetReturnValue(info, TestInterfaceImplementation::staticPromiseMethodParti
alOverload().v8Value()); | 1852 v8SetReturnValue(info, TestInterfaceImplementation::staticPromiseMethodParti
alOverload().v8Value()); |
1821 } | 1853 } |
1822 | 1854 |
1823 static void legacyInterfaceTypeCheckingMethodMethod(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 1855 static void legacyInterfaceTypeCheckingMethodMethod(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
1824 { | 1856 { |
| 1857 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1858 |
1825 if (UNLIKELY(info.Length() < 1)) { | 1859 if (UNLIKELY(info.Length() < 1)) { |
1826 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr
eateTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("legacyInter
faceTypeCheckingMethod", "TestInterface", ExceptionMessages::notEnoughArguments(
1, info.Length())))); | 1860 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("legacyInterfaceTypeCheckingMethod", "TestInterface", ExceptionMe
ssages::notEnoughArguments(1, info.Length()))); |
1827 return; | 1861 return; |
1828 } | 1862 } |
1829 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1863 |
1830 TestInterfaceEmpty* testInterfaceEmptyArg; | 1864 TestInterfaceEmpty* testInterfaceEmptyArg; |
1831 { | 1865 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs
olate(), info[0]); |
1832 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[0]); | 1866 |
1833 } | |
1834 impl->legacyInterfaceTypeCheckingMethod(testInterfaceEmptyArg); | 1867 impl->legacyInterfaceTypeCheckingMethod(testInterfaceEmptyArg); |
1835 } | 1868 } |
1836 | 1869 |
1837 static void legacyInterfaceTypeCheckingMethodMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 1870 static void legacyInterfaceTypeCheckingMethodMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
1838 { | 1871 { |
1839 TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingMethodMeth
od(info); | 1872 TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingMethodMeth
od(info); |
1840 } | 1873 } |
1841 | 1874 |
1842 static void secureContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 1875 static void secureContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
1843 { | 1876 { |
1844 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1877 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1878 |
1845 impl->secureContextMethod(); | 1879 impl->secureContextMethod(); |
1846 } | 1880 } |
1847 | 1881 |
1848 static void secureContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 1882 static void secureContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
1849 { | 1883 { |
1850 TestInterfaceImplementationV8Internal::secureContextMethodMethod(info); | 1884 TestInterfaceImplementationV8Internal::secureContextMethodMethod(info); |
1851 } | 1885 } |
1852 | 1886 |
1853 static void secureContextRuntimeEnabledMethodMethod(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 1887 static void secureContextRuntimeEnabledMethodMethod(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
1854 { | 1888 { |
1855 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1889 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1890 |
1856 impl->secureContextRuntimeEnabledMethod(); | 1891 impl->secureContextRuntimeEnabledMethod(); |
1857 } | 1892 } |
1858 | 1893 |
1859 static void secureContextRuntimeEnabledMethodMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 1894 static void secureContextRuntimeEnabledMethodMethodCallback(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
1860 { | 1895 { |
1861 TestInterfaceImplementationV8Internal::secureContextRuntimeEnabledMethodMeth
od(info); | 1896 TestInterfaceImplementationV8Internal::secureContextRuntimeEnabledMethodMeth
od(info); |
1862 } | 1897 } |
1863 | 1898 |
1864 static void secureContextWindowExposedMethodMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) | 1899 static void secureContextWindowExposedMethodMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) |
1865 { | 1900 { |
1866 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1901 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1902 |
1867 impl->secureContextWindowExposedMethod(); | 1903 impl->secureContextWindowExposedMethod(); |
1868 } | 1904 } |
1869 | 1905 |
1870 static void secureContextWindowExposedMethodMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 1906 static void secureContextWindowExposedMethodMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
1871 { | 1907 { |
1872 TestInterfaceImplementationV8Internal::secureContextWindowExposedMethodMetho
d(info); | 1908 TestInterfaceImplementationV8Internal::secureContextWindowExposedMethodMetho
d(info); |
1873 } | 1909 } |
1874 | 1910 |
1875 static void secureContextWorkerExposedMethodMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) | 1911 static void secureContextWorkerExposedMethodMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) |
1876 { | 1912 { |
1877 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1913 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1914 |
1878 impl->secureContextWorkerExposedMethod(); | 1915 impl->secureContextWorkerExposedMethod(); |
1879 } | 1916 } |
1880 | 1917 |
1881 static void secureContextWorkerExposedMethodMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 1918 static void secureContextWorkerExposedMethodMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
1882 { | 1919 { |
1883 TestInterfaceImplementationV8Internal::secureContextWorkerExposedMethodMetho
d(info); | 1920 TestInterfaceImplementationV8Internal::secureContextWorkerExposedMethodMetho
d(info); |
1884 } | 1921 } |
1885 | 1922 |
1886 static void secureContextWindowExposedRuntimeEnabledMethodMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 1923 static void secureContextWindowExposedRuntimeEnabledMethodMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
1887 { | 1924 { |
1888 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1925 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1926 |
1889 impl->secureContextWindowExposedRuntimeEnabledMethod(); | 1927 impl->secureContextWindowExposedRuntimeEnabledMethod(); |
1890 } | 1928 } |
1891 | 1929 |
1892 static void secureContextWindowExposedRuntimeEnabledMethodMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 1930 static void secureContextWindowExposedRuntimeEnabledMethodMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
1893 { | 1931 { |
1894 TestInterfaceImplementationV8Internal::secureContextWindowExposedRuntimeEnab
ledMethodMethod(info); | 1932 TestInterfaceImplementationV8Internal::secureContextWindowExposedRuntimeEnab
ledMethodMethod(info); |
1895 } | 1933 } |
1896 | 1934 |
1897 static void secureContextWorkerExposedRuntimeEnabledMethodMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 1935 static void secureContextWorkerExposedRuntimeEnabledMethodMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
1898 { | 1936 { |
1899 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1937 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1938 |
1900 impl->secureContextWorkerExposedRuntimeEnabledMethod(); | 1939 impl->secureContextWorkerExposedRuntimeEnabledMethod(); |
1901 } | 1940 } |
1902 | 1941 |
1903 static void secureContextWorkerExposedRuntimeEnabledMethodMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 1942 static void secureContextWorkerExposedRuntimeEnabledMethodMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
1904 { | 1943 { |
1905 TestInterfaceImplementationV8Internal::secureContextWorkerExposedRuntimeEnab
ledMethodMethod(info); | 1944 TestInterfaceImplementationV8Internal::secureContextWorkerExposedRuntimeEnab
ledMethodMethod(info); |
1906 } | 1945 } |
1907 | 1946 |
1908 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 1947 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
1909 { | 1948 { |
1910 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1949 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1950 |
1911 impl->implementsVoidMethod(); | 1951 impl->implementsVoidMethod(); |
1912 } | 1952 } |
1913 | 1953 |
1914 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 1954 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
1915 { | 1955 { |
1916 TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info); | 1956 TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info); |
1917 } | 1957 } |
1918 | 1958 |
1919 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 1959 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
1920 { | 1960 { |
1921 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC
omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); | 1961 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "implementsComplexMethod"); |
| 1962 |
| 1963 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1964 |
1922 if (UNLIKELY(info.Length() < 2)) { | 1965 if (UNLIKELY(info.Length() < 2)) { |
1923 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 1966 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
1924 return; | 1967 return; |
1925 } | 1968 } |
1926 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1969 |
1927 V8StringResource<> strArg; | 1970 V8StringResource<> strArg; |
1928 TestInterfaceEmpty* testInterfaceEmptyArg; | 1971 TestInterfaceEmpty* testInterfaceEmptyArg; |
1929 { | 1972 strArg = info[0]; |
1930 strArg = info[0]; | 1973 if (!strArg.prepare()) |
1931 if (!strArg.prepare()) | 1974 return; |
1932 return; | 1975 |
1933 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[1]); | 1976 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs
olate(), info[1]); |
1934 if (!testInterfaceEmptyArg) { | 1977 if (!testInterfaceEmptyArg) { |
1935 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); | 1978 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterface
Empty'."); |
1936 return; | 1979 |
1937 } | 1980 return; |
1938 } | 1981 } |
| 1982 |
1939 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 1983 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
1940 TestInterfaceEmpty* result = impl->implementsComplexMethod(executionContext,
strArg, testInterfaceEmptyArg, exceptionState); | 1984 TestInterfaceEmpty* result = impl->implementsComplexMethod(executionContext,
strArg, testInterfaceEmptyArg, exceptionState); |
1941 if (exceptionState.hadException()) { | 1985 if (exceptionState.hadException()) { |
1942 return; | 1986 return; |
1943 } | 1987 } |
1944 v8SetReturnValue(info, result); | 1988 v8SetReturnValue(info, result); |
1945 } | 1989 } |
1946 | 1990 |
1947 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 1991 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
1948 { | 1992 { |
(...skipping 11 matching lines...) Expand all Loading... |
1960 } | 2004 } |
1961 | 2005 |
1962 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 2006 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
1963 { | 2007 { |
1964 TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethod(info
); | 2008 TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethod(info
); |
1965 } | 2009 } |
1966 | 2010 |
1967 static void implements2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 2011 static void implements2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
1968 { | 2012 { |
1969 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2013 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2014 |
1970 TestImplements2::implements2VoidMethod(*impl); | 2015 TestImplements2::implements2VoidMethod(*impl); |
1971 } | 2016 } |
1972 | 2017 |
1973 static void implements2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 2018 static void implements2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
1974 { | 2019 { |
1975 TestInterfaceImplementationV8Internal::implements2VoidMethodMethod(info); | 2020 TestInterfaceImplementationV8Internal::implements2VoidMethodMethod(info); |
1976 } | 2021 } |
1977 | 2022 |
1978 static void implements3VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 2023 static void implements3VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
1979 { | 2024 { |
1980 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2025 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2026 |
1981 TestImplements3Implementation::implements3VoidMethod(*impl); | 2027 TestImplements3Implementation::implements3VoidMethod(*impl); |
1982 } | 2028 } |
1983 | 2029 |
1984 static void implements3VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 2030 static void implements3VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
1985 { | 2031 { |
1986 TestInterfaceImplementationV8Internal::implements3VoidMethodMethod(info); | 2032 TestInterfaceImplementationV8Internal::implements3VoidMethodMethod(info); |
1987 } | 2033 } |
1988 | 2034 |
1989 static void implements3StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 2035 static void implements3StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
1990 { | 2036 { |
1991 TestImplements3Implementation::implements3StaticVoidMethod(); | 2037 TestImplements3Implementation::implements3StaticVoidMethod(); |
1992 } | 2038 } |
1993 | 2039 |
1994 static void implements3StaticVoidMethodMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 2040 static void implements3StaticVoidMethodMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
1995 { | 2041 { |
1996 TestInterfaceImplementationV8Internal::implements3StaticVoidMethodMethod(inf
o); | 2042 TestInterfaceImplementationV8Internal::implements3StaticVoidMethodMethod(inf
o); |
1997 } | 2043 } |
1998 | 2044 |
1999 static void partialVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 2045 static void partialVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
2000 { | 2046 { |
2001 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2047 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2048 |
2002 TestInterfacePartial::partialVoidMethod(*impl); | 2049 TestInterfacePartial::partialVoidMethod(*impl); |
2003 } | 2050 } |
2004 | 2051 |
2005 static void partialVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 2052 static void partialVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
2006 { | 2053 { |
2007 TestInterfaceImplementationV8Internal::partialVoidMethodMethod(info); | 2054 TestInterfaceImplementationV8Internal::partialVoidMethodMethod(info); |
2008 } | 2055 } |
2009 | 2056 |
2010 static void partialStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 2057 static void partialStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
2011 { | 2058 { |
2012 TestInterfacePartial::partialStaticVoidMethod(); | 2059 TestInterfacePartial::partialStaticVoidMethod(); |
2013 } | 2060 } |
2014 | 2061 |
2015 static void partialStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 2062 static void partialStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
2016 { | 2063 { |
2017 TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info); | 2064 TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info); |
2018 } | 2065 } |
2019 | 2066 |
2020 static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 2067 static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
2021 { | 2068 { |
2022 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoid
MethodLongArg", "TestInterface", info.Holder(), info.GetIsolate()); | 2069 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "partialVoidMethodLongArg"); |
| 2070 |
| 2071 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2072 |
2023 if (UNLIKELY(info.Length() < 1)) { | 2073 if (UNLIKELY(info.Length() < 1)) { |
2024 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 2074 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
2025 return; | 2075 return; |
2026 } | 2076 } |
2027 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2077 |
2028 int longArg; | 2078 int longArg; |
2029 { | 2079 longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionSta
te); |
2030 longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptio
nState); | 2080 if (exceptionState.hadException()) |
2031 if (exceptionState.hadException()) | 2081 return; |
2032 return; | 2082 |
2033 } | |
2034 TestInterfacePartial::partialVoidMethodLongArg(*impl, longArg); | 2083 TestInterfacePartial::partialVoidMethodLongArg(*impl, longArg); |
2035 } | 2084 } |
2036 | 2085 |
2037 static void partialVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 2086 static void partialVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
2038 { | 2087 { |
2039 TestInterfaceImplementationV8Internal::partialVoidMethodLongArgMethod(info); | 2088 TestInterfaceImplementationV8Internal::partialVoidMethodLongArgMethod(info); |
2040 } | 2089 } |
2041 | 2090 |
2042 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const
v8::FunctionCallbackInfo<v8::Value>& info) | 2091 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const
v8::FunctionCallbackInfo<v8::Value>& info) |
2043 { | 2092 { |
2044 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialCall
WithExecutionContextRaisesExceptionVoidMethod", "TestInterface", info.Holder(),
info.GetIsolate()); | 2093 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "partialCallWithExecutionContextRaisesExceptionVoidMetho
d"); |
| 2094 |
2045 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2095 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2096 |
2046 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 2097 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
2047 TestInterfacePartial::partialCallWithExecutionContextRaisesExceptionVoidMeth
od(executionContext, *impl, exceptionState); | 2098 TestInterfacePartial::partialCallWithExecutionContextRaisesExceptionVoidMeth
od(executionContext, *impl, exceptionState); |
2048 if (exceptionState.hadException()) { | 2099 if (exceptionState.hadException()) { |
2049 return; | 2100 return; |
2050 } | 2101 } |
2051 } | 2102 } |
2052 | 2103 |
2053 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallba
ck(const v8::FunctionCallbackInfo<v8::Value>& info) | 2104 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallba
ck(const v8::FunctionCallbackInfo<v8::Value>& info) |
2054 { | 2105 { |
2055 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaises
ExceptionVoidMethodMethod(info); | 2106 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaises
ExceptionVoidMethodMethod(info); |
2056 } | 2107 } |
2057 | 2108 |
2058 static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCall
backInfo<v8::Value>& info) | 2109 static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCall
backInfo<v8::Value>& info) |
2059 { | 2110 { |
| 2111 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2112 |
2060 if (UNLIKELY(info.Length() < 1)) { | 2113 if (UNLIKELY(info.Length() < 1)) { |
2061 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr
eateTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("partialVoid
MethodPartialCallbackTypeArg", "TestInterface", ExceptionMessages::notEnoughArgu
ments(1, info.Length())))); | 2114 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", Excep
tionMessages::notEnoughArguments(1, info.Length()))); |
2062 return; | 2115 return; |
2063 } | 2116 } |
2064 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2117 |
2065 ScriptValue partialCallbackTypeArg; | 2118 ScriptValue partialCallbackTypeArg; |
2066 { | 2119 if (!info[0]->IsFunction()) { |
2067 if (!info[0]->IsFunction()) { | 2120 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", "The
callback provided as parameter 1 is not a function.")); |
2068 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", "
The callback provided as parameter 1 is not a function.")); | 2121 |
2069 return; | 2122 return; |
2070 } | |
2071 partialCallbackTypeArg = ScriptValue(ScriptState::current(info.GetIsolat
e()), info[0]); | |
2072 } | 2123 } |
| 2124 partialCallbackTypeArg = ScriptValue(ScriptState::current(info.GetIsolate())
, info[0]); |
| 2125 |
2073 TestInterfacePartial::partialVoidMethodPartialCallbackTypeArg(*impl, partial
CallbackTypeArg); | 2126 TestInterfacePartial::partialVoidMethodPartialCallbackTypeArg(*impl, partial
CallbackTypeArg); |
2074 } | 2127 } |
2075 | 2128 |
2076 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | 2129 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
2077 { | 2130 { |
2078 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA
rgMethod(info); | 2131 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA
rgMethod(info); |
2079 } | 2132 } |
2080 | 2133 |
2081 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v
8::FunctionCallbackInfo<v8::Value>& info) | 2134 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v
8::FunctionCallbackInfo<v8::Value>& info) |
2082 { | 2135 { |
2083 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestInterface", info.Holder(), in
fo.GetIsolate()); | 2136 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "shortMethodWithShortArgumentImplementedInPrivateScript"
); |
| 2137 |
| 2138 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2139 |
2084 if (UNLIKELY(info.Length() < 1)) { | 2140 if (UNLIKELY(info.Length() < 1)) { |
2085 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 2141 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
2086 return; | 2142 return; |
2087 } | 2143 } |
2088 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2144 |
2089 int value; | 2145 int value; |
2090 { | 2146 value = toInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState
); |
2091 value = toInt16(info.GetIsolate(), info[0], NormalConversion, exceptionS
tate); | 2147 if (exceptionState.hadException()) |
2092 if (exceptionState.hadException()) | 2148 return; |
2093 return; | 2149 |
2094 } | |
2095 int result = 0; | 2150 int result = 0; |
2096 if (!V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplemented
InPrivateScriptMethod(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCu
rrentContext())), impl, value, &result)) | 2151 if (!V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplemented
InPrivateScriptMethod(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCu
rrentContext())), impl, value, &result)) |
2097 return; | 2152 return; |
2098 v8SetReturnValueInt(info, result); | 2153 v8SetReturnValueInt(info, result); |
2099 } | 2154 } |
2100 | 2155 |
2101 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback
(const v8::FunctionCallbackInfo<v8::Value>& info) | 2156 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback
(const v8::FunctionCallbackInfo<v8::Value>& info) |
2102 { | 2157 { |
2103 TestInterfaceImplementationV8Internal::shortMethodWithShortArgumentImplement
edInPrivateScriptMethod(info); | 2158 TestInterfaceImplementationV8Internal::shortMethodWithShortArgumentImplement
edInPrivateScriptMethod(info); |
2104 } | 2159 } |
2105 | 2160 |
2106 static void partial2VoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2161 static void partial2VoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2107 { | 2162 { |
2108 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2163 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2164 |
2109 TestInterfacePartial2Implementation::partial2VoidMethod(*impl); | 2165 TestInterfacePartial2Implementation::partial2VoidMethod(*impl); |
2110 } | 2166 } |
2111 | 2167 |
2112 static void partial2StaticVoidMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 2168 static void partial2StaticVoidMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
2113 { | 2169 { |
2114 TestInterfacePartial2Implementation::partial2StaticVoidMethod(); | 2170 TestInterfacePartial2Implementation::partial2StaticVoidMethod(); |
2115 } | 2171 } |
2116 | 2172 |
2117 static void partial2SecureContextMethodMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 2173 static void partial2SecureContextMethodMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
2118 { | 2174 { |
2119 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2175 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2176 |
2120 TestInterfacePartial2Implementation::partial2SecureContextMethod(*impl); | 2177 TestInterfacePartial2Implementation::partial2SecureContextMethod(*impl); |
2121 } | 2178 } |
2122 | 2179 |
2123 static void partial2SecureContextMethodMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 2180 static void partial2SecureContextMethodMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
2124 { | 2181 { |
2125 TestInterfaceImplementationV8Internal::partial2SecureContextMethodMethod(inf
o); | 2182 TestInterfaceImplementationV8Internal::partial2SecureContextMethodMethod(inf
o); |
2126 } | 2183 } |
2127 | 2184 |
2128 static void partialSecureContextMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) | 2185 static void partialSecureContextMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) |
2129 { | 2186 { |
2130 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2187 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2188 |
2131 TestInterfacePartialSecureContext::partialSecureContextMethod(*impl); | 2189 TestInterfacePartialSecureContext::partialSecureContextMethod(*impl); |
2132 } | 2190 } |
2133 | 2191 |
2134 static void partialSecureContextMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 2192 static void partialSecureContextMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
2135 { | 2193 { |
2136 TestInterfaceImplementationV8Internal::partialSecureContextMethodMethod(info
); | 2194 TestInterfaceImplementationV8Internal::partialSecureContextMethodMethod(info
); |
2137 } | 2195 } |
2138 | 2196 |
2139 static void partialSecureContextRuntimeEnabledMethodMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 2197 static void partialSecureContextRuntimeEnabledMethodMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
2140 { | 2198 { |
2141 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2199 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2200 |
2142 TestInterfacePartialSecureContext::partialSecureContextRuntimeEnabledMethod(
*impl); | 2201 TestInterfacePartialSecureContext::partialSecureContextRuntimeEnabledMethod(
*impl); |
2143 } | 2202 } |
2144 | 2203 |
2145 static void partialSecureContextRuntimeEnabledMethodMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 2204 static void partialSecureContextRuntimeEnabledMethodMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
2146 { | 2205 { |
2147 TestInterfaceImplementationV8Internal::partialSecureContextRuntimeEnabledMet
hodMethod(info); | 2206 TestInterfaceImplementationV8Internal::partialSecureContextRuntimeEnabledMet
hodMethod(info); |
2148 } | 2207 } |
2149 | 2208 |
2150 static void partialSecureContextWindowExposedMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) | 2209 static void partialSecureContextWindowExposedMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) |
2151 { | 2210 { |
2152 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2211 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2212 |
2153 TestInterfacePartialSecureContext::partialSecureContextWindowExposedMethod(*
impl); | 2213 TestInterfacePartialSecureContext::partialSecureContextWindowExposedMethod(*
impl); |
2154 } | 2214 } |
2155 | 2215 |
2156 static void partialSecureContextWindowExposedMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | 2216 static void partialSecureContextWindowExposedMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
2157 { | 2217 { |
2158 TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedMeth
odMethod(info); | 2218 TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedMeth
odMethod(info); |
2159 } | 2219 } |
2160 | 2220 |
2161 static void partialSecureContextWorkerExposedMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) | 2221 static void partialSecureContextWorkerExposedMethodMethod(const v8::FunctionCall
backInfo<v8::Value>& info) |
2162 { | 2222 { |
2163 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2223 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2224 |
2164 TestInterfacePartialSecureContext::partialSecureContextWorkerExposedMethod(*
impl); | 2225 TestInterfacePartialSecureContext::partialSecureContextWorkerExposedMethod(*
impl); |
2165 } | 2226 } |
2166 | 2227 |
2167 static void partialSecureContextWorkerExposedMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | 2228 static void partialSecureContextWorkerExposedMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
2168 { | 2229 { |
2169 TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedMeth
odMethod(info); | 2230 TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedMeth
odMethod(info); |
2170 } | 2231 } |
2171 | 2232 |
2172 static void partialSecureContextWindowExposedRuntimeEnabledMethodMethod(const v8
::FunctionCallbackInfo<v8::Value>& info) | 2233 static void partialSecureContextWindowExposedRuntimeEnabledMethodMethod(const v8
::FunctionCallbackInfo<v8::Value>& info) |
2173 { | 2234 { |
2174 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2235 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2236 |
2175 TestInterfacePartialSecureContext::partialSecureContextWindowExposedRuntimeE
nabledMethod(*impl); | 2237 TestInterfacePartialSecureContext::partialSecureContextWindowExposedRuntimeE
nabledMethod(*impl); |
2176 } | 2238 } |
2177 | 2239 |
2178 static void partialSecureContextWindowExposedRuntimeEnabledMethodMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) | 2240 static void partialSecureContextWindowExposedRuntimeEnabledMethodMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) |
2179 { | 2241 { |
2180 TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedRunt
imeEnabledMethodMethod(info); | 2242 TestInterfaceImplementationV8Internal::partialSecureContextWindowExposedRunt
imeEnabledMethodMethod(info); |
2181 } | 2243 } |
2182 | 2244 |
2183 static void partialSecureContextWorkerExposedRuntimeEnabledMethodMethod(const v8
::FunctionCallbackInfo<v8::Value>& info) | 2245 static void partialSecureContextWorkerExposedRuntimeEnabledMethodMethod(const v8
::FunctionCallbackInfo<v8::Value>& info) |
2184 { | 2246 { |
2185 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2247 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2248 |
2186 TestInterfacePartialSecureContext::partialSecureContextWorkerExposedRuntimeE
nabledMethod(*impl); | 2249 TestInterfacePartialSecureContext::partialSecureContextWorkerExposedRuntimeE
nabledMethod(*impl); |
2187 } | 2250 } |
2188 | 2251 |
2189 static void partialSecureContextWorkerExposedRuntimeEnabledMethodMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) | 2252 static void partialSecureContextWorkerExposedRuntimeEnabledMethodMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) |
2190 { | 2253 { |
2191 TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRunt
imeEnabledMethodMethod(info); | 2254 TestInterfaceImplementationV8Internal::partialSecureContextWorkerExposedRunt
imeEnabledMethodMethod(info); |
2192 } | 2255 } |
2193 | 2256 |
2194 static void voidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 2257 static void voidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
2195 { | 2258 { |
2196 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodP
artialOverload", "TestInterface", info.Holder(), info.GetIsolate()); | |
2197 switch (std::min(1, info.Length())) { | 2259 switch (std::min(1, info.Length())) { |
2198 case 0: | 2260 case 0: |
2199 if (true) { | 2261 if (true) { |
2200 voidMethodPartialOverload1Method(info); | 2262 voidMethodPartialOverload1Method(info); |
2201 return; | 2263 return; |
2202 } | 2264 } |
2203 break; | 2265 break; |
2204 case 1: | 2266 case 1: |
2205 if (info[0]->IsNumber()) { | 2267 if (info[0]->IsNumber()) { |
2206 voidMethodPartialOverload2Method(info); | 2268 voidMethodPartialOverload2Method(info); |
2207 return; | 2269 return; |
2208 } | 2270 } |
2209 if (true) { | 2271 if (true) { |
2210 voidMethodPartialOverload2Method(info); | 2272 voidMethodPartialOverload2Method(info); |
2211 return; | 2273 return; |
2212 } | 2274 } |
2213 break; | 2275 break; |
2214 } | 2276 } |
2215 ASSERT(voidMethodPartialOverloadMethodForPartialInterface); | 2277 |
| 2278 DCHECK(voidMethodPartialOverloadMethodForPartialInterface); |
2216 (voidMethodPartialOverloadMethodForPartialInterface)(info); | 2279 (voidMethodPartialOverloadMethodForPartialInterface)(info); |
2217 } | 2280 } |
2218 | 2281 |
2219 static void voidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 2282 static void voidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
2220 { | 2283 { |
2221 TestInterfaceImplementationV8Internal::voidMethodPartialOverloadMethod(info)
; | 2284 TestInterfaceImplementationV8Internal::voidMethodPartialOverloadMethod(info)
; |
2222 } | 2285 } |
2223 | 2286 |
2224 static void staticVoidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) | 2287 static void staticVoidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) |
2225 { | 2288 { |
2226 ExceptionState exceptionState(ExceptionState::ExecutionContext, "staticVoidM
ethodPartialOverload", "TestInterface", info.Holder(), info.GetIsolate()); | |
2227 switch (std::min(1, info.Length())) { | 2289 switch (std::min(1, info.Length())) { |
2228 case 0: | 2290 case 0: |
2229 if (true) { | 2291 if (true) { |
2230 staticVoidMethodPartialOverload1Method(info); | 2292 staticVoidMethodPartialOverload1Method(info); |
2231 return; | 2293 return; |
2232 } | 2294 } |
2233 break; | 2295 break; |
2234 case 1: | 2296 case 1: |
2235 break; | 2297 break; |
2236 } | 2298 } |
2237 ASSERT(staticVoidMethodPartialOverloadMethodForPartialInterface); | 2299 |
| 2300 DCHECK(staticVoidMethodPartialOverloadMethodForPartialInterface); |
2238 (staticVoidMethodPartialOverloadMethodForPartialInterface)(info); | 2301 (staticVoidMethodPartialOverloadMethodForPartialInterface)(info); |
2239 } | 2302 } |
2240 | 2303 |
2241 static void staticVoidMethodPartialOverloadMethodCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 2304 static void staticVoidMethodPartialOverloadMethodCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
2242 { | 2305 { |
2243 TestInterfaceImplementationV8Internal::staticVoidMethodPartialOverloadMethod
(info); | 2306 TestInterfaceImplementationV8Internal::staticVoidMethodPartialOverloadMethod
(info); |
2244 } | 2307 } |
2245 | 2308 |
2246 static void promiseMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) | 2309 static void promiseMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) |
2247 { | 2310 { |
2248 ExceptionState exceptionState(ExceptionState::ExecutionContext, "promiseMeth
odPartialOverload", "TestInterface", info.Holder(), info.GetIsolate()); | |
2249 switch (std::min(1, info.Length())) { | 2311 switch (std::min(1, info.Length())) { |
2250 case 0: | 2312 case 0: |
2251 if (true) { | 2313 if (true) { |
2252 promiseMethodPartialOverload1Method(info); | 2314 promiseMethodPartialOverload1Method(info); |
2253 return; | 2315 return; |
2254 } | 2316 } |
2255 break; | 2317 break; |
2256 case 1: | 2318 case 1: |
2257 if (V8Window::hasInstance(info[0], info.GetIsolate())) { | 2319 if (V8Window::hasInstance(info[0], info.GetIsolate())) { |
2258 promiseMethodPartialOverload2Method(info); | 2320 promiseMethodPartialOverload2Method(info); |
2259 return; | 2321 return; |
2260 } | 2322 } |
2261 break; | 2323 break; |
2262 } | 2324 } |
2263 ASSERT(promiseMethodPartialOverloadMethodForPartialInterface); | 2325 |
| 2326 DCHECK(promiseMethodPartialOverloadMethodForPartialInterface); |
2264 (promiseMethodPartialOverloadMethodForPartialInterface)(info); | 2327 (promiseMethodPartialOverloadMethodForPartialInterface)(info); |
2265 } | 2328 } |
2266 | 2329 |
2267 static void promiseMethodPartialOverloadMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 2330 static void promiseMethodPartialOverloadMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
2268 { | 2331 { |
2269 TestInterfaceImplementationV8Internal::promiseMethodPartialOverloadMethod(in
fo); | 2332 TestInterfaceImplementationV8Internal::promiseMethodPartialOverloadMethod(in
fo); |
2270 } | 2333 } |
2271 | 2334 |
2272 static void staticPromiseMethodPartialOverloadMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 2335 static void staticPromiseMethodPartialOverloadMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
2273 { | 2336 { |
2274 ExceptionState exceptionState(ExceptionState::ExecutionContext, "staticPromi
seMethodPartialOverload", "TestInterface", info.Holder(), info.GetIsolate()); | |
2275 switch (std::min(1, info.Length())) { | 2337 switch (std::min(1, info.Length())) { |
2276 case 0: | 2338 case 0: |
2277 if (true) { | 2339 if (true) { |
2278 staticPromiseMethodPartialOverload1Method(info); | 2340 staticPromiseMethodPartialOverload1Method(info); |
2279 return; | 2341 return; |
2280 } | 2342 } |
2281 break; | 2343 break; |
2282 case 1: | 2344 case 1: |
2283 break; | 2345 break; |
2284 } | 2346 } |
2285 ASSERT(staticPromiseMethodPartialOverloadMethodForPartialInterface); | 2347 |
| 2348 DCHECK(staticPromiseMethodPartialOverloadMethodForPartialInterface); |
2286 (staticPromiseMethodPartialOverloadMethodForPartialInterface)(info); | 2349 (staticPromiseMethodPartialOverloadMethodForPartialInterface)(info); |
2287 } | 2350 } |
2288 | 2351 |
2289 static void staticPromiseMethodPartialOverloadMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 2352 static void staticPromiseMethodPartialOverloadMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
2290 { | 2353 { |
2291 TestInterfaceImplementationV8Internal::staticPromiseMethodPartialOverloadMet
hod(info); | 2354 TestInterfaceImplementationV8Internal::staticPromiseMethodPartialOverloadMet
hod(info); |
2292 } | 2355 } |
2293 | 2356 |
2294 static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2357 static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2295 { | 2358 { |
2296 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partial2Voi
dMethod", "TestInterface", info.Holder(), info.GetIsolate()); | |
2297 switch (std::min(1, info.Length())) { | 2359 switch (std::min(1, info.Length())) { |
2298 case 0: | 2360 case 0: |
2299 if (true) { | 2361 if (true) { |
2300 partial2VoidMethod1Method(info); | 2362 partial2VoidMethod1Method(info); |
2301 return; | 2363 return; |
2302 } | 2364 } |
2303 break; | 2365 break; |
2304 case 1: | 2366 case 1: |
2305 break; | 2367 break; |
2306 } | 2368 } |
2307 ASSERT(partial2VoidMethodMethodForPartialInterface); | 2369 |
| 2370 DCHECK(partial2VoidMethodMethodForPartialInterface); |
2308 (partial2VoidMethodMethodForPartialInterface)(info); | 2371 (partial2VoidMethodMethodForPartialInterface)(info); |
2309 } | 2372 } |
2310 | 2373 |
2311 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 2374 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
2312 { | 2375 { |
2313 TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info); | 2376 TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info); |
2314 } | 2377 } |
2315 | 2378 |
2316 static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 2379 static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
2317 { | 2380 { |
2318 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partial2Sta
ticVoidMethod", "TestInterface", info.Holder(), info.GetIsolate()); | |
2319 switch (std::min(1, info.Length())) { | 2381 switch (std::min(1, info.Length())) { |
2320 case 0: | 2382 case 0: |
2321 if (true) { | 2383 if (true) { |
2322 partial2StaticVoidMethod1Method(info); | 2384 partial2StaticVoidMethod1Method(info); |
2323 return; | 2385 return; |
2324 } | 2386 } |
2325 break; | 2387 break; |
2326 case 1: | 2388 case 1: |
2327 break; | 2389 break; |
2328 } | 2390 } |
2329 ASSERT(partial2StaticVoidMethodMethodForPartialInterface); | 2391 |
| 2392 DCHECK(partial2StaticVoidMethodMethodForPartialInterface); |
2330 (partial2StaticVoidMethodMethodForPartialInterface)(info); | 2393 (partial2StaticVoidMethodMethodForPartialInterface)(info); |
2331 } | 2394 } |
2332 | 2395 |
2333 static void partial2StaticVoidMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 2396 static void partial2StaticVoidMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
2334 { | 2397 { |
2335 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethod(info); | 2398 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethod(info); |
2336 } | 2399 } |
2337 | 2400 |
2338 static void toJSONMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 2401 static void toJSONMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
2339 { | 2402 { |
2340 ExceptionState exceptionState(ExceptionState::ExecutionContext, "toJSON", "T
estInterface", info.Holder(), info.GetIsolate()); | 2403 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "toJSON"); |
| 2404 |
2341 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2405 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2406 |
2342 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 2407 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 2408 |
2343 ScriptValue result = impl->toJSONForBinding(scriptState, exceptionState); | 2409 ScriptValue result = impl->toJSONForBinding(scriptState, exceptionState); |
2344 if (exceptionState.hadException()) { | 2410 if (exceptionState.hadException()) { |
2345 return; | 2411 return; |
2346 } | 2412 } |
2347 v8SetReturnValue(info, result.v8Value()); | 2413 v8SetReturnValue(info, result.v8Value()); |
2348 } | 2414 } |
2349 | 2415 |
2350 static void toJSONMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 2416 static void toJSONMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
2351 { | 2417 { |
2352 TestInterfaceImplementationV8Internal::toJSONMethod(info); | 2418 TestInterfaceImplementationV8Internal::toJSONMethod(info); |
2353 } | 2419 } |
2354 | 2420 |
2355 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 2421 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
2356 { | 2422 { |
2357 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2423 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2424 |
2358 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); | 2425 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); |
2359 } | 2426 } |
2360 | 2427 |
2361 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 2428 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
2362 { | 2429 { |
2363 TestInterfaceImplementationV8Internal::toStringMethod(info); | 2430 TestInterfaceImplementationV8Internal::toStringMethod(info); |
2364 } | 2431 } |
2365 | 2432 |
2366 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 2433 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
2367 { | 2434 { |
2368 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface", info.Holder(), info.GetIsolate()); | 2435 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface", "iterator"); |
| 2436 |
2369 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 2437 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 2438 |
2370 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 2439 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 2440 |
2371 Iterator* result = impl->iterator(scriptState, exceptionState); | 2441 Iterator* result = impl->iterator(scriptState, exceptionState); |
2372 if (exceptionState.hadException()) { | 2442 if (exceptionState.hadException()) { |
2373 return; | 2443 return; |
2374 } | 2444 } |
2375 v8SetReturnValue(info, result); | 2445 v8SetReturnValue(info, result); |
2376 } | 2446 } |
2377 | 2447 |
2378 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 2448 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
2379 { | 2449 { |
2380 TestInterfaceImplementationV8Internal::iteratorMethod(info); | 2450 TestInterfaceImplementationV8Internal::iteratorMethod(info); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2967 if (!scriptState) | 3037 if (!scriptState) |
2968 return false; | 3038 return false; |
2969 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 3039 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
2970 if (!scriptStateInUserScript) | 3040 if (!scriptStateInUserScript) |
2971 return false; | 3041 return false; |
2972 | 3042 |
2973 ScriptState::Scope scope(scriptState); | 3043 ScriptState::Scope scope(scriptState); |
2974 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 3044 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
2975 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); | 3045 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); |
2976 v8::Local<v8::Value> argv[] = { valueHandle }; | 3046 v8::Local<v8::Value> argv[] = { valueHandle }; |
2977 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr
iptState->context()->Global(), scriptState->isolate()); | 3047 ExceptionState exceptionState(scriptState->isolate(), ExceptionState::Execut
ionContext, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplemen
tedInPrivateScript"); |
2978 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA
rgumentImplementedInPrivateScript", holder, 1, argv); | 3048 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortA
rgumentImplementedInPrivateScript", holder, 1, argv); |
2979 if (v8Value.IsEmpty()) | 3049 if (v8Value.IsEmpty()) |
2980 return false; | 3050 return false; |
2981 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | 3051 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); |
2982 if (exceptionState.hadException()) | 3052 if (exceptionState.hadException()) |
2983 return false; | 3053 return false; |
2984 *result = cppValue; | 3054 *result = cppValue; |
2985 RELEASE_ASSERT(!exceptionState.hadException()); | 3055 CHECK(!exceptionState.hadException()); |
2986 return true; | 3056 return true; |
2987 } | 3057 } |
2988 | 3058 |
2989 bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(LocalFrame*
frame, TestInterfaceImplementation* holderImpl, String* result) | 3059 bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(LocalFrame*
frame, TestInterfaceImplementation* holderImpl, String* result) |
2990 { | 3060 { |
2991 if (!frame) | 3061 if (!frame) |
2992 return false; | 3062 return false; |
2993 v8::HandleScope handleScope(toIsolate(frame)); | 3063 v8::HandleScope handleScope(toIsolate(frame)); |
2994 ScriptForbiddenScope::AllowUserAgentScript script; | 3064 ScriptForbiddenScope::AllowUserAgentScript script; |
2995 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::pri
vateScriptIsolatedWorld()); | 3065 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::pri
vateScriptIsolatedWorld()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3065 { | 3135 { |
3066 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt
erface = method; | 3136 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt
erface = method; |
3067 } | 3137 } |
3068 | 3138 |
3069 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(
void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 3139 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(
void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
3070 { | 3140 { |
3071 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart
ialInterface = method; | 3141 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart
ialInterface = method; |
3072 } | 3142 } |
3073 | 3143 |
3074 } // namespace blink | 3144 } // namespace blink |
OLD | NEW |