diff options
Diffstat (limited to 'Source/WebCore/bridge/qt')
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_instance.cpp | 4 | ||||
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_pixmapruntime.cpp | 8 | ||||
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_runtime.cpp | 16 | ||||
| -rw-r--r-- | Source/WebCore/bridge/qt/qt_runtime.h | 4 |
4 files changed, 14 insertions, 18 deletions
diff --git a/Source/WebCore/bridge/qt/qt_instance.cpp b/Source/WebCore/bridge/qt/qt_instance.cpp index 7af752d..91ae40f 100644 --- a/Source/WebCore/bridge/qt/qt_instance.cpp +++ b/Source/WebCore/bridge/qt/qt_instance.cpp @@ -59,9 +59,9 @@ public: instance->markAggregate(markStack); } - static PassRefPtr<Structure> createStructure(JSValue prototype) + static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: diff --git a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp index 534e28e..da3e383 100644 --- a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp +++ b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp @@ -119,7 +119,7 @@ public: QByteArray byteArray; QBuffer buffer(&byteArray); instance->toImage().save(&buffer, "PNG"); - const QString encodedString = QString("data:image/png;base64,") + byteArray.toBase64(); + const QString encodedString = QLatin1String("data:image/png;base64,") + QLatin1String(byteArray.toBase64()); const UString ustring((UChar*)encodedString.utf16(), encodedString.length()); return jsString(exec, ustring); } @@ -150,9 +150,9 @@ public: static const ClassInfo s_info; - static PassRefPtr<Structure> createStructure(JSValue prototype) + static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: @@ -239,7 +239,7 @@ JSValue QtPixmapInstance::defaultValue(ExecState* exec, PreferredPrimitiveType p JSValue QtPixmapInstance::valueOf(ExecState* exec) const { - const QString stringValue = QString("[Qt Native Pixmap %1,%2]").arg(width()).arg(height()); + const QString stringValue = QString::fromLatin1("[Qt Native Pixmap %1,%2]").arg(width()).arg(height()); UString ustring((UChar*)stringValue.utf16(), stringValue.length()); return jsString(exec, ustring); } diff --git a/Source/WebCore/bridge/qt/qt_runtime.cpp b/Source/WebCore/bridge/qt/qt_runtime.cpp index 78821b9..87ee522 100644 --- a/Source/WebCore/bridge/qt/qt_runtime.cpp +++ b/Source/WebCore/bridge/qt/qt_runtime.cpp @@ -845,17 +845,13 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con QRegExp re = variant.value<QRegExp>(); if (re.isValid()) { - UString uflags; - if (re.caseSensitivity() == Qt::CaseInsensitive) - uflags = "i"; // ### Can't do g or m - UString pattern((UChar*)re.pattern().utf16(), re.pattern().length()); + RegExpFlags flags = (re.caseSensitivity() == Qt::CaseInsensitive) ? FlagIgnoreCase : NoFlags; - RefPtr<JSC::RegExp> regExp = JSC::RegExp::create(&exec->globalData(), pattern, uflags); + RefPtr<JSC::RegExp> regExp = JSC::RegExp::create(&exec->globalData(), pattern, flags); if (regExp->isValid()) return new (exec) RegExpObject(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp.release()); - else - return jsNull(); + return jsNull(); } } @@ -887,14 +883,14 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con dt.isDST = -1; double ms = gregorianDateTimeToMS(exec, dt, time.msec(), /*inputIsUTC*/ false); - return new (exec) DateInstance(exec, trunc(ms)); + return new (exec) DateInstance(exec, exec->lexicalGlobalObject()->dateStructure(), trunc(ms)); } if (type == QMetaType::QByteArray) { QByteArray qtByteArray = variant.value<QByteArray>(); WTF::RefPtr<WTF::ByteArray> wtfByteArray = WTF::ByteArray::create(qtByteArray.length()); memcpy(wtfByteArray->data(), qtByteArray.constData(), qtByteArray.length()); - return new (exec) JSC::JSByteArray(exec, JSC::JSByteArray::createStructure(jsNull()), wtfByteArray.get()); + return new (exec) JSC::JSByteArray(exec, JSC::JSByteArray::createStructure(exec->globalData(), jsNull()), wtfByteArray.get()); } if (type == QMetaType::QObjectStar || type == QMetaType::QWidgetStar) { @@ -1832,7 +1828,7 @@ void QtConnectionObject::execute(void **argv) fimp = static_cast<JSFunction*>(m_funcObject.get()); JSObject* qt_sender = QtInstance::getQtInstance(sender(), ro, QScriptEngine::QtOwnership)->createRuntimeObject(exec); - JSObject* wrapper = constructEmptyObject(exec, createEmptyObjectStructure(jsNull())); + JSObject* wrapper = constructEmptyObject(exec, createEmptyObjectStructure(exec->globalData(), jsNull())); PutPropertySlot slot; wrapper->put(exec, Identifier(exec, "__qt_sender__"), qt_sender, slot); oldsc = fimp->scope(); diff --git a/Source/WebCore/bridge/qt/qt_runtime.h b/Source/WebCore/bridge/qt/qt_runtime.h index b86ccbe..85b34b8 100644 --- a/Source/WebCore/bridge/qt/qt_runtime.h +++ b/Source/WebCore/bridge/qt/qt_runtime.h @@ -153,9 +153,9 @@ public: return globalObject->functionPrototype(); } - static PassRefPtr<Structure> createStructure(JSValue prototype) + static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: |
