Changeset 107371 in webkit
- Timestamp:
- Feb 9, 2012 11:55:36 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107369 r107371 1 2012-02-09 Kentaro Hara <haraken@chromium.org> 2 3 Unreviewed, rolling out r107368. 4 http://trac.webkit.org/changeset/107368 5 https://bugs.webkit.org/show_bug.cgi?id=78327 6 7 break GTK build 8 9 * bindings/scripts/CodeGeneratorCPP.pm: 10 (ShouldSkipType): 11 * bindings/scripts/CodeGeneratorGObject.pm: 12 (SkipFunction): 13 (GenerateFunction): 14 * bindings/scripts/CodeGeneratorJS.pm: 15 (GenerateCallWith): 16 (GenerateParametersCheck): 17 * bindings/scripts/CodeGeneratorV8.pm: 18 (GenerateFunctionCallback): 19 (GenerateCallWith): 20 (GenerateFunctionCallString): 21 * bindings/scripts/test/CPP/WebDOMTestObj.cpp: 22 * bindings/scripts/test/CPP/WebDOMTestObj.h: 23 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: 24 (webkit_dom_test_obj_get_property): 25 (webkit_dom_test_obj_class_init): 26 * bindings/scripts/test/GObject/WebKitDOMTestObj.h: 27 * bindings/scripts/test/JS/JSTestObj.cpp: 28 (WebCore): 29 (WebCore::jsTestObjPrototypeFunctionCustomArgsAndException): 30 * bindings/scripts/test/JS/JSTestObj.h: 31 (WebCore): 32 * bindings/scripts/test/ObjC/DOMTestObj.h: 33 * bindings/scripts/test/ObjC/DOMTestObj.mm: 34 (-[DOMTestObj customArgsAndException:]): 35 * bindings/scripts/test/TestObj.idl: 36 * bindings/scripts/test/V8/V8TestObj.cpp: 37 (WebCore::TestObjInternal::customArgsAndExceptionCallback): 38 (TestObjInternal): 39 (WebCore): 40 (WebCore::ConfigureV8TestObjTemplate): 41 * bindings/v8/custom/V8ConsoleCustom.cpp: 42 (WebCore::V8Console::assertCallback): 43 * page/Console.cpp: 44 (WebCore::Console::assertCondition): 45 (WebCore::Console::timeEnd): 46 * page/Console.h: 47 (Console): 48 * page/Console.idl: 49 1 50 2012-02-09 Zoltan Herczeg <zherczeg@webkit.org> 2 51 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
r107368 r107371 192 192 my $typeInfo = shift; 193 193 194 return 1 if $typeInfo->signature->extendedAttributes->{"Custom"} 195 or $typeInfo->signature->extendedAttributes->{"CustomGetter"} 196 or $typeInfo->signature->extendedAttributes->{"CPPCustom"}; 194 return 1 if $typeInfo->signature->extendedAttributes->{"Custom"}; 195 196 return 1 if $typeInfo->signature->extendedAttributes->{"CustomArgumentHandling"} 197 or $typeInfo->signature->extendedAttributes->{"CustomGetter"} 198 or $typeInfo->signature->extendedAttributes->{"CPPCustom"}; 197 199 198 200 # FIXME: We don't generate bindings for SVG related interfaces yet -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
r107368 r107371 189 189 190 190 my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name); 191 my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"}; 191 my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"} || 192 $function->signature->extendedAttributes->{"CustomArgumentHandling"}; 192 193 193 194 if ($isCustomFunction && … … 737 738 738 739 my @callImplParams; 740 741 # skip some custom functions for now 742 my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"} || 743 $function->signature->extendedAttributes->{"CustomArgumentHandling"}; 739 744 740 745 foreach my $param (@{$function->parameters}) { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r107368 r107371 2333 2333 my $outputArray = shift; 2334 2334 my $returnValue = shift; 2335 my $function = shift;2336 2335 2337 2336 my @callWithArgs; … … 2344 2343 push(@$outputArray, " return" . ($returnValue ? " " . $returnValue : "") . ";\n"); 2345 2344 push(@callWithArgs, "scriptContext"); 2346 }2347 if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) {2348 push(@$outputArray, " RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, " . @{$function->parameters} . "));\n");2349 $implIncludes{"ScriptArguments.h"} = 1;2350 push(@callWithArgs, "scriptArguments");2351 }2352 if ($codeGenerator->ExtendedAttributeContains($callWith, "CallStack")) {2353 push(@$outputArray, " RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));\n");2354 $implIncludes{"ScriptCallStack.h"} = 1;2355 $implIncludes{"ScriptCallStackFactory.h"} = 1;2356 push(@callWithArgs, "callStack");2357 2345 } 2358 2346 return @callWithArgs; … … 2410 2398 } 2411 2399 2400 if ($function->signature->extendedAttributes->{"CustomArgumentHandling"} and !$function->isStatic) { 2401 push(@$outputArray, " RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, $numParameters));\n"); 2402 push(@$outputArray, " RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));\n"); 2403 $implIncludes{"ScriptArguments.h"} = 1; 2404 $implIncludes{"ScriptCallStack.h"} = 1; 2405 $implIncludes{"ScriptCallStackFactory.h"} = 1; 2406 } 2407 2412 2408 if (!$function->signature->extendedAttributes->{"Constructor"}) { 2413 push(@arguments, GenerateCallWith($function->signature->extendedAttributes->{"CallWith"}, \@$outputArray, "JSValue::encode(jsUndefined())" , $function));2409 push(@arguments, GenerateCallWith($function->signature->extendedAttributes->{"CallWith"}, \@$outputArray, "JSValue::encode(jsUndefined())")); 2414 2410 } 2415 2411 … … 2430 2426 2431 2427 my @optionalCallbackArguments = @arguments; 2428 if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) { 2429 push @optionalCallbackArguments, "scriptArguments, callStack"; 2430 } 2432 2431 if (@{$function->raisesExceptions}) { 2433 2432 push @optionalCallbackArguments, "ec"; … … 2524 2523 } 2525 2524 2525 if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) { 2526 push @arguments, "scriptArguments, callStack"; 2527 } 2526 2528 if (@{$function->raisesExceptions}) { 2527 2529 push @arguments, "ec"; -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r107368 r107371 1362 1362 END 1363 1363 1364 my $numParameters = @{$function->parameters}; 1365 1364 1366 push(@implContentDecls, GenerateArgumentsCountCheck($function, $dataNode)); 1365 1367 … … 1416 1418 } 1417 1419 1420 if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) { 1421 push(@implContentDecls, <<END); 1422 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, $numParameters)); 1423 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector()); 1424 if (!callStack) 1425 return v8::Undefined(); 1426 END 1427 AddToImplIncludes("ScriptArguments.h"); 1428 AddToImplIncludes("ScriptCallStack.h"); 1429 AddToImplIncludes("ScriptCallStackFactory.h"); 1430 } 1418 1431 if ($function->signature->extendedAttributes->{"CheckAccessToNode"}) { 1419 1432 push(@implContentDecls, " if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->" . $function->signature->name . "(ec)))\n"); … … 1447 1460 my $returnVoid = shift; 1448 1461 my $emptyContext = shift; 1449 my $function = shift;1450 1462 1451 1463 my @callWithArgs; … … 1466 1478 push(@$outputArray, $indent . " return" . ($returnVoid ? "" : " v8::Undefined()") . ";\n"); 1467 1479 push(@callWithArgs, "scriptContext"); 1468 }1469 if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) {1470 push(@$outputArray, $indent . "RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, " . @{$function->parameters} . "));\n");1471 push(@callWithArgs, "scriptArguments");1472 AddToImplIncludes("ScriptArguments.h");1473 }1474 if ($codeGenerator->ExtendedAttributeContains($callWith, "CallStack")) {1475 push(@$outputArray, $indent . "RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());\n");1476 push(@$outputArray, $indent . "if (!callStack)\n");1477 push(@$outputArray, $indent . " return v8::Undefined();\n");1478 push(@callWithArgs, "callStack");1479 AddToImplIncludes("ScriptCallStack.h");1480 AddToImplIncludes("ScriptCallStackFactory.h");1481 1480 } 1482 1481 return @callWithArgs; … … 3198 3197 my $callWith = $function->signature->extendedAttributes->{"CallWith"}; 3199 3198 my @callWithOutput = (); 3200 my @callWithArgs = GenerateCallWith($callWith, \@callWithOutput, $indent, 0, 1 , $function);3199 my @callWithArgs = GenerateCallWith($callWith, \@callWithOutput, $indent, 0, 1); 3201 3200 $result .= join("", @callWithOutput); 3202 3201 push(@arguments, @callWithArgs); … … 3225 3224 } 3226 3225 $index++; 3226 } 3227 3228 if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) { 3229 push @arguments, "scriptArguments, callStack"; 3227 3230 } 3228 3231 -
trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
r107368 r107371 615 615 } 616 616 617 WebDOMTestObj WebDOMTestObj::withScriptArgumentsAndCallStackAttribute() const618 {619 if (!impl())620 return WebDOMTestObj();621 622 return toWebKit(WTF::getPtr(impl()->withScriptArgumentsAndCallStackAttribute()));623 }624 625 void WebDOMTestObj::setWithScriptArgumentsAndCallStackAttribute(const WebDOMTestObj& newWithScriptArgumentsAndCallStackAttribute)626 {627 if (!impl())628 return;629 630 impl()->setWithScriptArgumentsAndCallStackAttribute(toWebCore(newWithScriptArgumentsAndCallStackAttribute));631 }632 633 617 WebDOMString WebDOMTestObj::scriptStringAttr() const 634 618 { … … 1016 1000 } 1017 1001 1018 void WebDOMTestObj::withScriptArgumentsAndCallStack()1019 {1020 if (!impl())1021 return;1022 1023 impl()->withScriptArgumentsAndCallStack();1024 }1025 1026 1002 void WebDOMTestObj::methodWithOptionalArg(int opt) 1027 1003 { -
trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
r107368 r107371 135 135 WebDOMTestObj withScriptExecutionContextAndScriptStateWithSpacesAttribute() const; 136 136 void setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(const WebDOMTestObj&); 137 WebDOMTestObj withScriptArgumentsAndCallStackAttribute() const;138 void setWithScriptArgumentsAndCallStackAttribute(const WebDOMTestObj&);139 137 WebDOMString scriptStringAttr() const; 140 138 #if ENABLE(Condition1) … … 195 193 WebDOMTestObj withScriptExecutionContextAndScriptStateObjException(); 196 194 WebDOMTestObj withScriptExecutionContextAndScriptStateWithSpaces(); 197 void withScriptArgumentsAndCallStack();198 195 void methodWithOptionalArg(int opt); 199 196 void methodWithNonOptionalArgAndOptionalArg(int nonOpt, int opt); -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
r107368 r107371 345 345 346 346 void 347 webkit_dom_test_obj_with_script_arguments_and_call_stack(WebKitDOMTestObj* self)348 {349 g_return_if_fail(self);350 WebCore::JSMainThreadNullState state;351 WebCore::TestObj * item = WebKit::core(self);352 item->withScriptArgumentsAndCallStack();353 }354 355 void356 347 webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt) 357 348 { … … 1322 1313 } 1323 1314 item->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(converted_value); 1324 }1325 1326 WebKitDOMTestObj*1327 webkit_dom_test_obj_get_with_script_arguments_and_call_stack_attribute(WebKitDOMTestObj* self)1328 {1329 g_return_val_if_fail(self, 0);1330 WebCore::JSMainThreadNullState state;1331 WebCore::TestObj * item = WebKit::core(self);1332 PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptArgumentsAndCallStackAttribute());1333 WebKitDOMTestObj* res = WebKit::kit(g_res.get());1334 return res;1335 }1336 1337 void1338 webkit_dom_test_obj_set_with_script_arguments_and_call_stack_attribute(WebKitDOMTestObj* self, WebKitDOMTestObj* value)1339 {1340 g_return_if_fail(self);1341 WebCore::JSMainThreadNullState state;1342 WebCore::TestObj * item = WebKit::core(self);1343 g_return_if_fail(value);1344 WebCore::TestObj * converted_value = NULL;1345 if (value != NULL) {1346 converted_value = WebKit::core(value);1347 g_return_if_fail(converted_value);1348 }1349 item->setWithScriptArgumentsAndCallStackAttribute(converted_value);1350 1315 } 1351 1316 … … 1606 1571 PROP_WITH_SCRIPT_EXECUTION_CONTEXT_AND_SCRIPT_STATE_ATTRIBUTE_RAISES, 1607 1572 PROP_WITH_SCRIPT_EXECUTION_CONTEXT_AND_SCRIPT_STATE_WITH_SPACES_ATTRIBUTE, 1608 PROP_WITH_SCRIPT_ARGUMENTS_AND_CALL_STACK_ATTRIBUTE,1609 1573 PROP_SCRIPT_STRING_ATTR, 1610 1574 #if ENABLE(Condition1) … … 1966 1930 break; 1967 1931 } 1968 case PROP_WITH_SCRIPT_ARGUMENTS_AND_CALL_STACK_ATTRIBUTE:1969 {1970 RefPtr<WebCore::TestObj> ptr = coreSelf->withScriptArgumentsAndCallStackAttribute();1971 g_value_set_object(value, WebKit::kit(ptr.get()));1972 break;1973 }1974 1932 case PROP_SCRIPT_STRING_ATTR: 1975 1933 { … … 2307 2265 WEBKIT_PARAM_READWRITE)); 2308 2266 g_object_class_install_property(gobjectClass, 2309 PROP_WITH_SCRIPT_ARGUMENTS_AND_CALL_STACK_ATTRIBUTE,2310 g_param_spec_object("with-script-arguments-and-call-stack-attribute", /* name */2311 "test_obj_with-script-arguments-and-call-stack-attribute", /* short description */2312 "read-write WebKitDOMTestObj* TestObj.with-script-arguments-and-call-stack-attribute", /* longer - could do with some extra doc stuff here */2313 WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */2314 WEBKIT_PARAM_READWRITE));2315 g_object_class_install_property(gobjectClass,2316 2267 PROP_SCRIPT_STRING_ATTR, 2317 2268 g_param_spec_string("script-string-attr", /* name */ -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
r107368 r107371 258 258 259 259 /** 260 * webkit_dom_test_obj_with_script_arguments_and_call_stack:261 * @self: A #WebKitDOMTestObj262 *263 * Returns:264 *265 **/266 WEBKIT_API void267 webkit_dom_test_obj_with_script_arguments_and_call_stack(WebKitDOMTestObj* self);268 269 /**270 260 * webkit_dom_test_obj_method_with_optional_arg: 271 261 * @self: A #WebKitDOMTestObj … … 1160 1150 1161 1151 /** 1162 * webkit_dom_test_obj_get_with_script_arguments_and_call_stack_attribute:1163 * @self: A #WebKitDOMTestObj1164 *1165 * Returns: (transfer none):1166 *1167 **/1168 WEBKIT_API WebKitDOMTestObj*1169 webkit_dom_test_obj_get_with_script_arguments_and_call_stack_attribute(WebKitDOMTestObj* self);1170 1171 /**1172 * webkit_dom_test_obj_set_with_script_arguments_and_call_stack_attribute:1173 * @self: A #WebKitDOMTestObj1174 * @value: A #WebKitDOMTestObj1175 *1176 * Returns: (transfer none):1177 *1178 **/1179 WEBKIT_API void1180 webkit_dom_test_obj_set_with_script_arguments_and_call_stack_attribute(WebKitDOMTestObj* self, WebKitDOMTestObj* value);1181 1182 /**1183 1152 * webkit_dom_test_obj_get_script_string_attr: 1184 1153 * @self: A #WebKitDOMTestObj -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r107368 r107371 43 43 #include "JSe.h" 44 44 #include "JSint.h" 45 #include "JSlog.h" 45 46 #include "KURL.h" 46 47 #include "SVGDocument.h" … … 112 113 { "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises, NoIntrinsic }, 113 114 { "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute, NoIntrinsic }, 114 { "withScriptArgumentsAndCallStackAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t)setJSTestObjWithScriptArgumentsAndCallStackAttribute, NoIntrinsic },115 115 { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0, NoIntrinsic }, 116 116 #if ENABLE(Condition1) … … 262 262 { "customMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0, NoIntrinsic }, 263 263 { "customMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3, NoIntrinsic }, 264 { "customArgsAndException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1, NoIntrinsic }, 264 265 { "addEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3, NoIntrinsic }, 265 266 { "removeEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3, NoIntrinsic }, … … 272 273 { "withScriptExecutionContextAndScriptStateObjException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException), (intptr_t)0, NoIntrinsic }, 273 274 { "withScriptExecutionContextAndScriptStateWithSpaces", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t)0, NoIntrinsic }, 274 { "withScriptArgumentsAndCallStack", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t)0, NoIntrinsic },275 275 { "methodWithOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1, NoIntrinsic }, 276 276 { "methodWithNonOptionalArgAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2, NoIntrinsic }, … … 305 305 }; 306 306 307 static const HashTable JSTestObjPrototypeTable = { 26 6, 255, JSTestObjPrototypeTableValues, 0 };307 static const HashTable JSTestObjPrototypeTable = { 265, 255, JSTestObjPrototypeTableValues, 0 }; 308 308 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) }; 309 309 … … 703 703 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 704 704 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext))); 705 return result;706 }707 708 709 JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSValue slotBase, const Identifier&)710 {711 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));712 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));713 TestObj* impl = static_cast<TestObj*>(castedThis->impl());714 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptArgumentsAndCallStackAttribute(callStack)));715 705 return result; 716 706 } … … 1164 1154 1165 1155 1166 void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObject* thisObject, JSValue value)1167 {1168 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);1169 TestObj* impl = static_cast<TestObj*>(castedThis->impl());1170 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));1171 impl->setWithScriptArgumentsAndCallStackAttribute(callStack, toTestObj(value));1172 }1173 1174 1175 1156 #if ENABLE(Condition1) 1176 1157 void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value) … … 1494 1475 } 1495 1476 1477 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(ExecState* exec) 1478 { 1479 JSValue thisValue = exec->hostThisValue(); 1480 if (!thisValue.inherits(&JSTestObj::s_info)) 1481 return throwVMTypeError(exec); 1482 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1483 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1484 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1485 if (exec->argumentCount() < 1) 1486 return throwVMError(exec, createTypeError(exec, "Not enough arguments")); 1487 ExceptionCode ec = 0; 1488 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 1)); 1489 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec)); 1490 log* intArg(tolog(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined))); 1491 if (exec->hadException()) 1492 return JSValue::encode(jsUndefined()); 1493 impl->customArgsAndException(intArg, scriptArguments, callStack, ec); 1494 setDOMException(exec, ec); 1495 return JSValue::encode(jsUndefined()); 1496 } 1497 1496 1498 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec) 1497 1499 { … … 1652 1654 return JSValue::encode(jsUndefined()); 1653 1655 return JSValue::encode(result); 1654 }1655 1656 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(ExecState* exec)1657 {1658 JSValue thisValue = exec->hostThisValue();1659 if (!thisValue.inherits(&JSTestObj::s_info))1660 return throwVMTypeError(exec);1661 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));1662 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);1663 TestObj* impl = static_cast<TestObj*>(castedThis->impl());1664 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0));1665 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));1666 impl->withScriptArgumentsAndCallStack(scriptArguments, callStack);1667 return JSValue::encode(jsUndefined());1668 1656 } 1669 1657 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r107368 r107371 164 164 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(JSC::ExecState*); 165 165 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(JSC::ExecState*); 166 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(JSC::ExecState*); 166 167 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(JSC::ExecState*); 167 168 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(JSC::ExecState*); … … 174 175 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException(JSC::ExecState*); 175 176 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(JSC::ExecState*); 176 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(JSC::ExecState*);177 177 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(JSC::ExecState*); 178 178 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(JSC::ExecState*); … … 266 266 JSC::JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 267 267 void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); 268 JSC::JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);269 void setJSTestObjWithScriptArgumentsAndCallStackAttribute(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);270 268 JSC::JSValue jsTestObjScriptStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); 271 269 JSC::JSValue jsTestObjConditionalAttr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
r107368 r107371 44 44 @class DOMd; 45 45 @class DOMe; 46 @class DOMlog; 46 47 @class NSString; 47 48 @protocol DOMEventListener; … … 129 130 - (DOMTestObj *)withScriptExecutionContextAndScriptStateWithSpacesAttribute; 130 131 - (void)setWithScriptExecutionContextAndScriptStateWithSpacesAttribute:(DOMTestObj *)newWithScriptExecutionContextAndScriptStateWithSpacesAttribute; 131 - (DOMTestObj *)withScriptArgumentsAndCallStackAttribute;132 - (void)setWithScriptArgumentsAndCallStackAttribute:(DOMTestObj *)newWithScriptArgumentsAndCallStackAttribute;133 132 - (NSString *)scriptStringAttr; 134 133 #if ENABLE(Condition1) … … 180 179 - (void)customMethod; 181 180 - (void)customMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg; 181 - (void)customArgsAndException:(DOMlog *)intArg; 182 182 - (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture; 183 183 - (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture; … … 190 190 - (DOMTestObj *)withScriptExecutionContextAndScriptStateObjException; 191 191 - (DOMTestObj *)withScriptExecutionContextAndScriptStateWithSpaces; 192 - (void)withScriptArgumentsAndCallStack;193 192 - (void)methodWithOptionalArg:(int)opt; 194 193 - (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt; -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
r107368 r107371 51 51 #import "DOMdInternal.h" 52 52 #import "DOMeInternal.h" 53 #import "DOMlogInternal.h" 53 54 #import "Document.h" 54 55 #import "EventListener.h" … … 76 77 #import "d.h" 77 78 #import "e.h" 79 #import "log.h" 78 80 #import <wtf/GetPtr.h> 79 81 … … 522 524 } 523 525 524 - (DOMTestObj *)withScriptArgumentsAndCallStackAttribute525 {526 WebCore::JSMainThreadNullState state;527 return kit(WTF::getPtr(IMPL->withScriptArgumentsAndCallStackAttribute()));528 }529 530 - (void)setWithScriptArgumentsAndCallStackAttribute:(DOMTestObj *)newWithScriptArgumentsAndCallStackAttribute531 {532 WebCore::JSMainThreadNullState state;533 ASSERT(newWithScriptArgumentsAndCallStackAttribute);534 535 IMPL->setWithScriptArgumentsAndCallStackAttribute(core(newWithScriptArgumentsAndCallStackAttribute));536 }537 538 526 - (NSString *)scriptStringAttr 539 527 { … … 785 773 } 786 774 775 - (void)customArgsAndException:(DOMlog *)intArg 776 { 777 WebCore::JSMainThreadNullState state; 778 WebCore::ExceptionCode ec = 0; 779 IMPL->customArgsAndException(core(intArg), ec); 780 WebCore::raiseOnDOMError(ec); 781 } 782 787 783 - (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture 788 784 { … … 853 849 WebCore::JSMainThreadNullState state; 854 850 return kit(WTF::getPtr(IMPL->withScriptExecutionContextAndScriptStateWithSpaces())); 855 }856 857 - (void)withScriptArgumentsAndCallStack858 {859 WebCore::JSMainThreadNullState state;860 IMPL->withScriptArgumentsAndCallStack();861 851 } 862 852 -
trunk/Source/WebCore/bindings/scripts/test/TestObj.idl
r107368 r107371 89 89 [Custom] void customMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg); 90 90 91 [CustomArgumentHandling] void customArgsAndException(in log intArg) 92 raises(DOMException); 93 91 94 void addEventListener(in DOMString type, 92 95 in EventListener listener, … … 108 111 raises(DOMException); 109 112 [CallWith= ScriptExecutionContext | ScriptState ] TestObj withScriptExecutionContextAndScriptStateWithSpaces(); 110 [CallWith=ScriptArguments|CallStack] void withScriptArgumentsAndCallStack();111 113 112 114 attribute [CallWith=ScriptState] long withScriptStateAttribute; … … 120 122 getter raises(DOMException); 121 123 attribute [CallWith= ScriptExecutionContext | ScriptState ] TestObj withScriptExecutionContextAndScriptStateWithSpacesAttribute; 122 attribute [CallWith=ScriptArguments|CallStack] TestObj withScriptArgumentsAndCallStackAttribute;123 124 124 125 // 'Optional' extended attribute -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r107368 r107371 52 52 #include "V8e.h" 53 53 #include "V8int.h" 54 #include "V8log.h" 54 55 #include <wtf/GetPtr.h> 55 56 #include <wtf/RefCounted.h> … … 695 696 } 696 697 697 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)698 {699 INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStackAttribute._get");700 TestObj* imp = V8TestObj::toNative(info.Holder());701 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());702 if (!callStack)703 return v8::Undefined();704 return toV8(imp->withScriptArgumentsAndCallStackAttribute(callStack));705 }706 707 static void withScriptArgumentsAndCallStackAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)708 {709 INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStackAttribute._set");710 TestObj* imp = V8TestObj::toNative(info.Holder());711 TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;712 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());713 if (!callStack)714 return v8::Undefined();715 imp->setWithScriptArgumentsAndCallStackAttribute(callStack, WTF::getPtr(v));716 return;717 }718 719 698 static v8::Handle<v8::Value> scriptStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 720 699 { … … 1121 1100 { 1122 1101 imp->methodWithException(ec); 1102 if (UNLIKELY(ec)) 1103 goto fail; 1104 return v8::Handle<v8::Value>(); 1105 } 1106 fail: 1107 V8Proxy::setDOMException(ec); 1108 return v8::Handle<v8::Value>(); 1109 } 1110 1111 static v8::Handle<v8::Value> customArgsAndExceptionCallback(const v8::Arguments& args) 1112 { 1113 INC_STATS("DOM.TestObj.customArgsAndException"); 1114 if (args.Length() < 1) 1115 return throwError("Not enough arguments", V8Proxy::TypeError); 1116 TestObj* imp = V8TestObj::toNative(args.Holder()); 1117 ExceptionCode ec = 0; 1118 { 1119 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, 1)); 1120 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector()); 1121 if (!callStack) 1122 return v8::Undefined(); 1123 EXCEPTION_BLOCK(log*, intArg, V8log::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8log::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0); 1124 imp->customArgsAndException(intArg, scriptArguments, callStack, ec); 1123 1125 if (UNLIKELY(ec)) 1124 1126 goto fail; … … 1271 1273 return throwError(state.exception()); 1272 1274 return toV8(result.release()); 1273 }1274 1275 static v8::Handle<v8::Value> withScriptArgumentsAndCallStackCallback(const v8::Arguments& args)1276 {1277 INC_STATS("DOM.TestObj.withScriptArgumentsAndCallStack");1278 TestObj* imp = V8TestObj::toNative(args.Holder());1279 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, 0));1280 RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector());1281 if (!callStack)1282 return v8::Undefined();1283 imp->withScriptArgumentsAndCallStack(scriptArguments, callStack);1284 return v8::Handle<v8::Value>();1285 1275 } 1286 1276 … … 1815 1805 // Attribute 'withScriptExecutionContextAndScriptStateWithSpacesAttribute' (Type: 'attribute' ExtAttr: 'CallWith') 1816 1806 {"withScriptExecutionContextAndScriptStateWithSpacesAttribute", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 1817 // Attribute 'withScriptArgumentsAndCallStackAttribute' (Type: 'attribute' ExtAttr: 'CallWith')1818 {"withScriptArgumentsAndCallStackAttribute", TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrGetter, TestObjInternal::withScriptArgumentsAndCallStackAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},1819 1807 // Attribute 'scriptStringAttr' (Type: 'readonly attribute' ExtAttr: 'ConvertScriptString') 1820 1808 {"scriptStringAttr", TestObjInternal::scriptStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, … … 1887 1875 {"withScriptExecutionContextAndScriptStateObjException", TestObjInternal::withScriptExecutionContextAndScriptStateObjExceptionCallback}, 1888 1876 {"withScriptExecutionContextAndScriptStateWithSpaces", TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesCallback}, 1889 {"withScriptArgumentsAndCallStack", TestObjInternal::withScriptArgumentsAndCallStackCallback},1890 1877 {"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback}, 1891 1878 {"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback}, … … 2019 2006 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv); 2020 2007 proto->Set(v8::String::New("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback, v8::Handle<v8::Value>(), methodThatRequiresAllArgsAndThrowsSignature)); 2008 2009 // Custom Signature 'customArgsAndException' 2010 const int customArgsAndExceptionArgc = 1; 2011 v8::Handle<v8::FunctionTemplate> customArgsAndExceptionArgv[customArgsAndExceptionArgc] = { V8log::GetRawTemplate() }; 2012 v8::Handle<v8::Signature> customArgsAndExceptionSignature = v8::Signature::New(desc, customArgsAndExceptionArgc, customArgsAndExceptionArgv); 2013 proto->Set(v8::String::New("customArgsAndException"), v8::FunctionTemplate::New(TestObjInternal::customArgsAndExceptionCallback, v8::Handle<v8::Value>(), customArgsAndExceptionSignature)); 2021 2014 desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>())); 2022 2015 desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>())); -
trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
r107368 r107371 80 80 bool condition = args[0]->BooleanValue(); 81 81 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(args, 1)); 82 imp->assertCondition( scriptArguments.release(), callStack, condition);82 imp->assertCondition(condition, scriptArguments.release(), callStack); 83 83 return v8::Handle<v8::Value>(); 84 84 } -
trunk/Source/WebCore/page/Console.cpp
r107368 r107371 237 237 } 238 238 239 void Console::assertCondition( PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack, bool condition)239 void Console::assertCondition(bool condition, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack) 240 240 { 241 241 if (condition) … … 304 304 } 305 305 306 void Console::timeEnd( PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack> callStack, const String& title)306 void Console::timeEnd(const String& title, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack> callStack) 307 307 { 308 308 #if PLATFORM(CHROMIUM) -
trunk/Source/WebCore/page/Console.h
r107368 r107371 67 67 void dirxml(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); 68 68 void trace(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); 69 void assertCondition( PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>, bool condition);69 void assertCondition(bool condition, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); 70 70 void count(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); 71 71 void markTimeline(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); … … 76 76 #endif 77 77 void time(const String&); 78 void timeEnd( PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>, const String&);78 void timeEnd(const String&, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); 79 79 void timeStamp(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); 80 80 void group(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>); -
trunk/Source/WebCore/page/Console.idl
r107368 r107371 34 34 ] Console { 35 35 36 [C allWith=ScriptArguments|CallStack] void debug();37 [C allWith=ScriptArguments|CallStack] void error();38 [C allWith=ScriptArguments|CallStack] void info();39 [C allWith=ScriptArguments|CallStack] void log();40 [C allWith=ScriptArguments|CallStack] void warn();41 [C allWith=ScriptArguments|CallStack] void dir();42 [C allWith=ScriptArguments|CallStack] void dirxml();43 [V8Custom, C allWith=ScriptArguments|CallStack] void trace();44 [V8Custom, C allWith=ScriptArguments|CallStack, ImplementedAs=assertCondition] void assert(in boolean condition);45 [C allWith=ScriptArguments|CallStack] void count();46 [C allWith=ScriptArguments|CallStack] void markTimeline();36 [CustomArgumentHandling] void debug(); 37 [CustomArgumentHandling] void error(); 38 [CustomArgumentHandling] void info(); 39 [CustomArgumentHandling] void log(); 40 [CustomArgumentHandling] void warn(); 41 [CustomArgumentHandling] void dir(); 42 [CustomArgumentHandling] void dirxml(); 43 [V8Custom, CustomArgumentHandling] void trace(); 44 [V8Custom, CustomArgumentHandling, ImplementedAs=assertCondition] void assert(in boolean condition); 45 [CustomArgumentHandling] void count(); 46 [CustomArgumentHandling] void markTimeline(); 47 47 48 48 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER … … 53 53 54 54 void time(in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString title); 55 [C allWith=ScriptArguments|CallStack] void timeEnd(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString title);56 [C allWith=ScriptArguments|CallStack] void timeStamp();57 [C allWith=ScriptArguments|CallStack] void group();58 [C allWith=ScriptArguments|CallStack] void groupCollapsed();55 [CustomArgumentHandling] void timeEnd(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString title); 56 [CustomArgumentHandling] void timeStamp(); 57 [CustomArgumentHandling] void group(); 58 [CustomArgumentHandling] void groupCollapsed(); 59 59 void groupEnd(); 60 60
Note: See TracChangeset
for help on using the changeset viewer.