diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/JavaScriptCore/heap/Weak.h | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/JavaScriptCore/heap/Weak.h')
-rw-r--r-- | Source/JavaScriptCore/heap/Weak.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/JavaScriptCore/heap/Weak.h b/Source/JavaScriptCore/heap/Weak.h index 5c901df22..2d82f67ae 100644 --- a/Source/JavaScriptCore/heap/Weak.h +++ b/Source/JavaScriptCore/heap/Weak.h @@ -26,12 +26,12 @@ #ifndef Weak_h #define Weak_h +#include "JSExportMacros.h" +#include <cstddef> #include <wtf/Noncopyable.h> -#include <wtf/NullPtr.h> namespace JSC { -template<typename T> class PassWeak; class WeakImpl; class WeakHandleOwner; @@ -46,18 +46,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 +65,9 @@ public: } void swap(Weak&); - Weak& operator=(const PassWeak<T>&); - + + Weak& operator=(Weak&&); + bool operator!() const; T* operator->() const; T& operator*() const; @@ -74,11 +75,9 @@ public: bool was(T*) const; - // This conversion operator allows implicit conversion to bool but not to other integer types. - typedef void* (Weak::*UnspecifiedBoolType); - operator UnspecifiedBoolType*() const; + explicit operator bool() const; - PassWeak<T> release(); + WeakImpl* leakImpl() WARN_UNUSED_RETURN; void clear() { if (!m_impl) |