summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/bridge/qt
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-02 12:07:03 +0100
committerBen Murdoch <benm@google.com>2011-06-10 10:47:21 +0100
commit2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch)
treee4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/bridge/qt
parent87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff)
downloadexternal_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/bridge/qt')
-rw-r--r--Source/WebCore/bridge/qt/qt_class.cpp4
-rw-r--r--Source/WebCore/bridge/qt/qt_instance.cpp12
-rw-r--r--Source/WebCore/bridge/qt/qt_instance.h2
-rw-r--r--Source/WebCore/bridge/qt/qt_pixmapruntime.cpp2
-rw-r--r--Source/WebCore/bridge/qt/qt_runtime.h8
5 files changed, 13 insertions, 15 deletions
diff --git a/Source/WebCore/bridge/qt/qt_class.cpp b/Source/WebCore/bridge/qt/qt_class.cpp
index 3c1836a..c3d8b27 100644
--- a/Source/WebCore/bridge/qt/qt_class.cpp
+++ b/Source/WebCore/bridge/qt/qt_class.cpp
@@ -87,7 +87,7 @@ JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, const Identifie
QMetaMethod m = m_metaObject->method(index);
if (m.access() != QMetaMethod::Private) {
QtRuntimeMetaMethod* val = new (exec) QtRuntimeMetaMethod(exec, identifier, static_cast<QtInstance*>(inst), index, normal, false);
- qtinst->m_methods.insert(name, val);
+ qtinst->m_methods.insert(name, WriteBarrier<JSObject>(exec->globalData(), qtinst->createRuntimeObject(exec), val));
return val;
}
}
@@ -106,7 +106,7 @@ JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, const Identifie
if (normal == QByteArray::fromRawData(signature, iter)) {
QtRuntimeMetaMethod* val = new (exec) QtRuntimeMetaMethod(exec, identifier, static_cast<QtInstance*>(inst), index, normal, false);
- qtinst->m_methods.insert(name, val);
+ qtinst->m_methods.insert(name, WriteBarrier<JSObject>(exec->globalData(), qtinst->createRuntimeObject(exec), val));
return val;
}
}
diff --git a/Source/WebCore/bridge/qt/qt_instance.cpp b/Source/WebCore/bridge/qt/qt_instance.cpp
index 91ae40f..2d29e01 100644
--- a/Source/WebCore/bridge/qt/qt_instance.cpp
+++ b/Source/WebCore/bridge/qt/qt_instance.cpp
@@ -59,7 +59,7 @@ public:
instance->markAggregate(markStack);
}
- static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype)
+ static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
@@ -151,12 +151,12 @@ void QtInstance::removeCachedMethod(JSObject* method)
if (m_defaultMethod.get() == method)
m_defaultMethod.clear();
- for (QHash<QByteArray, DeprecatedPtr<JSObject> >::Iterator it = m_methods.begin(),
- end = m_methods.end(); it != end; ++it)
+ for (QHash<QByteArray, WriteBarrier<JSObject> >::Iterator it = m_methods.begin(), end = m_methods.end(); it != end; ++it) {
if (it.value().get() == method) {
m_methods.erase(it);
return;
}
+ }
}
QtInstance* QtInstance::getInstance(JSObject* object)
@@ -189,10 +189,8 @@ void QtInstance::markAggregate(MarkStack& markStack)
{
if (m_defaultMethod)
markStack.append(&m_defaultMethod);
- foreach (DeprecatedPtr<JSObject> val, m_methods.values()) {
- if (val)
- markStack.append(&val);
- }
+ for (QHash<QByteArray, WriteBarrier<JSObject> >::Iterator it = m_methods.begin(), end = m_methods.end(); it != end; ++it)
+ markStack.append(&it.value());
}
void QtInstance::begin()
diff --git a/Source/WebCore/bridge/qt/qt_instance.h b/Source/WebCore/bridge/qt/qt_instance.h
index 003c801..b802500 100644
--- a/Source/WebCore/bridge/qt/qt_instance.h
+++ b/Source/WebCore/bridge/qt/qt_instance.h
@@ -83,7 +83,7 @@ private:
mutable QtClass* m_class;
QPointer<QObject> m_object;
QObject* m_hashkey;
- mutable QHash<QByteArray, DeprecatedPtr<JSObject> > m_methods;
+ mutable QHash<QByteArray, WriteBarrier<JSObject> > m_methods;
mutable QHash<QString, QtField*> m_fields;
mutable WriteBarrier<QtRuntimeMetaMethod> m_defaultMethod;
QScriptEngine::ValueOwnership m_ownership;
diff --git a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
index da3e383..c498637 100644
--- a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -150,7 +150,7 @@ public:
static const ClassInfo s_info;
- static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype)
+ static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
diff --git a/Source/WebCore/bridge/qt/qt_runtime.h b/Source/WebCore/bridge/qt/qt_runtime.h
index 85b34b8..fa5ce62 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 "Global.h"
+#include "Strong.h"
#include "runtime_method.h"
#include <qbytearray.h>
@@ -153,7 +153,7 @@ public:
return globalObject->functionPrototype();
}
- static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype)
+ static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
@@ -229,8 +229,8 @@ private:
RefPtr<QtInstance> m_instance;
int m_signalIndex;
QObject* m_originalObject; // only used as a key, not dereferenced
- Global<JSObject> m_thisObject;
- Global<JSObject> m_funcObject;
+ Strong<JSObject> m_thisObject;
+ Strong<JSObject> m_funcObject;
};
QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance);