Title: [101301] trunk/Source/WebCore

Diff

Modified: trunk/Source/WebCore/ChangeLog (101300 => 101301)


--- trunk/Source/WebCore/ChangeLog	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/ChangeLog	2011-11-29 00:21:09 UTC (rev 101301)
@@ -1,3 +1,25 @@
+2011-11-28  Oliver Hunt  <oli...@apple.com>
+
+        Fix V8 bindings codegen and add yet more tests for the typed
+        array bindings.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (AddIncludesForType):
+        * bindings/scripts/test/CPP/WebDOMFloat64Array.cpp:
+        (WebDOMFloat64Array::foo):
+        * bindings/scripts/test/CPP/WebDOMFloat64Array.h:
+        * bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp:
+        (webkit_dom_float64array_foo):
+        * bindings/scripts/test/GObject/WebKitDOMFloat64Array.h:
+        * bindings/scripts/test/JS/JSFloat64Array.cpp:
+        (WebCore::jsFloat64ArrayPrototypeFunctionFoo):
+        * bindings/scripts/test/ObjC/DOMFloat64Array.h:
+        * bindings/scripts/test/ObjC/DOMFloat64Array.mm:
+        (-[DOMFloat64Array foo:]):
+        * bindings/scripts/test/TestTypedArray.idl:
+        * bindings/scripts/test/V8/V8Float64Array.cpp:
+        (WebCore::Float64ArrayInternal::fooCallback):
+
 2011-11-28  Dana Jansens  <dan...@chromium.org>
 
         FloatQuad::isRectilinear() returns false for 180degree rotations

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2011-11-29 00:21:09 UTC (rev 101301)
@@ -156,7 +156,6 @@
     # reorganization, we won't need these special cases.
     if (IsTypedArrayType($type)) {
         AddToImplIncludes("wtf/${type}.h");
-        return;
     }
     if (!$codeGenerator->IsPrimitiveType($type) and !$codeGenerator->IsStringType($type) and !$codeGenerator->AvoidInclusionOfType($type) and $type ne "Date") {
         # default, include the same named file

Modified: trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMFloat64Array.cpp (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMFloat64Array.cpp	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMFloat64Array.cpp	2011-11-29 00:21:09 UTC (rev 101301)
@@ -23,7 +23,9 @@
 
 #include "Float32Array.h"
 #include "Float64Array.h"
+#include "Int32Array.h"
 #include "WebDOMFloat32Array.h"
+#include "WebDOMInt32Array.h"
 #include "WebExceptionHandler.h"
 #include <wtf/GetPtr.h>
 #include <wtf/RefPtr.h>
@@ -43,12 +45,12 @@
     return static_cast<WTF::Float64Array*>(WebDOMArrayBufferView::impl());
 }
 
-void WebDOMFloat64Array::foo(const WebDOMFloat32Array& array)
+WebDOMInt32Array WebDOMFloat64Array::foo(const WebDOMFloat32Array& array)
 {
     if (!impl())
-        return;
+        return WebDOMInt32Array();
 
-    impl()->foo(toWebCore(array));
+    return toWebKit(WTF::getPtr(impl()->foo(toWebCore(array))));
 }
 
 WTF::Float64Array* toWebCore(const WebDOMFloat64Array& wrapper)

Modified: trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMFloat64Array.h (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMFloat64Array.h	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMFloat64Array.h	2011-11-29 00:21:09 UTC (rev 101301)
@@ -31,6 +31,7 @@
 };
 
 class WebDOMFloat32Array;
+class WebDOMInt32Array;
 
 class WebDOMFloat64Array : public WebDOMArrayBufferView {
 public:
@@ -38,7 +39,7 @@
     explicit WebDOMFloat64Array(WTF::Float64Array*);
     virtual ~WebDOMFloat64Array() { }
 
-    void foo(const WebDOMFloat32Array& array);
+    WebDOMInt32Array foo(const WebDOMFloat32Array& array);
 
     WTF::Float64Array* impl() const;
 };

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp	2011-11-29 00:21:09 UTC (rev 101301)
@@ -26,6 +26,7 @@
 #include "DOMObjectCache.h"
 #include "ExceptionCode.h"
 #include "Float64Array.h"
+#include "Int32Array.h"
 #include "JSMainThreadExecState.h"
 #include "WebKitDOMBinding.h"
 #include "gobject/ConvertToUTF8String.h"
@@ -33,6 +34,8 @@
 #include "webkit/WebKitDOMFloat32ArrayPrivate.h"
 #include "webkit/WebKitDOMFloat64Array.h"
 #include "webkit/WebKitDOMFloat64ArrayPrivate.h"
+#include "webkit/WebKitDOMInt32Array.h"
+#include "webkit/WebKitDOMInt32ArrayPrivate.h"
 #include "webkitdefines.h"
 #include "webkitglobalsprivate.h"
 #include "webkitmarshal.h"
@@ -51,19 +54,21 @@
     
 } // namespace WebKit //
 
