summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/Weak.h
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-30 12:48:17 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-30 12:48:17 +0200
commit881da28418d380042aa95a97f0cbd42560a64f7c (patch)
treea794dff3274695e99c651902dde93d934ea7a5af /Source/JavaScriptCore/heap/Weak.h
parent7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff)
parent0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff)
downloadqtwebkit-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.h21
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)