diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/API/JSCallbackObject.h | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/API/JSCallbackObject.h')
-rw-r--r-- | Source/JavaScriptCore/API/JSCallbackObject.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/JavaScriptCore/API/JSCallbackObject.h b/Source/JavaScriptCore/API/JSCallbackObject.h index 3acf2ef10..16d8aa2c6 100644 --- a/Source/JavaScriptCore/API/JSCallbackObject.h +++ b/Source/JavaScriptCore/API/JSCallbackObject.h @@ -54,11 +54,11 @@ struct JSCallbackObjectData : WeakHandleOwner { return m_privateProperties->getPrivateProperty(propertyName); } - void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) + void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value) { if (!m_privateProperties) m_privateProperties = adoptPtr(new JSPrivatePropertyMap); - m_privateProperties->setPrivateProperty(globalData, owner, propertyName, value); + m_privateProperties->setPrivateProperty(vm, owner, propertyName, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -86,10 +86,10 @@ struct JSCallbackObjectData : WeakHandleOwner { return location->value.get(); } - void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) + void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value) { WriteBarrier<Unknown> empty; - m_propertyMap.add(propertyName.impl(), empty).iterator->value.set(globalData, owner, value); + m_propertyMap.add(propertyName.impl(), empty).iterator->value.set(vm, owner, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -118,10 +118,10 @@ template <class Parent> class JSCallbackObject : public Parent { protected: JSCallbackObject(ExecState*, Structure*, JSClassRef, void* data); - JSCallbackObject(JSGlobalData&, JSClassRef, Structure*); + JSCallbackObject(VM&, JSClassRef, Structure*); void finishCreation(ExecState*); - void finishCreation(JSGlobalData&); + void finishCreation(VM&); public: typedef Parent Base; @@ -133,10 +133,13 @@ public: callbackObject->finishCreation(exec); return callbackObject; } - static JSCallbackObject<Parent>* create(JSGlobalData&, JSClassRef, Structure*); + static JSCallbackObject<Parent>* create(VM&, JSClassRef, Structure*); static const bool needsDestruction; - static void destroy(JSCell*); + static void destroy(JSCell* cell) + { + static_cast<JSCallbackObject*>(cell)->JSCallbackObject::~JSCallbackObject(); + } void setPrivate(void* data); void* getPrivate(); @@ -146,16 +149,16 @@ public: JSClassRef classRef() const { return m_callbackObjectData->jsClass; } bool inherits(JSClassRef) const; - static Structure* createStructure(JSGlobalData&, JSGlobalObject*, JSValue); + static Structure* createStructure(VM&, JSGlobalObject*, JSValue); JSValue getPrivateProperty(const Identifier& propertyName) const { return m_callbackObjectData->getPrivateProperty(propertyName); } - void setPrivateProperty(JSGlobalData& globalData, const Identifier& propertyName, JSValue value) + void setPrivateProperty(VM& vm, const Identifier& propertyName, JSValue value) { - m_callbackObjectData->setPrivateProperty(globalData, this, propertyName, value); + m_callbackObjectData->setPrivateProperty(vm, this, propertyName, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -178,6 +181,7 @@ private: static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); + static void putByIndex(JSCell*, ExecState*, unsigned, JSValue, bool shouldThrow); static bool deleteProperty(JSCell*, ExecState*, PropertyName); static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned); |