summaryrefslogtreecommitdiffstats
path: root/WebCore/bridge/qt
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
committerFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
commit5f1ab04193ad0130ca8204aadaceae083aca9881 (patch)
tree5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/bridge/qt
parent194315e5a908cc8ed67d597010544803eef1ac59 (diff)
downloadexternal_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2
Get WebKit r44544.
Diffstat (limited to 'WebCore/bridge/qt')
-rw-r--r--WebCore/bridge/qt/qt_class.cpp2
-rw-r--r--WebCore/bridge/qt/qt_class.h2
-rw-r--r--WebCore/bridge/qt/qt_instance.cpp26
-rw-r--r--WebCore/bridge/qt/qt_instance.h16
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp71
-rw-r--r--WebCore/bridge/qt/qt_runtime.h29
6 files changed, 75 insertions, 71 deletions
diff --git a/WebCore/bridge/qt/qt_class.cpp b/WebCore/bridge/qt/qt_class.cpp
index 3aa218c..c39b3af 100644
--- a/WebCore/bridge/qt/qt_class.cpp
+++ b/WebCore/bridge/qt/qt_class.cpp
@@ -66,7 +66,7 @@ const char* QtClass::name() const
// and not get wrapped in RuntimeMethod). Also, use this for methods,
// so we can cache the object and return the same object for the same
// identifier.
-JSValuePtr QtClass::fallbackObject(ExecState* exec, Instance* inst, const Identifier& identifier)
+JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, const Identifier& identifier)
{
QtInstance* qtinst = static_cast<QtInstance*>(inst);
diff --git a/WebCore/bridge/qt/qt_class.h b/WebCore/bridge/qt/qt_class.h
index c83bb0f..19d4207 100644
--- a/WebCore/bridge/qt/qt_class.h
+++ b/WebCore/bridge/qt/qt_class.h
@@ -45,7 +45,7 @@ public:
virtual MethodList methodsNamed(const Identifier&, Instance*) const;
virtual Field* fieldNamed(const Identifier&, Instance*) const;
- virtual JSValuePtr fallbackObject(ExecState*, Instance*, const Identifier&);
+ virtual JSValue fallbackObject(ExecState*, Instance*, const Identifier&);
private:
QtClass(const QtClass&); // prohibit copying
diff --git a/WebCore/bridge/qt/qt_instance.cpp b/WebCore/bridge/qt/qt_instance.cpp
index d2a9cc6..60cf16f 100644
--- a/WebCore/bridge/qt/qt_instance.cpp
+++ b/WebCore/bridge/qt/qt_instance.cpp
@@ -158,7 +158,7 @@ bool QtInstance::getOwnPropertySlot(JSObject* object, ExecState* exec, const Ide
return object->JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void QtInstance::put(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
+void QtInstance::put(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
object->JSObject::put(exec, propertyName, value, slot);
}
@@ -199,7 +199,7 @@ void QtInstance::mark()
if (val && !val->marked())
val->mark();
}
- foreach(JSValuePtr val, m_children.values()) {
+ foreach(JSValue val, m_children.values()) {
if (val && !val.marked())
val.mark();
}
@@ -247,14 +247,14 @@ void QtInstance::getPropertyNames(ExecState* exec, PropertyNameArray& array)
}
}
-JSValuePtr QtInstance::invokeMethod(ExecState*, const MethodList&, const ArgList&)
+JSValue QtInstance::invokeMethod(ExecState*, const MethodList&, const ArgList&)
{
// Implemented via fallbackMethod & QtRuntimeMetaMethod::callAsFunction
return jsUndefined();
}
-JSValuePtr QtInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
+JSValue QtInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
{
if (hint == PreferString)
return stringValue(exec);
@@ -263,7 +263,7 @@ JSValuePtr QtInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint
return valueOf(exec);
}
-JSValuePtr QtInstance::stringValue(ExecState* exec) const
+JSValue QtInstance::stringValue(ExecState* exec) const
{
// Hmm.. see if there is a toString defined
QByteArray buf;
@@ -307,25 +307,25 @@ JSValuePtr QtInstance::stringValue(ExecState* exec) const
return jsString(exec, buf.constData());
}
-JSValuePtr QtInstance::numberValue(ExecState* exec) const
+JSValue QtInstance::numberValue(ExecState* exec) const
{
return jsNumber(exec, 0);
}
-JSValuePtr QtInstance::booleanValue() const
+JSValue QtInstance::booleanValue() const
{
// ECMA 9.2
return jsBoolean(true);
}
-JSValuePtr QtInstance::valueOf(ExecState* exec) const
+JSValue QtInstance::valueOf(ExecState* exec) const
{
return stringValue(exec);
}
// In qt_runtime.cpp
-JSValuePtr convertQVariantToValue(ExecState*, PassRefPtr<RootObject> root, const QVariant& variant);
-QVariant convertValueToQVariant(ExecState*, JSValuePtr, QMetaType::Type hint, int *distance);
+JSValue convertQVariantToValue(ExecState*, PassRefPtr<RootObject> root, const QVariant& variant);
+QVariant convertValueToQVariant(ExecState*, JSValue, QMetaType::Type hint, int *distance);
const char* QtField::name() const
{
@@ -338,7 +338,7 @@ const char* QtField::name() const
return ""; // deleted child object
}
-JSValuePtr QtField::valueFromInstance(ExecState* exec, const Instance* inst) const
+JSValue QtField::valueFromInstance(ExecState* exec, const Instance* inst) const
{
const QtInstance* instance = static_cast<const QtInstance*>(inst);
QObject* obj = instance->getObject();
@@ -355,7 +355,7 @@ JSValuePtr QtField::valueFromInstance(ExecState* exec, const Instance* inst) con
else if (m_type == DynamicProperty)
val = obj->property(m_dynamicProperty);
- JSValuePtr ret = convertQVariantToValue(exec, inst->rootObject(), val);
+ JSValue ret = convertQVariantToValue(exec, inst->rootObject(), val);
// Need to save children so we can mark them
if (m_type == ChildObject)
@@ -368,7 +368,7 @@ JSValuePtr QtField::valueFromInstance(ExecState* exec, const Instance* inst) con
}
}
-void QtField::setValueToInstance(ExecState* exec, const Instance* inst, JSValuePtr aValue) const
+void QtField::setValueToInstance(ExecState* exec, const Instance* inst, JSValue aValue) const
{
if (m_type == ChildObject) // QtScript doesn't allow setting to a named child
return;
diff --git a/WebCore/bridge/qt/qt_instance.h b/WebCore/bridge/qt/qt_instance.h
index 526adb4..590fadf 100644
--- a/WebCore/bridge/qt/qt_instance.h
+++ b/WebCore/bridge/qt/qt_instance.h
@@ -45,25 +45,25 @@ public:
virtual void begin();
virtual void end();
- virtual JSValuePtr valueOf(ExecState*) const;
- virtual JSValuePtr defaultValue(ExecState*, PreferredPrimitiveType) const;
+ virtual JSValue valueOf(ExecState*) const;
+ virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
virtual void mark(); // This isn't inherited
- virtual JSValuePtr invokeMethod(ExecState*, const MethodList&, const ArgList&);
+ virtual JSValue invokeMethod(ExecState*, const MethodList&, const ArgList&);
virtual void getPropertyNames(ExecState*, PropertyNameArray&);
- JSValuePtr stringValue(ExecState* exec) const;
- JSValuePtr numberValue(ExecState* exec) const;
- JSValuePtr booleanValue() const;
+ JSValue stringValue(ExecState* exec) const;
+ JSValue numberValue(ExecState* exec) const;
+ JSValue booleanValue() const;
QObject* getObject() const { return m_object; }
static PassRefPtr<QtInstance> getQtInstance(QObject*, PassRefPtr<RootObject>, QScriptEngine::ValueOwnership ownership);
virtual bool getOwnPropertySlot(JSObject*, ExecState*, const Identifier&, PropertySlot&);
- virtual void put(JSObject*, ExecState*, const Identifier&, JSValuePtr, PutPropertySlot&);
+ virtual void put(JSObject*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
static QtInstance* getInstance(JSObject*);
@@ -81,7 +81,7 @@ private:
QObject* m_hashkey;
mutable QHash<QByteArray, JSObject*> m_methods;
mutable QHash<QString, QtField*> m_fields;
- mutable QSet<JSValuePtr> m_children;
+ mutable QSet<JSValue> m_children;
mutable QtRuntimeMetaMethod* m_defaultMethod;
QScriptEngine::ValueOwnership m_ownership;
};
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index 31b343e..161e570 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -113,7 +113,7 @@ QDebug operator<<(QDebug dbg, const JSRealType &c)
}
#endif
-static JSRealType valueRealType(ExecState* exec, JSValuePtr val)
+static JSRealType valueRealType(ExecState* exec, JSValue val)
{
if (val.isNumber())
return Number;
@@ -143,8 +143,11 @@ static JSRealType valueRealType(ExecState* exec, JSValuePtr val)
return String; // I don't know.
}
-QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects)
+QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects)
{
+ if (!value)
+ return QVariant();
+
JSObject* object = 0;
if (value.isObject()) {
object = value.toObject(exec);
@@ -321,7 +324,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
int objdist = 0;
while(it != properties.end()) {
if (object->propertyIsEnumerable(exec, *it)) {
- JSValuePtr val = object->get(exec, *it);
+ JSValue val = object->get(exec, *it);
QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects);
if (objdist >= 0) {
UString ustring = (*it).ustring();
@@ -345,7 +348,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
int objdist = 0;
qConvDebug() << "converting a " << len << " length Array";
for (int i = 0; i < len; ++i) {
- JSValuePtr val = rtarray->getConcreteArray()->valueAt(exec, i);
+ JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects));
if (objdist == -1) {
qConvDebug() << "Failed converting element at index " << i;
@@ -364,7 +367,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
int objdist = 0;
qConvDebug() << "converting a " << len << " length Array";
for (int i = 0; i < len; ++i) {
- JSValuePtr val = array->get(exec, i);
+ JSValue val = array->get(exec, i);
result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects));
if (objdist == -1) {
qConvDebug() << "Failed converting element at index " << i;
@@ -398,7 +401,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
QStringList result;
int len = rtarray->getLength();
for (int i = 0; i < len; ++i) {
- JSValuePtr val = rtarray->getConcreteArray()->valueAt(exec, i);
+ JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
UString ustring = val.toString(exec);
QString qstring = QString::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());
@@ -412,7 +415,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
QStringList result;
int len = array->length();
for (int i = 0; i < len; ++i) {
- JSValuePtr val = array->get(exec, i);
+ JSValue val = array->get(exec, i);
UString ustring = val.toString(exec);
QString qstring = QString::fromUtf16((const ushort*)ustring.rep()->data(),ustring.size());
@@ -453,7 +456,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
case QMetaType::QTime:
if (type == Date) {
DateInstance* date = static_cast<DateInstance*>(object);
- GregorianDateTime gdt;
+ WTF::GregorianDateTime gdt;
date->getUTCTime(gdt);
if (hint == QMetaType::QDateTime) {
ret = QDateTime(QDate(gdt.year + 1900, gdt.month + 1, gdt.monthDay), QTime(gdt.hour, gdt.minute, gdt.second), Qt::UTC);
@@ -467,7 +470,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
}
} else if (type == Number) {
double b = value.toNumber(exec);
- GregorianDateTime gdt;
+ WTF::GregorianDateTime gdt;
msToGregorianDateTime(b, true, gdt);
if (hint == QMetaType::QDateTime) {
ret = QDateTime(QDate(gdt.year + 1900, gdt.month + 1, gdt.monthDay), QTime(gdt.hour, gdt.minute, gdt.second), Qt::UTC);
@@ -621,7 +624,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
QObjectList result;
int len = rtarray->getLength();
for (int i = 0; i < len; ++i) {
- JSValuePtr val = rtarray->getConcreteArray()->valueAt(exec, i);
+ JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
int itemdist = -1;
QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects);
if (itemdist >= 0)
@@ -640,7 +643,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
QObjectList result;
int len = array->length();
for (int i = 0; i < len; ++i) {
- JSValuePtr val = array->get(exec, i);
+ JSValue val = array->get(exec, i);
int itemdist = -1;
QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects);
if (itemdist >= 0)
@@ -672,7 +675,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
QList<int> result;
int len = rtarray->getLength();
for (int i = 0; i < len; ++i) {
- JSValuePtr val = rtarray->getConcreteArray()->valueAt(exec, i);
+ JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
int itemdist = -1;
QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects);
if (itemdist >= 0)
@@ -691,7 +694,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
QList<int> result;
int len = array->length();
for (int i = 0; i < len; ++i) {
- JSValuePtr val = array->get(exec, i);
+ JSValue val = array->get(exec, i);
int itemdist = -1;
QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects);
if (itemdist >= 0)
@@ -746,13 +749,13 @@ QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Ty
return ret;
}
-QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Type hint, int *distance)
+QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance)
{
HashSet<JSObject*> visitedObjects;
return convertValueToQVariant(exec, value, hint, distance, &visitedObjects);
}
-JSValuePtr convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant)
+JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant)
{
// Variants with QObject * can be isNull but not a null pointer
// An empty QString variant is also null
@@ -820,7 +823,7 @@ JSValuePtr convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root,
}
// Dates specified this way are in local time (we convert DateTimes above)
- GregorianDateTime dt;
+ WTF::GregorianDateTime dt;
dt.year = date.year() - 1900;
dt.month = date.month() - 1;
dt.monthDay = date.day();
@@ -828,7 +831,7 @@ JSValuePtr convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root,
dt.minute = time.minute();
dt.second = time.second();
dt.isDST = -1;
- double ms = JSC::gregorianDateTimeToMS(dt, time.msec(), /*inputIsUTC*/ false);
+ double ms = WTF::gregorianDateTimeToMS(dt, time.msec(), /*inputIsUTC*/ false);
DateInstance* instance = new (exec) DateInstance(exec->lexicalGlobalObject()->dateStructure());
instance->setInternalValue(jsNumber(exec, trunc(ms)));
@@ -854,7 +857,7 @@ JSValuePtr convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root,
QVariantMap::const_iterator i = map.constBegin();
while (i != map.constEnd()) {
QString s = i.key();
- JSValuePtr val = convertQVariantToValue(exec, root, i.value());
+ JSValue val = convertQVariantToValue(exec, root, i.value());
if (val) {
PutPropertySlot slot;
ret->put(exec, Identifier(exec, (const UChar *)s.constData(), s.length()), val, slot);
@@ -1181,7 +1184,7 @@ static int findMethodIndex(ExecState* exec,
bool converted = true;
int matchDistance = 0;
for (int i = 0; converted && i < types.count() - 1; ++i) {
- JSValuePtr arg = i < jsArgs.size() ? jsArgs.at(exec, i) : jsUndefined();
+ JSValue arg = i < jsArgs.size() ? jsArgs.at(i) : jsUndefined();
int argdistance = -1;
QVariant v = convertValueToQVariant(exec, arg, types.at(i+1).typeId(), &argdistance);
@@ -1333,7 +1336,7 @@ void QtRuntimeMetaMethod::mark()
d->m_disconnect->mark();
}
-JSValuePtr QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSValuePtr thisValue, const ArgList& args)
+JSValue QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args)
{
QtRuntimeMetaMethodData* d = static_cast<QtRuntimeMetaMethod *>(functionObject)->d_func();
@@ -1391,13 +1394,13 @@ bool QtRuntimeMetaMethod::getOwnPropertySlot(ExecState* exec, const Identifier&
return QtRuntimeMethod::getOwnPropertySlot(exec, propertyName, slot);
}
-JSValuePtr QtRuntimeMetaMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot&)
+JSValue QtRuntimeMetaMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot&)
{
// QtScript always returns 0
return jsNumber(exec, 0);
}
-JSValuePtr QtRuntimeMetaMethod::connectGetter(ExecState* exec, const Identifier& ident, const PropertySlot& slot)
+JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, const Identifier& ident, const PropertySlot& slot)
{
QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slot.slotBase()));
QW_DS(QtRuntimeMetaMethod, thisObj);
@@ -1407,7 +1410,7 @@ JSValuePtr QtRuntimeMetaMethod::connectGetter(ExecState* exec, const Identifier&
return d->m_connect;
}
-JSValuePtr QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, const Identifier& ident, const PropertySlot& slot)
+JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, const Identifier& ident, const PropertySlot& slot)
{
QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slot.slotBase()));
QW_DS(QtRuntimeMetaMethod, thisObj);
@@ -1431,7 +1434,7 @@ QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, const Iden
d->m_isConnect = isConnect;
}
-JSValuePtr QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionObject, JSValuePtr thisValue, const ArgList& args)
+JSValue QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args)
{
QtRuntimeConnectionMethodData* d = static_cast<QtRuntimeConnectionMethod *>(functionObject)->d_func();
@@ -1454,7 +1457,7 @@ JSValuePtr QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionOb
if (signalIndex != -1) {
if (args.size() == 1) {
- funcObject = args.at(exec, 0).toObject(exec);
+ funcObject = args.at(0).toObject(exec);
CallData callData;
if (funcObject->getCallData(callData) == CallTypeNone) {
if (d->m_isConnect)
@@ -1463,23 +1466,23 @@ JSValuePtr QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionOb
return throwError(exec, TypeError, "QtMetaMethod.disconnect: target is not a function");
}
} else if (args.size() >= 2) {
- if (args.at(exec, 0).isObject()) {
- thisObject = args.at(exec, 0).toObject(exec);
+ if (args.at(0).isObject()) {
+ thisObject = args.at(0).toObject(exec);
// Get the actual function to call
- JSObject *asObj = args.at(exec, 1).toObject(exec);
+ JSObject *asObj = args.at(1).toObject(exec);
CallData callData;
if (asObj->getCallData(callData) != CallTypeNone) {
// Function version
funcObject = asObj;
} else {
// Convert it to a string
- UString funcName = args.at(exec, 1).toString(exec);
+ UString funcName = args.at(1).toString(exec);
Identifier funcIdent(exec, funcName);
// ### DropAllLocks
// This is resolved at this point in QtScript
- JSValuePtr val = thisObject->get(exec, funcIdent);
+ JSValue val = thisObject->get(exec, funcIdent);
JSObject* asFuncObj = val.toObject(exec);
if (asFuncObj->getCallData(callData) != CallTypeNone) {
@@ -1577,7 +1580,7 @@ bool QtRuntimeConnectionMethod::getOwnPropertySlot(ExecState* exec, const Identi
return QtRuntimeMethod::getOwnPropertySlot(exec, propertyName, slot);
}
-JSValuePtr QtRuntimeConnectionMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot&)
+JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot&)
{
// we have one formal argument, and one optional
return jsNumber(exec, 1);
@@ -1675,7 +1678,7 @@ void QtConnectionObject::execute(void **argv)
ExecState* exec = globalobj->globalExec();
if (exec) {
// Build the argument list (up to the formal argument length of the slot)
- ArgList l;
+ MarkedArgumentBuffer l;
// ### DropAllLocks?
int funcArgC = m_funcObject->get(exec, exec->propertyNames().length).toInt32(exec);
int argTotal = qMax(funcArgC, argc);
@@ -1743,7 +1746,7 @@ template <typename T> RootObject* QtArray<T>::rootObject() const
return _rootObject && _rootObject->isValid() ? _rootObject.get() : 0;
}
-template <typename T> void QtArray<T>::setValueAt(ExecState* exec, unsigned index, JSValuePtr aValue) const
+template <typename T> void QtArray<T>::setValueAt(ExecState* exec, unsigned index, JSValue aValue) const
{
// QtScript sets the value, but doesn't forward it to the original source
// (e.g. if you do 'object.intList[5] = 6', the object is not updated, but the
@@ -1757,7 +1760,7 @@ template <typename T> void QtArray<T>::setValueAt(ExecState* exec, unsigned inde
}
-template <typename T> JSValuePtr QtArray<T>::valueAt(ExecState *exec, unsigned int index) const
+template <typename T> JSValue QtArray<T>::valueAt(ExecState *exec, unsigned int index) const
{
if (index < m_length) {
T val = m_list.at(index);
diff --git a/WebCore/bridge/qt/qt_runtime.h b/WebCore/bridge/qt/qt_runtime.h
index 7912a2b..72d93eb 100644
--- a/WebCore/bridge/qt/qt_runtime.h
+++ b/WebCore/bridge/qt/qt_runtime.h
@@ -56,8 +56,8 @@ public:
: m_type(ChildObject), m_childObject(child)
{}
- virtual JSValuePtr valueFromInstance(ExecState*, const Instance*) const;
- virtual void setValueToInstance(ExecState*, const Instance*, JSValuePtr) const;
+ virtual JSValue valueFromInstance(ExecState*, const Instance*) const;
+ virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const;
virtual const char* name() const;
QtFieldType fieldType() const {return m_type;}
private:
@@ -98,8 +98,8 @@ public:
RootObject* rootObject() const;
- virtual void setValueAt(ExecState*, unsigned index, JSValuePtr) const;
- virtual JSValuePtr valueAt(ExecState*, unsigned index) const;
+ virtual void setValueAt(ExecState*, unsigned index, JSValue) const;
+ virtual JSValue valueAt(ExecState*, unsigned index) const;
virtual unsigned int getLength() const {return m_length;}
private:
@@ -144,12 +144,12 @@ public:
static const ClassInfo s_info;
- static FunctionPrototype* createPrototype(ExecState* exec)
+ static FunctionPrototype* createPrototype(ExecState*, JSGlobalObject* globalObject)
{
- return exec->lexicalGlobalObject()->functionPrototype();
+ return globalObject->functionPrototype();
}
- static PassRefPtr<Structure> createStructure(JSValuePtr prototype)
+ static PassRefPtr<Structure> createStructure(JSValue prototype)
{
return Structure::create(prototype, TypeInfo(ObjectType));
}
@@ -174,10 +174,10 @@ protected:
private:
virtual CallType getCallData(CallData&);
- static JSValuePtr call(ExecState* exec, JSObject* functionObject, JSValuePtr thisValue, const ArgList& args);
- static JSValuePtr lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
- static JSValuePtr connectGetter(ExecState*, const Identifier&, const PropertySlot&);
- static JSValuePtr disconnectGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValue JSC_HOST_CALL call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args);
+ static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValue connectGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValue disconnectGetter(ExecState*, const Identifier&, const PropertySlot&);
};
class QtConnectionObject;
@@ -193,8 +193,8 @@ protected:
private:
virtual CallType getCallData(CallData&);
- static JSValuePtr call(ExecState* exec, JSObject* functionObject, JSValuePtr thisValue, const ArgList& args);
- static JSValuePtr lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValue JSC_HOST_CALL call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args);
+ static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
static QMultiMap<QObject *, QtConnectionObject *> connections;
friend class QtConnectionObject;
};
@@ -223,7 +223,8 @@ private:
ProtectedPtr<JSObject> m_funcObject;
};
-QVariant convertValueToQVariant(ExecState* exec, JSValuePtr value, QMetaType::Type hint, int *distance);
+QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance);
+JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant);
} // namespace Bindings
} // namespace JSC