⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 117795 in webkit


Ignore:
Timestamp:
May 21, 2012, 9:43:24 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Christophe Dumez <Christophe Dumez> 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):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r117624 r117795  
    25102510IF (ENABLE_WEB_INTENTS)
    25112511    LIST(APPEND WebCore_IDL_FILES
     2512        Modules/intents/DeliveredIntent.idl
    25122513        Modules/intents/DOMWindowIntents.idl
    25132514        Modules/intents/Intent.idl
     
    25162517    )
    25172518    LIST(APPEND WebCore_SOURCES
     2519       Modules/intents/DeliveredIntent.cpp
    25182520       Modules/intents/DOMWindowIntents.cpp
    25192521       Modules/intents/Intent.cpp
  • trunk/Source/WebCore/ChangeLog

    r117794 r117795  
     12012-05-21  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        Add support for MessagePortArray type to JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=84093
     5
     6        Reviewed by Adam Barth.
     7
     8        Add support for MessagePortArray type to JSC code generator similarly
     9        to what was done for the V8 generator in r114319.
     10
     11        Update bindings test results to reflect to change to the bindings
     12        generator.
     13
     14        * CMakeLists.txt: Add new DeliveredIntent files to CMake.
     15        * bindings/js/JSDOMBinding.h:
     16        (WebCore):
     17        (WebCore::jsArray): Tweak jsArray() so that it accepts MessagePortArray as argument.
     18        * bindings/scripts/CodeGeneratorJS.pm:
     19        (JSValueToNative):
     20        (NativeToJSValue):
     21        * bindings/scripts/test/JS/JSTestObj.cpp:
     22        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
     23        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
     24        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
     25        (WebCore::jsTestSerializedScriptValueInterfacePorts):
     26        (WebCore::setJSTestSerializedScriptValueInterfaceValue):
     27        (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
     28        (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
     29        (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionMultiTransferList):
     30
    1312012-05-21  Alexander Pavlov  <apavlov@chromium.org>
    232
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r116828 r117795  
    282282    }
    283283
    284     template <typename T>
    285     JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T>& iterator)
     284    template <typename T, size_t inlineCapacity>
     285    JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T, inlineCapacity>& iterator)
    286286    {
    287287        JSC::MarkedArgumentBuffer list;
    288         typename Vector<T>::const_iterator end = iterator.end();
    289 
    290         for (typename Vector<T>::const_iterator iter = iterator.begin(); iter != end; ++iter)
     288        typename Vector<T, inlineCapacity>::const_iterator end = iterator.end();
     289
     290        for (typename Vector<T, inlineCapacity>::const_iterator iter = iterator.begin(); iter != end; ++iter)
    291291            list.append(toJS(exec, globalObject, WTF::getPtr(*iter)));
    292292
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r117646 r117795  
    29462946    if ($type eq "SerializedScriptValue" or $type eq "any") {
    29472947        AddToImplIncludes("SerializedScriptValue.h", $conditional);
    2948         return "SerializedScriptValue::create(exec, $value)";
     2948        return "SerializedScriptValue::create(exec, $value, 0, 0)";
    29492949    }
    29502950
     
    30643064    } elsif ($type eq "unsigned long[]") {
    30653065        AddToImplIncludes("<wrt/Vector.h>", $conditional);
     3066    } elsif ($type eq "MessagePortArray") {
     3067        AddToImplIncludes("MessagePort.h", $conditional);
     3068        AddToImplIncludes("JSMessagePort.h", $conditional);
     3069        AddToImplIncludes("<runtime/JSArray.h>", $conditional);
     3070        return "jsArray(exec, $globalObject, *$value)";
    30663071    } else {
    30673072        # Default, include header with same name.
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r117719 r117795  
    17901790    if (exec->argumentCount() < 1)
    17911791        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    1792     RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
     1792    RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
    17931793    if (exec->hadException())
    17941794        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp

    r117719 r117795  
    2828#include "JSArray.h"
    2929#include "JSDOMBinding.h"
    30 #include "JSMessagePortArray.h"
    31 #include "MessagePortArray.h"
     30#include "JSMessagePort.h"
     31#include "MessagePort.h"
    3232#include "SerializedScriptValue.h"
    3333#include "TestSerializedScriptValueInterface.h"
    3434#include <runtime/Error.h>
     35#include <runtime/JSArray.h>
    3536#include <wtf/GetPtr.h>
    3637
     
    9596    if (exec->hadException())
    9697        return JSValue::encode(jsUndefined());
    97     RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
     98    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined), 0, 0));
    9899    if (exec->hadException())
    99100        return JSValue::encode(jsUndefined());
     
    222223    UNUSED_PARAM(exec);
    223224    TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
    224     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->ports()));
     225    JSValue result = jsArray(exec, castedThis->globalObject(), *impl->ports());
    225226    return result;
    226227}
     
    258259    JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
    259260    TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
    260     impl->setValue(SerializedScriptValue::create(exec, value));
     261    impl->setValue(SerializedScriptValue::create(exec, value, 0, 0));
    261262}
    262263
     
    267268    JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
    268269    TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
    269     impl->setCachedValue(SerializedScriptValue::create(exec, value));
     270    impl->setCachedValue(SerializedScriptValue::create(exec, value, 0, 0));
    270271}
    271272
     
    286287    if (exec->argumentCount() < 1)
    287288        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    288     RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
     289    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
    289290    if (exec->hadException())
    290291        return JSValue::encode(jsUndefined());
     
    318319    }
    319320
    320     RefPtr<SerializedScriptValue> first(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
     321    RefPtr<SerializedScriptValue> first(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined), 0, 0));
    321322    if (exec->hadException())
    322323        return JSValue::encode(jsUndefined());
     
    334335    }
    335336
    336     RefPtr<SerializedScriptValue> second(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
     337    RefPtr<SerializedScriptValue> second(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined), 0, 0));
    337338    if (exec->hadException())
    338339        return JSValue::encode(jsUndefined());
Note: See TracChangeset for help on using the changeset viewer.