Changeset 117795 in webkit
- Timestamp:
- May 21, 2012, 9:43:24 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
-
CMakeLists.txt (modified) (2 diffs)
-
ChangeLog (modified) (1 diff)
-
bindings/js/JSDOMBinding.h (modified) (1 diff)
-
bindings/scripts/CodeGeneratorJS.pm (modified) (2 diffs)
-
bindings/scripts/test/JS/JSTestObj.cpp (modified) (1 diff)
-
bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r117624 r117795 2510 2510 IF (ENABLE_WEB_INTENTS) 2511 2511 LIST(APPEND WebCore_IDL_FILES 2512 Modules/intents/DeliveredIntent.idl 2512 2513 Modules/intents/DOMWindowIntents.idl 2513 2514 Modules/intents/Intent.idl … … 2516 2517 ) 2517 2518 LIST(APPEND WebCore_SOURCES 2519 Modules/intents/DeliveredIntent.cpp 2518 2520 Modules/intents/DOMWindowIntents.cpp 2519 2521 Modules/intents/Intent.cpp -
trunk/Source/WebCore/ChangeLog
r117794 r117795 1 2012-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 1 31 2012-05-21 Alexander Pavlov <apavlov@chromium.org> 2 32 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r116828 r117795 282 282 } 283 283 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) 286 286 { 287 287 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) 291 291 list.append(toJS(exec, globalObject, WTF::getPtr(*iter))); 292 292 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r117646 r117795 2946 2946 if ($type eq "SerializedScriptValue" or $type eq "any") { 2947 2947 AddToImplIncludes("SerializedScriptValue.h", $conditional); 2948 return "SerializedScriptValue::create(exec, $value )";2948 return "SerializedScriptValue::create(exec, $value, 0, 0)"; 2949 2949 } 2950 2950 … … 3064 3064 } elsif ($type eq "unsigned long[]") { 3065 3065 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)"; 3066 3071 } else { 3067 3072 # Default, include header with same name. -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r117719 r117795 1790 1790 if (exec->argumentCount() < 1) 1791 1791 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)); 1793 1793 if (exec->hadException()) 1794 1794 return JSValue::encode(jsUndefined()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r117719 r117795 28 28 #include "JSArray.h" 29 29 #include "JSDOMBinding.h" 30 #include "JSMessagePort Array.h"31 #include "MessagePort Array.h"30 #include "JSMessagePort.h" 31 #include "MessagePort.h" 32 32 #include "SerializedScriptValue.h" 33 33 #include "TestSerializedScriptValueInterface.h" 34 34 #include <runtime/Error.h> 35 #include <runtime/JSArray.h> 35 36 #include <wtf/GetPtr.h> 36 37 … … 95 96 if (exec->hadException()) 96 97 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)); 98 99 if (exec->hadException()) 99 100 return JSValue::encode(jsUndefined()); … … 222 223 UNUSED_PARAM(exec); 223 224 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()); 225 226 return result; 226 227 } … … 258 259 JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject); 259 260 TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); 260 impl->setValue(SerializedScriptValue::create(exec, value ));261 impl->setValue(SerializedScriptValue::create(exec, value, 0, 0)); 261 262 } 262 263 … … 267 268 JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject); 268 269 TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); 269 impl->setCachedValue(SerializedScriptValue::create(exec, value ));270 impl->setCachedValue(SerializedScriptValue::create(exec, value, 0, 0)); 270 271 } 271 272 … … 286 287 if (exec->argumentCount() < 1) 287 288 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)); 289 290 if (exec->hadException()) 290 291 return JSValue::encode(jsUndefined()); … … 318 319 } 319 320 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)); 321 322 if (exec->hadException()) 322 323 return JSValue::encode(jsUndefined()); … … 334 335 } 335 336 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)); 337 338 if (exec->hadException()) 338 339 return JSValue::encode(jsUndefined());
Note:
See TracChangeset
for help on using the changeset viewer.