Title: [117795] trunk/Source/WebCore
Revision
117795
Author
[email protected]
Date
2012-05-21 09:43:24 -0700 (Mon, 21 May 2012)

Log Message

Add support for MessagePortArray type to JSC
https://bugs.webkit.org/show_bug.cgi?id=84093

Patch by Christophe Dumez <[email protected]> on 2012-05-21
Reviewed by Adam Barth.

Add support for MessagePortArray type to JSC code generator similarly
to what was done for the V8 generator in r114319.

Update bindings test results to reflect to change to the bindings
generator.

* CMakeLists.txt: Add new DeliveredIntent files to CMake.
* bindings/js/JSDOMBinding.h:
(WebCore):
(WebCore::jsArray): Tweak jsArray() so that it accepts MessagePortArray as argument.
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
(NativeToJSValue):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionSerializedValue):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
(WebCore::jsTestSerializedScriptValueInterfacePorts):
(WebCore::setJSTestSerializedScriptValueInterfaceValue):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList):

Modified Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (117794 => 117795)


--- trunk/Source/WebCore/CMakeLists.txt	2012-05-21 16:36:10 UTC (rev 117794)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-05-21 16:43:24 UTC (rev 117795)
@@ -2509,12 +2509,14 @@
 
 IF (ENABLE_WEB_INTENTS)
     LIST(APPEND WebCore_IDL_FILES
+        Modules/intents/DeliveredIntent.idl
         Modules/intents/DOMWindowIntents.idl
         Modules/intents/Intent.idl
         Modules/intents/IntentResultCallback.idl
         Modules/intents/NavigatorIntents.idl
     )
     LIST(APPEND WebCore_SOURCES
+       Modules/intents/DeliveredIntent.cpp
        Modules/intents/DOMWindowIntents.cpp
        Modules/intents/Intent.cpp
        Modules/intents/IntentRequest.cpp

Modified: trunk/Source/WebCore/ChangeLog (117794 => 117795)


--- trunk/Source/WebCore/ChangeLog	2012-05-21 16:36:10 UTC (rev 117794)
+++ trunk/Source/WebCore/ChangeLog	2012-05-21 16:43:24 UTC (rev 117795)
@@ -1,3 +1,33 @@
+2012-05-21  Christophe Dumez  <[email protected]>
+
+        Add support for MessagePortArray type to JSC
+        https://bugs.webkit.org/show_bug.cgi?id=84093
+
+        Reviewed by Adam Barth.
+
+        Add support for MessagePortArray type to JSC code generator similarly
+        to what was done for the V8 generator in r114319.
+
+        Update bindings test results to reflect to change to the bindings
+        generator.
+
+        * CMakeLists.txt: Add new DeliveredIntent files to CMake.
+        * bindings/js/JSDOMBinding.h:
+        (WebCore):
+        (WebCore::jsArray): Tweak jsArray() so that it accepts MessagePortArray as argument.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (JSValueToNative):
+        (NativeToJSValue):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
+        (WebCore::jsTestSerializedScriptValueInterfacePorts):
+        (WebCore::setJSTestSerializedScriptValueInterfaceValue):
+        (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
+        (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
+        (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList):
+
 2012-05-21  Alexander Pavlov  <[email protected]>
 
         Web Inspector: [Styles] Cannot tab from selector of inherited rule, which in turn has leading inherited properties

Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (117794 => 117795)


--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2012-05-21 16:36:10 UTC (rev 117794)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2012-05-21 16:43:24 UTC (rev 117795)
@@ -281,13 +281,13 @@
         return toJS(exec, globalObject, ptr.get());
     }
 
-    template <typename T>
-    JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T>& iterator)
+    template <typename T, size_t inlineCapacity>
+    JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T, inlineCapacity>& iterator)
     {
         JSC::MarkedArgumentBuffer list;
-        typename Vector<T>::const_iterator end = iterator.end();
+        typename Vector<T, inlineCapacity>::const_iterator end = iterator.end();
 
-        for (typename Vector<T>::const_iterator iter = iterator.begin(); iter != end; ++iter)
+        for (typename Vector<T, inlineCapacity>::const_iterator iter = iterator.begin(); iter != end; ++iter)
             list.append(toJS(exec, globalObject, WTF::getPtr(*iter)));
 
         return JSC::constructArray(exec, globalObject, list);

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (117794 => 117795)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-05-21 16:36:10 UTC (rev 117794)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-05-21 16:43:24 UTC (rev 117795)
@@ -2945,7 +2945,7 @@
 
     if ($type eq "SerializedScriptValue" or $type eq "any") {
         AddToImplIncludes("SerializedScriptValue.h", $conditional);
-        return "SerializedScriptValue::create(exec, $value)";
+        return "SerializedScriptValue::create(exec, $value, 0, 0)";
     }
 
     if ($type eq "IDBKey") {
@@ -3063,6 +3063,11 @@
         return "$value ? $value->deserialize(exec, castedThis->globalObject(), 0) : jsNull()";
     } elsif ($type eq "unsigned long[]") {
         AddToImplIncludes("<wrt/Vector.h>", $conditional);
+    } elsif ($type eq "MessagePortArray") {
+        AddToImplIncludes("MessagePort.h", $conditional);
+        AddToImplIncludes("JSMessagePort.h", $conditional);
+        AddToImplIncludes("<runtime/JSArray.h>", $conditional);
+        return "jsArray(exec, $globalObject, *$value)";
     } else {
         # Default, include header with same name.
         AddToImplIncludes("JS$type.h", $conditional);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (117794 => 117795)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2012-05-21 16:36:10 UTC (rev 117794)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2012-05-21 16:43:24 UTC (rev 117795)
@@ -1789,7 +1789,7 @@
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
+    RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
     impl->serializedValue(serializedArg);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (117794 => 117795)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp	2012-05-21 16:36:10 UTC (rev 117794)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp	2012-05-21 16:43:24 UTC (rev 117795)
@@ -27,11 +27,12 @@
 #include "ExceptionCode.h"
 #include "JSArray.h"
 #include "JSDOMBinding.h"
-#include "JSMessagePortArray.h"
-#include "MessagePortArray.h"
+#include "JSMessagePort.h"
+#include "MessagePort.h"
 #include "SerializedScriptValue.h"
 #include "TestSerializedScriptValueInterface.h"
 #include <runtime/Error.h>
+#include <runtime/JSArray.h>
 #include <wtf/GetPtr.h>
 
 using namespace JSC;
@@ -94,7 +95,7 @@
     const String& hello(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
-    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
+    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined), 0, 0));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
     Array* transferList(toArray(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
@@ -221,7 +222,7 @@
     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->ports()));
+    JSValue result = jsArray(exec, castedThis->globalObject(), *impl->ports());
     return result;
 }
 
@@ -257,7 +258,7 @@
     UNUSED_PARAM(exec);
     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
-    impl->setValue(SerializedScriptValue::create(exec, value));
+    impl->setValue(SerializedScriptValue::create(exec, value, 0, 0));
 }
 
 
@@ -266,7 +267,7 @@
     UNUSED_PARAM(exec);
     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
-    impl->setCachedValue(SerializedScriptValue::create(exec, value));
+    impl->setCachedValue(SerializedScriptValue::create(exec, value, 0, 0));
 }
 
 
@@ -285,7 +286,7 @@
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
+    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 
@@ -317,7 +318,7 @@
         return JSValue::encode(jsUndefined());
     }
 
-    RefPtr<SerializedScriptValue> first(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
+    RefPtr<SerializedScriptValue> first(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
     if (argsCount <= 1) {
@@ -333,7 +334,7 @@
         return JSValue::encode(jsUndefined());
     }
 
-    RefPtr<SerializedScriptValue> second(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
+    RefPtr<SerializedScriptValue> second(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined), 0, 0));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
     if (argsCount <= 3) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to