Changeset 117725 in webkit
- Timestamp:
- May 20, 2012 10:03:33 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117724 r117725 1 2012-05-20 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Pass Isolate to throwError()s in CodeGeneratorV8.pm 4 https://bugs.webkit.org/show_bug.cgi?id=86976 5 6 Reviewed by Adam Barth. 7 8 The objective is to pass Isolate around in V8 bindings. 9 This patch passes Isolate to throwError()s in CodeGeneratorV8.pm. 10 11 No tests. No change in behavior. 12 13 * bindings/scripts/CodeGeneratorV8.pm: 14 (GenerateNormalAttrGetter): 15 (GenerateNormalAttrSetter): 16 (GenerateParametersCheck): 17 (GenerateConstructorCallback): 18 (GenerateNamedConstructorCallback): 19 (GenerateFunctionCallString): 20 * bindings/scripts/test/V8/V8TestInterface.cpp: 21 (WebCore::V8TestInterface::constructorCallback): 22 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 23 (WebCore::V8TestNamedConstructorConstructorCallback): 24 * bindings/scripts/test/V8/V8TestObj.cpp: 25 (WebCore::TestObjV8Internal::withScriptStateAttributeAttrSetter): 26 (WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrGetter): 27 (WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter): 28 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSetter): 29 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter): 30 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter): 31 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter): 32 (WebCore::TestObjV8Internal::withScriptStateVoidCallback): 33 (WebCore::TestObjV8Internal::withScriptStateObjCallback): 34 (WebCore::TestObjV8Internal::withScriptStateVoidExceptionCallback): 35 (WebCore::TestObjV8Internal::withScriptStateObjExceptionCallback): 36 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateCallback): 37 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExceptionCallback): 38 (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesCallback): 39 (WebCore::TestObjV8Internal::methodWithCallbackArgCallback): 40 (WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback): 41 (WebCore::TestObjV8Internal::methodWithCallbackAndOptionalArgCallback): 42 (WebCore::TestObjV8Internal::overloadedMethod5Callback): 43 (WebCore::V8TestObj::constructorCallback): 44 1 45 2012-05-20 George Staikos <staikos@webkit.org> 2 46 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r117507 r117725 895 895 if ($codeGenerator->ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) { 896 896 push(@implContentDecls, " if (state.hadException())\n"); 897 push(@implContentDecls, " return throwError(state.exception() );\n");897 push(@implContentDecls, " return throwError(state.exception(), info.GetIsolate());\n"); 898 898 } 899 899 … … 1186 1186 if ($codeGenerator->ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) { 1187 1187 push(@implContentDecls, " if (state.hadException())\n"); 1188 push(@implContentDecls, " throwError(state.exception() );\n");1188 push(@implContentDecls, " throwError(state.exception(), info.GetIsolate());\n"); 1189 1189 } 1190 1190 … … 1591 1591 $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n"; 1592 1592 $parameterCheckString .= " if (!args[$paramIndex]->IsFunction())\n"; 1593 $parameterCheckString .= " return throwError(TYPE_MISMATCH_ERR );\n";1593 $parameterCheckString .= " return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());\n"; 1594 1594 $parameterCheckString .= " $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n"; 1595 1595 $parameterCheckString .= " }\n"; 1596 1596 } else { 1597 1597 $parameterCheckString .= " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsFunction())\n"; 1598 $parameterCheckString .= " return throwError(TYPE_MISMATCH_ERR );\n";1598 $parameterCheckString .= " return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());\n"; 1599 1599 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n"; 1600 1600 } … … 1740 1740 ScriptExecutionContext* context = getScriptExecutionContext(); 1741 1741 if (!context) 1742 return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor's associated context is not available" );1742 return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor's associated context is not available", args.GetIsolate()); 1743 1743 END 1744 1744 } … … 1780 1780 if ($raisesExceptions) { 1781 1781 push(@implContent, " fail:\n"); 1782 push(@implContent, " return throwError(ec );\n");1782 push(@implContent, " return throwError(ec, args.GetIsolate());\n"); 1783 1783 } 1784 1784 … … 1896 1896 Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); 1897 1897 if (!frame) 1898 return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor associated frame is unavailable" );1898 return V8Proxy::throwError(V8Proxy::ReferenceError, "${implClassName} constructor associated frame is unavailable", args.GetIsolate()); 1899 1899 1900 1900 Document* document = frame->document(); … … 1955 1955 if ($raisesExceptions) { 1956 1956 push(@implContent, " fail:\n"); 1957 push(@implContent, " return throwError(ec );\n");1957 push(@implContent, " return throwError(ec, args.GetIsolate());\n"); 1958 1958 } 1959 1959 … … 3335 3335 if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptState")) { 3336 3336 $result .= $indent . "if (state.hadException())\n"; 3337 $result .= $indent . " return throwError(state.exception() );\n"3337 $result .= $indent . " return throwError(state.exception(), args.GetIsolate());\n" 3338 3338 } 3339 3339 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r117507 r117725 222 222 ScriptExecutionContext* context = getScriptExecutionContext(); 223 223 if (!context) 224 return V8Proxy::throwError(V8Proxy::ReferenceError, "TestInterface constructor's associated context is not available" );224 return V8Proxy::throwError(V8Proxy::ReferenceError, "TestInterface constructor's associated context is not available", args.GetIsolate()); 225 225 226 226 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, ec); … … 233 233 return args.Holder(); 234 234 fail: 235 return throwError(ec );235 return throwError(ec, args.GetIsolate()); 236 236 } 237 237 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r117507 r117725 56 56 Frame* frame = V8Proxy::retrieveFrameForCurrentContext(); 57 57 if (!frame) 58 return V8Proxy::throwError(V8Proxy::ReferenceError, "TestNamedConstructor constructor associated frame is unavailable" );58 return V8Proxy::throwError(V8Proxy::ReferenceError, "TestNamedConstructor constructor associated frame is unavailable", args.GetIsolate()); 59 59 60 60 Document* document = frame->document(); … … 81 81 return args.Holder(); 82 82 fail: 83 return throwError(ec );83 return throwError(ec, args.GetIsolate()); 84 84 } 85 85 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r117507 r117725 728 728 imp->setWithScriptStateAttribute(state, v); 729 729 if (state.hadException()) 730 throwError(state.exception() );730 throwError(state.exception(), info.GetIsolate()); 731 731 return; 732 732 } … … 768 768 } 769 769 if (state.hadException()) 770 return throwError(state.exception() );770 return throwError(state.exception(), info.GetIsolate()); 771 771 return toV8(v.release(), info.GetIsolate()); 772 772 } … … 785 785 V8Proxy::setDOMException(ec, info.GetIsolate()); 786 786 if (state.hadException()) 787 throwError(state.exception() );787 throwError(state.exception(), info.GetIsolate()); 788 788 return; 789 789 } … … 846 846 imp->setWithScriptExecutionContextAndScriptStateAttribute(state, scriptContext, WTF::getPtr(v)); 847 847 if (state.hadException()) 848 throwError(state.exception() );848 throwError(state.exception(), info.GetIsolate()); 849 849 return; 850 850 } … … 867 867 } 868 868 if (state.hadException()) 869 return throwError(state.exception() );869 return throwError(state.exception(), info.GetIsolate()); 870 870 return toV8(v.release(), info.GetIsolate()); 871 871 } … … 887 887 V8Proxy::setDOMException(ec, info.GetIsolate()); 888 888 if (state.hadException()) 889 throwError(state.exception() );889 throwError(state.exception(), info.GetIsolate()); 890 890 return; 891 891 } … … 917 917 imp->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(state, scriptContext, WTF::getPtr(v)); 918 918 if (state.hadException()) 919 throwError(state.exception() );919 throwError(state.exception(), info.GetIsolate()); 920 920 return; 921 921 } … … 1411 1411 imp->withScriptStateVoid(&state); 1412 1412 if (state.hadException()) 1413 return throwError(state.exception() );1413 return throwError(state.exception(), args.GetIsolate()); 1414 1414 return v8::Handle<v8::Value>(); 1415 1415 } … … 1422 1422 RefPtr<TestObj> result = imp->withScriptStateObj(&state); 1423 1423 if (state.hadException()) 1424 return throwError(state.exception() );1424 return throwError(state.exception(), args.GetIsolate()); 1425 1425 return toV8(result.release(), args.GetIsolate()); 1426 1426 } … … 1437 1437 goto fail; 1438 1438 if (state.hadException()) 1439 return throwError(state.exception() );1439 return throwError(state.exception(), args.GetIsolate()); 1440 1440 return v8::Handle<v8::Value>(); 1441 1441 } … … 1456 1456 goto fail; 1457 1457 if (state.hadException()) 1458 return throwError(state.exception() );1458 return throwError(state.exception(), args.GetIsolate()); 1459 1459 return toV8(result.release(), args.GetIsolate()); 1460 1460 } … … 1485 1485 imp->withScriptExecutionContextAndScriptState(&state, scriptContext); 1486 1486 if (state.hadException()) 1487 return throwError(state.exception() );1487 return throwError(state.exception(), args.GetIsolate()); 1488 1488 return v8::Handle<v8::Value>(); 1489 1489 } … … 1503 1503 goto fail; 1504 1504 if (state.hadException()) 1505 return throwError(state.exception() );1505 return throwError(state.exception(), args.GetIsolate()); 1506 1506 return toV8(result.release(), args.GetIsolate()); 1507 1507 } … … 1521 1521 RefPtr<TestObj> result = imp->withScriptExecutionContextAndScriptStateWithSpaces(&state, scriptContext); 1522 1522 if (state.hadException()) 1523 return throwError(state.exception() );1523 return throwError(state.exception(), args.GetIsolate()); 1524 1524 return toV8(result.release(), args.GetIsolate()); 1525 1525 } … … 1625 1625 TestObj* imp = V8TestObj::toNative(args.Holder()); 1626 1626 if (args.Length() <= 0 || !args[0]->IsFunction()) 1627 return throwError(TYPE_MISMATCH_ERR );1627 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 1628 1628 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext()); 1629 1629 imp->methodWithCallbackArg(callback); … … 1639 1639 EXCEPTION_BLOCK(int, nonCallback, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))); 1640 1640 if (args.Length() <= 1 || !args[1]->IsFunction()) 1641 return throwError(TYPE_MISMATCH_ERR );1641 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 1642 1642 RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExecutionContext()); 1643 1643 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); … … 1652 1652 if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) { 1653 1653 if (!args[0]->IsFunction()) 1654 return throwError(TYPE_MISMATCH_ERR );1654 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 1655 1655 callback = V8TestCallback::create(args[0], getScriptExecutionContext()); 1656 1656 } … … 1751 1751 TestObj* imp = V8TestObj::toNative(args.Holder()); 1752 1752 if (args.Length() <= 0 || !args[0]->IsFunction()) 1753 return throwError(TYPE_MISMATCH_ERR );1753 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 1754 1754 RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext()); 1755 1755 imp->overloadedMethod(callback); … … 2242 2242 return V8Proxy::throwNotEnoughArgumentsError(); 2243 2243 if (args.Length() <= 0 || !args[0]->IsFunction()) 2244 return throwError(TYPE_MISMATCH_ERR );2244 return throwError(TYPE_MISMATCH_ERR, args.GetIsolate()); 2245 2245 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getScriptExecutionContext()); 2246 2246
Note: See TracChangeset
for help on using the changeset viewer.