Changeset 171181 in webkit
- Timestamp:
- Jul 17, 2014 2:29:49 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r171177 r171181 1 2014-07-17 Vineet Chaudhary <code.vineet@gmail.com> 2 3 [GObject] StrictTypeChecking extended attribute fails for methods with sequence<T>. 4 https://bugs.webkit.org/show_bug.cgi?id=121698 5 6 Reviewed by Antonio Gomes. 7 8 GodeGenerator was including wrong heeaders as WebKitDOMlong[] for methods with 9 array parameters and StrictTypeChecking extended attribute. 10 No new tests. TestObj.idl covers the tests. 11 12 * bindings/scripts/CodeGenerator.pm: 13 (GetArrayOrSequenceType): 14 * bindings/scripts/CodeGeneratorGObject.pm: 15 (GenerateFunction): 16 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: 17 (webkit_dom_test_obj_strict_function_with_array): 18 * bindings/scripts/test/GObject/WebKitDOMTestObj.h: 19 * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp: 20 (webkit_dom_test_typedefs_func): 21 (webkit_dom_test_typedefs_nullable_array_arg): 22 * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h: 23 * bindings/scripts/test/TestObj.idl: 24 1 25 2014-07-17 Yusuke Suzuki <utatane.tea@gmail.com> 2 26 -
trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm
r168302 r171181 451 451 } 452 452 453 sub GetArrayOrSequenceType 454 { 455 my $object = shift; 456 my $type = shift; 457 458 return $object->GetArrayType($type) || $object->GetSequenceType($type); 459 } 460 453 461 sub AssertNotSequenceType 454 462 { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
r170708 r171181 969 969 foreach my $param (@{$function->parameters}) { 970 970 my $paramIDLType = $param->type; 971 my $arrayOrSequenceType = $codeGenerator->GetArrayOrSequenceType($paramIDLType); 972 $paramIDLType = $arrayOrSequenceType if $arrayOrSequenceType ne ""; 971 973 my $paramType = GetGlibTypeName($paramIDLType); 972 974 my $const = $paramType eq "gchar*" ? "const " : ""; … … 1012 1014 1013 1015 foreach my $param (@{$function->parameters}) { 1014 my $paramType = GetGlibTypeName($param->type); 1016 my $paramIDLType = $param->type; 1017 my $arrayOrSequenceType = $codeGenerator->GetArrayOrSequenceType($paramIDLType); 1018 $paramIDLType = $arrayOrSequenceType if $arrayOrSequenceType ne ""; 1019 my $paramType = GetGlibTypeName($paramIDLType); 1015 1020 # $paramType can have a trailing * in some cases 1016 1021 $paramType =~ s/\*$//; -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
r170567 r171181 1493 1493 } 1494 1494 1495 WebKitDOMbool* webkit_dom_test_obj_strict_function_with_array(WebKitDOMTestObj* self, WebKitDOMTestObj* objArg, glong array, GError** error) 1496 { 1497 WebCore::JSMainThreadNullState state; 1498 g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0); 1499 g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(objArg), 0); 1500 g_return_val_if_fail(WEBKIT_DOM_IS_LONG[](array), 0); 1501 g_return_val_if_fail(!error || !*error, 0); 1502 WebCore::TestObj* item = WebKit::core(self); 1503 WebCore::TestObj* convertedObjArg = WebKit::core(objArg); 1504 WebCore::long[]* convertedArray = WebKit::core(array); 1505 WebCore::ExceptionCode ec = 0; 1506 RefPtr<WebCore::bool> gobjectResult = WTF::getPtr(item->strictFunctionWithArray(convertedObjArg, array, ec)); 1507 if (ec) { 1508 WebCore::ExceptionCodeDescription ecdesc(ec); 1509 g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name); 1510 } 1511 return WebKit::kit(gobjectResult.get()); 1512 } 1513 1495 1514 void webkit_dom_test_obj_variadic_string_method(WebKitDOMTestObj* self, const gchar* head, const gchar* tail) 1496 1515 { -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
r170475 r171181 594 594 595 595 /** 596 * webkit_dom_test_obj_strict_function_with_array: 597 * @self: A #WebKitDOMTestObj 598 * @objArg: A #WebKitDOMTestObj 599 * @array: A #glong 600 * @error: #GError 601 * 602 * Returns: (transfer none): A #WebKitDOMbool 603 * 604 * Stability: Unstable 605 **/ 606 WEBKIT_API WebKitDOMbool* 607 webkit_dom_test_obj_strict_function_with_array(WebKitDOMTestObj* self, WebKitDOMTestObj* objArg, glong array, GError** error); 608 609 /** 596 610 * webkit_dom_test_obj_variadic_string_method: 597 611 * @self: A #WebKitDOMTestObj -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp
r170567 r171181 27 27 #include "ExceptionCode.h" 28 28 #include "JSMainThreadExecState.h" 29 #include "WebKitDOMDOMString[]Private.h"30 29 #include "WebKitDOMPrivate.h" 31 30 #include "WebKitDOMSVGPointPrivate.h" 32 31 #include "WebKitDOMSerializedScriptValuePrivate.h" 33 32 #include "WebKitDOMTestTypedefsPrivate.h" 34 #include "WebKitDOMlong[]Private.h"35 33 #include "gobject/ConvertToUTF8String.h" 36 34 #include <wtf/GetPtr.h> … … 234 232 } 235 233 236 void webkit_dom_test_typedefs_func(WebKitDOMTestTypedefs* self, WebKitDOMlong[]*x)234 void webkit_dom_test_typedefs_func(WebKitDOMTestTypedefs* self, glong x) 237 235 { 238 236 WebCore::JSMainThreadNullState state; … … 241 239 WebCore::TestTypedefs* item = WebKit::core(self); 242 240 WebCore::long[]* convertedX = WebKit::core(x); 243 item->func( convertedX);241 item->func(x); 244 242 } 245 243 … … 254 252 } 255 253 256 void webkit_dom_test_typedefs_nullable_array_arg(WebKitDOMTestTypedefs* self, WebKitDOMDOMString[]* arrayArg)254 void webkit_dom_test_typedefs_nullable_array_arg(WebKitDOMTestTypedefs* self, const gchar* arrayArg) 257 255 { 258 256 WebCore::JSMainThreadNullState state; -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h
r170422 r171181 51 51 * webkit_dom_test_typedefs_func: 52 52 * @self: A #WebKitDOMTestTypedefs 53 * @x: A # WebKitDOMlong[]54 * 55 * Stability: Unstable 56 **/ 57 WEBKIT_API void 58 webkit_dom_test_typedefs_func(WebKitDOMTestTypedefs* self, WebKitDOMlong[]*x);53 * @x: A #glong 54 * 55 * Stability: Unstable 56 **/ 57 WEBKIT_API void 58 webkit_dom_test_typedefs_func(WebKitDOMTestTypedefs* self, glong x); 59 59 60 60 /** … … 75 75 * webkit_dom_test_typedefs_nullable_array_arg: 76 76 * @self: A #WebKitDOMTestTypedefs 77 * @arrayArg: A # WebKitDOMDOMString[]78 * 79 * Stability: Unstable 80 **/ 81 WEBKIT_API void 82 webkit_dom_test_typedefs_nullable_array_arg(WebKitDOMTestTypedefs* self, WebKitDOMDOMString[]* arrayArg);77 * @arrayArg: A #gchar 78 * 79 * Stability: Unstable 80 **/ 81 WEBKIT_API void 82 webkit_dom_test_typedefs_nullable_array_arg(WebKitDOMTestTypedefs* self, const gchar* arrayArg); 83 83 84 84 /** -
trunk/Source/WebCore/bindings/scripts/test/TestObj.idl
r170015 r171181 232 232 [StrictTypeChecking, RaisesException] bool strictFunction(DOMString str, unrestricted float a, long b); 233 233 234 #if defined(TESTING_JS)235 234 [StrictTypeChecking, RaisesException] bool strictFunctionWithSequence(TestObj objArg, sequence<unsigned long> a); 236 235 [StrictTypeChecking, RaisesException] bool strictFunctionWithArray(TestObj objArg, long[] array); 237 #endif238 236 239 237 // ObjectiveC reserved words.
Note: See TracChangeset
for help on using the changeset viewer.