diff options
| author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
| commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
| tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/bridge/qt | |
| parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
| download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 | |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/bridge/qt')
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_instance.cpp | 8 | ||||
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_pixmapruntime.cpp | 8 | ||||
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_runtime.cpp | 38 | ||||
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_runtime.h | 10 |
4 files changed, 29 insertions, 35 deletions
diff --git a/Source/WebCore/bridge/qt/qt_instance.cpp b/Source/WebCore/bridge/qt/qt_instance.cpp index b4d2117..7af752d 100644 --- a/Source/WebCore/bridge/qt/qt_instance.cpp +++ b/Source/WebCore/bridge/qt/qt_instance.cpp @@ -29,6 +29,7 @@ #include "qt_class.h" #include "qt_runtime.h" #include "runtime_object.h" +#include "runtime/FunctionPrototype.h" #include <qdebug.h> #include <qhash.h> @@ -60,14 +61,11 @@ public: static PassRefPtr<Structure> createStructure(JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); + return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesMarkChildren; - -private: - virtual const ClassInfo* classInfo() const { return &s_info; } }; const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0 }; @@ -244,7 +242,7 @@ JSValue QtInstance::getMethod(ExecState* exec, const Identifier& propertyName) if (!getClass()) return jsNull(); MethodList methodList = m_class->methodsNamed(propertyName, this); - return new (exec) RuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); + return new (exec) RuntimeMethod(exec, exec->lexicalGlobalObject(), WebCore::deprecatedGetDOMStructure<RuntimeMethod>(exec), propertyName, methodList); } JSValue QtInstance::invokeMethod(ExecState*, RuntimeMethod*) diff --git a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp index 1ef20c3..534e28e 100644 --- a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp +++ b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp @@ -34,6 +34,7 @@ #include <runtime_method.h> #include <runtime_object.h> #include <runtime_root.h> +#include "runtime/FunctionPrototype.h" using namespace WebCore; namespace JSC { @@ -151,14 +152,11 @@ public: static PassRefPtr<Structure> createStructure(JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); + return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesMarkChildren; - -private: - virtual const ClassInfo* classInfo() const { return &s_info; } }; QtPixmapRuntimeObject::QtPixmapRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance) @@ -181,7 +179,7 @@ Class* QtPixmapInstance::getClass() const JSValue QtPixmapInstance::getMethod(ExecState* exec, const Identifier& propertyName) { MethodList methodList = getClass()->methodsNamed(propertyName, this); - return new (exec) RuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); + return new (exec) RuntimeMethod(exec, exec->lexicalGlobalObject(), WebCore::deprecatedGetDOMStructure<RuntimeMethod>(exec), propertyName, methodList); } JSValue QtPixmapInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod) diff --git a/Source/WebCore/bridge/qt/qt_runtime.cpp b/Source/WebCore/bridge/qt/qt_runtime.cpp index 5507fc9..78821b9 100644 --- a/Source/WebCore/bridge/qt/qt_runtime.cpp +++ b/Source/WebCore/bridge/qt/qt_runtime.cpp @@ -166,11 +166,11 @@ static JSRealType valueRealType(ExecState* exec, JSValue val) JSObject *object = val.toObject(exec); if (object->inherits(&RuntimeArray::s_info)) // RuntimeArray 'inherits' from Array, but not in C++ return RTArray; - else if (object->inherits(&JSArray::info)) + else if (object->inherits(&JSArray::s_info)) return Array; - else if (object->inherits(&DateInstance::info)) + else if (object->inherits(&DateInstance::s_info)) return Date; - else if (object->inherits(&RegExpObject::info)) + else if (object->inherits(&RegExpObject::s_info)) return RegExp; else if (object->inherits(&RuntimeObject::s_info)) return QObj; @@ -227,9 +227,9 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint = QMetaType::QRegExp; break; case Object: - if (object->inherits(&NumberObject::info)) + if (object->inherits(&NumberObject::s_info)) hint = QMetaType::Double; - else if (object->inherits(&BooleanObject::info)) + else if (object->inherits(&BooleanObject::s_info)) hint = QMetaType::Bool; else hint = QMetaType::QVariantMap; @@ -263,7 +263,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type int dist = -1; switch (hint) { case QMetaType::Bool: - if (type == Object && object->inherits(&BooleanObject::info)) + if (type == Object && object->inherits(&BooleanObject::s_info)) ret = QVariant(asBooleanObject(value)->internalValue().toBoolean(exec)); else ret = QVariant(value.toBoolean(exec)); @@ -983,7 +983,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con #define QW_D(Class) Class##Data* d = d_func() #define QW_DS(Class,Instance) Class##Data* d = Instance->d_func() -const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", 0, 0, 0 }; +const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0 }; QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, const Identifier& ident, PassRefPtr<QtInstance> inst) : InternalFunction(&exec->globalData(), exec->lexicalGlobalObject(), deprecatedGetDOMStructure<QtRuntimeMethod>(exec), ident) @@ -1629,7 +1629,7 @@ EncodedJSValue QtRuntimeConnectionMethod::call(ExecState* exec) // receiver function [from arguments] // receiver this object [from arguments] - QtConnectionObject* conn = new QtConnectionObject(d->m_instance, signalIndex, thisObject, funcObject); + QtConnectionObject* conn = new QtConnectionObject(exec->globalData(), d->m_instance, signalIndex, thisObject, funcObject); bool ok = QMetaObject::connect(sender, signalIndex, conn, conn->metaObject()->methodOffset()); if (!ok) { delete conn; @@ -1723,12 +1723,12 @@ JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState*, JSValue, const Ident // =============== -QtConnectionObject::QtConnectionObject(PassRefPtr<QtInstance> instance, int signalIndex, JSObject* thisObject, JSObject* funcObject) +QtConnectionObject::QtConnectionObject(JSGlobalData& globalData, PassRefPtr<QtInstance> instance, int signalIndex, JSObject* thisObject, JSObject* funcObject) : m_instance(instance) , m_signalIndex(signalIndex) , m_originalObject(m_instance->getObject()) - , m_thisObject(thisObject) - , m_funcObject(funcObject) + , m_thisObject(globalData, thisObject) + , m_funcObject(globalData, funcObject) { setParent(m_originalObject); ASSERT(JSLock::currentThreadIsHoldingLock()); // so our ProtectedPtrs are safe @@ -1826,27 +1826,25 @@ void QtConnectionObject::execute(void **argv) } } // Stuff in the __qt_sender property, if we can - ScopeChain oldsc = ScopeChain(NoScopeChain()); + ScopeChainNode* oldsc = 0; JSFunction* fimp = 0; - if (m_funcObject->inherits(&JSFunction::info)) { + if (m_funcObject->inherits(&JSFunction::s_info)) { fimp = static_cast<JSFunction*>(m_funcObject.get()); JSObject* qt_sender = QtInstance::getQtInstance(sender(), ro, QScriptEngine::QtOwnership)->createRuntimeObject(exec); - JSObject* wrapper = new (exec) JSObject(JSObject::createStructure(jsNull())); + JSObject* wrapper = constructEmptyObject(exec, createEmptyObjectStructure(jsNull())); PutPropertySlot slot; wrapper->put(exec, Identifier(exec, "__qt_sender__"), qt_sender, slot); oldsc = fimp->scope(); - ScopeChain sc = oldsc; - sc.push(wrapper); - fimp->setScope(sc); + fimp->setScope(exec->globalData(), oldsc->push(wrapper)); } CallData callData; CallType callType = m_funcObject->getCallData(callData); - call(exec, m_funcObject, callType, callData, m_thisObject, l); + call(exec, m_funcObject.get(), callType, callData, m_thisObject.get(), l); if (fimp) - fimp->setScope(oldsc); + fimp->setScope(exec->globalData(), oldsc); } } } @@ -1859,7 +1857,7 @@ void QtConnectionObject::execute(void **argv) bool QtConnectionObject::match(QObject* sender, int signalIndex, JSObject* thisObject, JSObject *funcObject) { if (m_originalObject == sender && m_signalIndex == signalIndex - && thisObject == (JSObject*)m_thisObject && funcObject == (JSObject*)m_funcObject) + && thisObject == (JSObject*)m_thisObject.get() && funcObject == (JSObject*)m_funcObject.get()) return true; return false; } diff --git a/Source/WebCore/bridge/qt/qt_runtime.h b/Source/WebCore/bridge/qt/qt_runtime.h index c5abca7..b86ccbe 100644 --- a/Source/WebCore/bridge/qt/qt_runtime.h +++ b/Source/WebCore/bridge/qt/qt_runtime.h @@ -22,7 +22,7 @@ #include "BridgeJSC.h" #include "Completion.h" -#include "Protect.h" +#include "Global.h" #include "runtime_method.h" #include <qbytearray.h> @@ -155,7 +155,7 @@ public: static PassRefPtr<Structure> createStructure(JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); + return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: @@ -212,7 +212,7 @@ private: class QtConnectionObject: public QObject { public: - QtConnectionObject(PassRefPtr<QtInstance> instance, int signalIndex, JSObject* thisObject, JSObject* funcObject); + QtConnectionObject(JSGlobalData&, PassRefPtr<QtInstance> instance, int signalIndex, JSObject* thisObject, JSObject* funcObject); ~QtConnectionObject(); static const QMetaObject staticMetaObject; @@ -229,8 +229,8 @@ private: RefPtr<QtInstance> m_instance; int m_signalIndex; QObject* m_originalObject; // only used as a key, not dereferenced - ProtectedPtr<JSObject> m_thisObject; - ProtectedPtr<JSObject> m_funcObject; + Global<JSObject> m_thisObject; + Global<JSObject> m_funcObject; }; QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance); |
