X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..refs/heads/master:/heap/Weak.h diff --git a/heap/Weak.h b/heap/Weak.h index 5c901df..80cdbd8 100644 --- a/heap/Weak.h +++ b/heap/Weak.h @@ -26,12 +26,11 @@ #ifndef Weak_h #define Weak_h +#include #include -#include namespace JSC { -template class PassWeak; class WeakImpl; class WeakHandleOwner; @@ -46,18 +45,18 @@ public: { } - explicit Weak(std::nullptr_t) + Weak(std::nullptr_t) : m_impl(0) { } - explicit Weak(T*, WeakHandleOwner* = 0, void* context = 0); + Weak(T*, WeakHandleOwner* = 0, void* context = 0); enum HashTableDeletedValueTag { HashTableDeletedValue }; bool isHashTableDeletedValue() const; Weak(HashTableDeletedValueTag); - template Weak(const PassWeak&); + Weak(Weak&&); ~Weak() { @@ -65,8 +64,9 @@ public: } void swap(Weak&); - Weak& operator=(const PassWeak&); - + + Weak& operator=(Weak&&); + bool operator!() const; T* operator->() const; T& operator*() const; @@ -78,7 +78,7 @@ public: typedef void* (Weak::*UnspecifiedBoolType); operator UnspecifiedBoolType*() const; - PassWeak release(); + WeakImpl* leakImpl() WARN_UNUSED_RETURN; void clear() { if (!m_impl)