-void
+WebKitDOMInt32Array*
 webkit_dom_float64array_foo(WebKitDOMFloat64Array* self, WebKitDOMFloat32Array* array)
 {
-    g_return_if_fail(self);
+    g_return_val_if_fail(self, 0);
     WebCore::JSMainThreadNullState state;
     WebCore::Float64Array * item = WebKit::core(self);
-    g_return_if_fail(array);
+    g_return_val_if_fail(array, 0);
     WebCore::Float32Array * converted_array = NULL;
     if (array != NULL) {
         converted_array = WebKit::core(array);
-        g_return_if_fail(converted_array);
+        g_return_val_if_fail(converted_array, 0);
     }
-    item->foo(converted_array);
+    PassRefPtr<WebCore::Int32Array> g_res = WTF::getPtr(item->foo(converted_array));
+    WebKitDOMInt32Array* res = WebKit::kit(g_res.get());
+    return res;
 }
 
 

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMFloat64Array.h (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMFloat64Array.h	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMFloat64Array.h	2011-11-29 00:21:09 UTC (rev 101301)
@@ -51,10 +51,10 @@
  * @self: A #WebKitDOMFloat64Array
  * @array: A #WebKitDOMFloat32Array
  *
- * Returns:
+ * Returns: (transfer none):
  *
 **/
-WEBKIT_API void
+WEBKIT_API WebKitDOMInt32Array*
 webkit_dom_float64array_foo(WebKitDOMFloat64Array* self, WebKitDOMFloat32Array* array);
 
 G_END_DECLS

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp	2011-11-29 00:21:09 UTC (rev 101301)
@@ -24,10 +24,12 @@
 #include "ExceptionCode.h"
 #include "JSDOMBinding.h"
 #include "JSFloat32Array.h"
+#include "JSInt32Array.h"
 #include <runtime/Error.h>
 #include <runtime/PropertyNameArray.h>
 #include <wtf/Float64Array.h>
 #include <wtf/GetPtr.h>
+#include <wtf/Int32Array.h>
 
 using namespace JSC;
 
@@ -262,8 +264,9 @@
     Float32Array* array(toFloat32Array(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
-    imp->foo(array);
-    return JSValue::encode(jsUndefined());
+
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->foo(array)));
+    return JSValue::encode(result);
 }
 
 

Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMFloat64Array.h (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMFloat64Array.h	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMFloat64Array.h	2011-11-29 00:21:09 UTC (rev 101301)
@@ -29,9 +29,10 @@
 #if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
 
 @class DOMFloat32Array;
+@class DOMInt32Array;
 
 @interface DOMFloat64Array : DOMArrayBufferView
-- (void)foo:(DOMFloat32Array *)array;
+- (DOMInt32Array *)foo:(DOMFloat32Array *)array;
 @end
 
 #endif

Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMFloat64Array.mm (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMFloat64Array.mm	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMFloat64Array.mm	2011-11-29 00:21:09 UTC (rev 101301)
@@ -35,11 +35,13 @@
 #import "DOMEventInternal.h"
 #import "DOMFloat32ArrayInternal.h"
 #import "DOMFloat64ArrayInternal.h"
+#import "DOMInt32ArrayInternal.h"
 #import "DOMNodeInternal.h"
 #import "DOMStyleSheetInternal.h"
 #import "ExceptionHandlers.h"
 #import "Float32Array.h"
 #import "Float64Array.h"
+#import "Int32Array.h"
 #import "JSMainThreadExecState.h"
 #import "ThreadCheck.h"
 #import "WebScriptObjectPrivate.h"
@@ -49,10 +51,10 @@
 
 @implementation DOMFloat64Array
 
-- (void)foo:(DOMFloat32Array *)array
+- (DOMInt32Array *)foo:(DOMFloat32Array *)array
 {
     WebCore::JSMainThreadNullState state;
-    IMPL->foo(core(array));
+    return kit(WTF::getPtr(IMPL->foo(core(array))));
 }
 
 @end

Modified: trunk/Source/WebCore/bindings/scripts/test/TestTypedArray.idl (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/TestTypedArray.idl	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/TestTypedArray.idl	2011-11-29 00:21:09 UTC (rev 101301)
@@ -34,6 +34,6 @@
         CustomToJS,
         DontCheckEnums
     ] Float64Array : ArrayBufferView {
-        void foo(in Float32Array array);
+        Int32Array foo(in Float32Array array);
     };
 }

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp (101300 => 101301)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp	2011-11-29 00:16:58 UTC (rev 101300)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp	2011-11-29 00:21:09 UTC (rev 101301)
@@ -29,10 +29,15 @@
 #include "V8BindingState.h"
 #include "V8DOMWrapper.h"
 #include "V8Float32Array.h"
+#include "V8Int32Array.h"
 #include "V8IsolatedContext.h"
 #include "V8Proxy.h"
 #include <wtf/Float32Array.h>
 #include <wtf/Float64Array.h>
+#include <wtf/GetPtr.h>
+#include <wtf/Int32Array.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 #include <wtf/UnusedParam.h>
 
 namespace WebCore {
@@ -50,8 +55,7 @@
         return throwError("Not enough arguments", V8Proxy::TypeError);
     Float64Array* imp = V8Float64Array::toNative(args.Holder());
     EXCEPTION_BLOCK(Float32Array*, array, V8Float32Array::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
-    imp->foo(array);
-    return v8::Handle<v8::Value>();
+    return toV8(imp->foo(array));
 }
 
 } // namespace Float64ArrayInternal
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to