]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - heap/Weak.h
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / heap / Weak.h
index 5c901df22cca60f6aa909b19dcdc01222ea71d80..80cdbd82c66d6204e0838087ebb47c661e6b54b7 100644 (file)
 #ifndef Weak_h
 #define Weak_h
 
+#include <cstddef>
 #include <wtf/Noncopyable.h>
-#include <wtf/NullPtr.h>
 
 namespace JSC {
 
-template<typename T> 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<typename U> Weak(const PassWeak<U>&);
+    Weak(Weak&&);
 
     ~Weak()
     {
@@ -65,8 +64,9 @@ public:
     }
 
     void swap(Weak&);
-    Weak& operator=(const PassWeak<T>&);
-    
+
+    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<T> release();
+    WeakImpl* leakImpl() WARN_UNUSED_RETURN;
     void clear()
     {
         if (!m_impl)