// Creating a JSValue Handle is invalid
template <> class Handle<JSValue>;
-// Forward declare WeakGCMap
-template<typename KeyType, typename MappedType, typename FinalizerCallback, typename HashArg, typename KeyTraitsArg> class WeakGCMap;
-
class HandleBase {
template <typename T> friend class Weak;
- friend class HandleHeap;
+ template <typename T> friend class Strong;
+ friend class HandleSet;
friend struct JSCallbackObjectData;
- template <typename KeyType, typename MappedType, typename FinalizerCallback, typename HashArg, typename KeyTraitsArg> friend class WeakGCMap;
public:
bool operator!() const { return !m_slot || !*m_slot; }
typedef JSValue (HandleBase::*UnspecifiedBoolType);
operator UnspecifiedBoolType*() const { return (m_slot && *m_slot) ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; }
+ HandleSlot slot() const { return m_slot; }
+
protected:
HandleBase(HandleSlot slot)
: m_slot(slot)
void swap(HandleBase& other) { std::swap(m_slot, other.m_slot); }
- HandleSlot slot() const { return m_slot; }
void setSlot(HandleSlot slot)
{
m_slot = slot;
template <typename Base, typename T> struct HandleConverter {
T* operator->()
{
-#if ENABLE(JSC_ZOMBIES)
- ASSERT(!static_cast<const Base*>(this)->get() || !static_cast<const Base*>(this)->get()->isZombie());
-#endif
return static_cast<Base*>(this)->get();
}
const T* operator->() const
{
-#if ENABLE(JSC_ZOMBIES)
- ASSERT(!static_cast<const Base*>(this)->get() || !static_cast<const Base*>(this)->get()->isZombie());
-#endif
return static_cast<const Base*>(this)->get();
}
T* operator*()
{
-#if ENABLE(JSC_ZOMBIES)
- ASSERT(!static_cast<const Base*>(this)->get() || !static_cast<const Base*>(this)->get()->isZombie());
-#endif
return static_cast<Base*>(this)->get();
}
const T* operator*() const
{
-#if ENABLE(JSC_ZOMBIES)
- ASSERT(!static_cast<const Base*>(this)->get() || !static_cast<const Base*>(this)->get()->isZombie());
-#endif
return static_cast<const Base*>(this)->get();
}
};
Handle<JSObject> asObject() const;
bool isObject() const { return jsValue().isObject(); }
bool getNumber(double number) const { return jsValue().getNumber(number); }
- UString getString(ExecState*) const;
+ WTF::String getString(ExecState*) const;
bool isUndefinedOrNull() const { return jsValue().isUndefinedOrNull(); }
private:
JSValue jsValue() const
{
-#if ENABLE(JSC_ZOMBIES)
- ASSERT(!static_cast<const Base*>(this)->get() || !static_cast<const Base*>(this)->get().isZombie());
-#endif
return static_cast<const Base*>(this)->get();
}
};
template <typename T> class Handle : public HandleBase, public HandleConverter<Handle<T>, T> {
public:
- template <typename A, typename B> friend class HandleConverter;
+ template <typename A, typename B> friend struct HandleConverter;
typedef typename HandleTypes<T>::ExternalType ExternalType;
template <typename U> Handle(Handle<U> o)
{
}
private:
- friend class HandleHeap;
+ friend class HandleSet;
+ friend class WeakBlock;
static Handle<T> wrapSlot(HandleSlot slot)
{