Changeset 126161 in webkit


Ignore:
Timestamp:
Aug 21, 2012 9:21:26 AM (12 years ago)
Author:
Csaba Osztrogonác
Message:

Unreviewed, rolling out r126146.
http://trac.webkit.org/changeset/126146
https://bugs.webkit.org/show_bug.cgi?id=94606

It made all tests assert (Requested by Ossy on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-21

Source/WebCore:

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::prototypeForSignalsAndSlots):
(JSC::Bindings::QtRuntimeMethod::call):
(JSC::Bindings::QtRuntimeMethod::jsObjectRef):
(JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):

  • bridge/qt/qt_runtime.h:

(QtRuntimeMethod):

Source/WebKit/qt:

  • tests/qobjectbridge/tst_qobjectbridge.cpp:

(tst_QObjectBridge::objectDeleted):
(tst_QObjectBridge::introspectQtMethods_data):
(tst_QObjectBridge::introspectQtMethods):

LayoutTests:

  • platform/qt/Skipped:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126160 r126161  
     12012-08-21  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r126146.
     4        http://trac.webkit.org/changeset/126146
     5        https://bugs.webkit.org/show_bug.cgi?id=94606
     6
     7        It made all tests assert (Requested by Ossy on #webkit).
     8
     9        * platform/qt/Skipped:
     10
    1112012-08-21  Brady Eidson  <beidson@apple.com>
    212
  • trunk/LayoutTests/platform/qt/Skipped

    r126149 r126161  
    27262726svg/custom/use-instanceRoot-as-event-target.xhtml
    27272727
     2728# https://bugs.webkit.org/show_bug.cgi?id=93897
     2729fast/profiler/nested-start-and-stop-profiler.html
     2730
    27282731# New test introduced in r125648 fast/events/autoscroll-in-textarea.html fails
    27292732# https://bugs.webkit.org/show_bug.cgi?id=94076
  • trunk/Source/WebCore/ChangeLog

    r126159 r126161  
     12012-08-21  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r126146.
     4        http://trac.webkit.org/changeset/126146
     5        https://bugs.webkit.org/show_bug.cgi?id=94606
     6
     7        It made all tests assert (Requested by Ossy on #webkit).
     8
     9        * bridge/qt/qt_runtime.cpp:
     10        (JSC::Bindings::prototypeForSignalsAndSlots):
     11        (JSC::Bindings::QtRuntimeMethod::call):
     12        (JSC::Bindings::QtRuntimeMethod::jsObjectRef):
     13        (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):
     14        * bridge/qt/qt_runtime.h:
     15        (QtRuntimeMethod):
     16
    1172012-08-21  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r126146 r126161  
    12831283{
    12841284    static JSClassDefinition classDef = {
    1285         0, kJSClassAttributeNoAutomaticPrototype, 0, 0, 0, 0,
    1286         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
     1285        0, 0, 0, 0, 0, 0,
     1286        0, 0, 0, 0, 0, 0, 0, QtRuntimeMethod::call, 0, 0, 0
    12871287    };
    12881288    static JSClassRef cls = JSClassCreate(&classDef);
     
    13081308JSValueRef QtRuntimeMethod::call(JSContextRef context, JSObjectRef function, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    13091309{
    1310     QtRuntimeMethod* d = toRuntimeMethod(context, function);
     1310    QtRuntimeMethod* d = reinterpret_cast<QtRuntimeMethod*>(JSObjectGetPrivate(function));
    13111311    if (!d) {
    13121312        setException(context, exception, QStringLiteral("cannot call function of deleted runtime method"));
     
    13541354        return cachedWrapper;
    13551355
     1356    static const JSClassDefinition classDefForConnect = {
     1357        0, 0, "connect", 0, 0, 0,
     1358        0, 0, 0, 0, 0, 0, 0, connect, 0, 0, 0
     1359    };
     1360
     1361    static const JSClassDefinition classDefForDisconnect = {
     1362        0, 0, "disconnect", 0, 0, 0,
     1363        0, 0, 0, 0, 0, 0, 0, disconnect, 0, 0, 0
     1364    };
     1365
     1366    static JSClassRef classRefConnect = JSClassCreate(&classDefForConnect);
     1367    static JSClassRef classRefDisconnect = JSClassCreate(&classDefForDisconnect);
     1368    bool isSignal = m_flags & MethodIsSignal;
     1369    JSObjectRef object = JSObjectMake(context, prototypeForSignalsAndSlots(), this);
     1370    JSObjectRef connectFunction = JSObjectMake(context, classRefConnect, this);
     1371    JSObjectRef disconnectFunction = JSObjectMake(context, classRefDisconnect, this);
     1372    JSPropertyAttributes attributes = kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete;
     1373
    13561374    static JSStringRef connectStr = JSStringCreateWithUTF8CString("connect");
    13571375    static JSStringRef disconnectStr = JSStringCreateWithUTF8CString("disconnect");
     1376    static JSStringRef lengthStr = JSStringCreateWithUTF8CString("length");
     1377    static JSStringRef nameStr = JSStringCreateWithUTF8CString("name");
    13581378    JSRetainPtr<JSStringRef> actualNameStr(Adopt, JSStringCreateWithUTF8CString(m_identifier.constData()));
    13591379
    1360     JSObjectRef object = JSObjectMakeFunctionWithCallback(context, actualNameStr.get(), call);
    1361 
    1362     JSObjectRef generalFunctionProto = JSValueToObject(context, JSObjectGetPrototype(context, object), 0);
    1363     JSObjectRef runtimeMethodProto = JSObjectMake(context, prototypeForSignalsAndSlots(), this);
    1364     JSObjectSetPrototype(context, runtimeMethodProto, generalFunctionProto);
    1365 
    1366     JSObjectSetPrototype(context, object, runtimeMethodProto);
    1367 
    1368     JSObjectRef connectFunction = JSObjectMakeFunctionWithCallback(context, connectStr, connect);
    1369     JSObjectSetPrototype(context, connectFunction, runtimeMethodProto);
    1370 
    1371     JSObjectRef disconnectFunction = JSObjectMakeFunctionWithCallback(context, disconnectStr, disconnect);
    1372     JSObjectSetPrototype(context, disconnectFunction, runtimeMethodProto);
    1373 
    1374     const JSPropertyAttributes attributes = kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete;
     1380    JSObjectSetProperty(context, connectFunction, lengthStr, JSValueMakeNumber(context, isSignal ? 1 : 0), attributes, exception);
     1381    JSObjectSetProperty(context, connectFunction, nameStr, JSValueMakeString(context, connectStr), attributes, exception);
     1382    JSObjectSetProperty(context, disconnectFunction, lengthStr, JSValueMakeNumber(context, isSignal ? 1 : 0), attributes, exception);
     1383    JSObjectSetProperty(context, disconnectFunction, nameStr, JSValueMakeString(context, disconnectStr), attributes, exception);
     1384
    13751385    JSObjectSetProperty(context, object, connectStr, connectFunction, attributes, exception);
    13761386    JSObjectSetProperty(context, object, disconnectStr, disconnectFunction, attributes, exception);
     1387    JSObjectSetProperty(context, object, lengthStr, JSValueMakeNumber(context, 0), attributes, exception);
     1388    JSObjectSetProperty(context, object, nameStr, JSValueMakeString(context, actualNameStr.get()), attributes, exception);
    13771389
    13781390    m_instance->m_cachedMethods.set(context, this, object);
     
    13811393}
    13821394
    1383 QtRuntimeMethod* QtRuntimeMethod::toRuntimeMethod(JSContextRef context, JSObjectRef object)
    1384 {
    1385     JSObjectRef proto = JSValueToObject(context, JSObjectGetPrototype(context, object), 0);
    1386     if (!proto)
    1387         return 0;
    1388     if (!JSValueIsObjectOfClass(context, proto, prototypeForSignalsAndSlots()))
    1389         return 0;
    1390     return static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(proto));
    1391 }
    1392 
    13931395JSValueRef QtRuntimeMethod::connectOrDisconnect(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception, bool connect)
    13941396{
    1395     QtRuntimeMethod* d = toRuntimeMethod(context, thisObject);
     1397    QtRuntimeMethod* d = static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(thisObject));
    13961398    if (!d)
    1397         d = toRuntimeMethod(context, function);
    1398     if (!d) {
    1399         QString errorStr = QStringLiteral("QtMetaMethod.%1: Cannot connect to/from deleted QObject").arg(connect ?  QStringLiteral("connect") : QStringLiteral("disconnect"));
    1400         setException(context, exception, errorStr);
    1401         return JSValueMakeUndefined(context);
    1402     }
     1399        d = static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(function));
    14031400
    14041401    QString functionName = connect ? QStringLiteral("connect") : QStringLiteral("disconnect");
     
    14361433        // object.signal.connect(someFunction);
    14371434        if (JSObjectIsFunction(context, targetFunction)) {
    1438             // object.signal.connect(otherObject.slot);
    1439             if (QtRuntimeMethod* targetMethod = toRuntimeMethod(context, targetFunction))
    1440                 targetObject = toRef(QtInstance::getQtInstance(targetMethod->m_object.data(), d->m_instance->rootObject(), QtInstance::QtOwnership)->createRuntimeObject(toJS(context)));
     1435            if (JSValueIsObjectOfClass(context, targetFunction, prototypeForSignalsAndSlots())) {
     1436                // object.signal.connect(otherObject.slot);
     1437                if (QtRuntimeMethod* targetMethod = static_cast<QtRuntimeMethod*>(JSObjectGetPrivate(targetFunction)))
     1438                    targetObject = toRef(QtInstance::getQtInstance(targetMethod->m_object.data(), d->m_instance->rootObject(), QtInstance::QtOwnership)->createRuntimeObject(toJS(context)));
     1439            }
    14411440        } else
    14421441            targetFunction = 0;
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r126146 r126161  
    115115
    116116private:
    117     static QtRuntimeMethod* toRuntimeMethod(JSContextRef, JSObjectRef);
     117    static const JSStaticFunction connectFunction;
     118    static const JSStaticFunction disconnectFunction;
    118119
    119120    static JSValueRef connectOrDisconnect(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception, bool connect);
  • trunk/Source/WebKit/qt/ChangeLog

    r126146 r126161  
     12012-08-21  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r126146.
     4        http://trac.webkit.org/changeset/126146
     5        https://bugs.webkit.org/show_bug.cgi?id=94606
     6
     7        It made all tests assert (Requested by Ossy on #webkit).
     8
     9        * tests/qobjectbridge/tst_qobjectbridge.cpp:
     10        (tst_QObjectBridge::objectDeleted):
     11        (tst_QObjectBridge::introspectQtMethods_data):
     12        (tst_QObjectBridge::introspectQtMethods):
     13
    1142012-08-17  Simon Hausmann  <simon.hausmann@nokia.com>
    215
  • trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp

    r126146 r126161  
    18801880    QCOMPARE(qobj->intProperty(), 123);
    18811881    qobj->resetQtFunctionInvoked();
    1882     evalJS("bar.myInvokable.call(bar);");
     1882    evalJS("bar.myInvokable(bar);");
    18831883    QCOMPARE(qobj->qtFunctionInvoked(), 0);
    18841884
     
    21492149
    21502150    QTest::newRow("myObject.mySignal")
    2151         << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "name");
     2151        << "myObject" << "mySignal" << (QStringList() << "connect" << "disconnect" << "length" << "name");
    21522152    QTest::newRow("myObject.mySlot")
    2153         << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "name");
     2153        << "myObject" << "mySlot" << (QStringList() << "connect" << "disconnect" << "length" << "name");
    21542154    QTest::newRow("myObject.myInvokable")
    2155         << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "name");
     2155        << "myObject" << "myInvokable" << (QStringList() << "connect" << "disconnect" << "length" << "name");
    21562156    QTest::newRow("myObject.mySignal.connect")
    2157         << "myObject.mySignal" << "connect" << (QStringList() << "name");
     2157        << "myObject.mySignal" << "connect" << (QStringList() << "length" << "name");
    21582158    QTest::newRow("myObject.mySignal.disconnect")
    2159         << "myObject.mySignal" << "disconnect" << (QStringList() << "name");
     2159        << "myObject.mySignal" << "disconnect" << (QStringList() << "length" << "name");
    21602160}
    21612161
     
    21782178        QCOMPARE(evalJS(QString::fromLatin1("descriptor.value === %0['%1']").arg(methodLookup).arg(name)), sTrue);
    21792179        QCOMPARE(evalJS(QString::fromLatin1("descriptor.enumerable")), sFalse);
    2180         QCOMPARE(evalJS(QString::fromLatin1("descriptor.configurable")), sFalse);
     2180        QCOMPARE(evalJS(QString::fromLatin1("descriptor.configurable")), sTrue);
    21812181    }
    21822182
Note: See TracChangeset for help on using the changeset viewer.