Chromium Code Reviews| Index: Source/platform/heap/Handle.h |
| diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h |
| index 8902360b60d262d265766f7dff6d8ea862c1be04..cd7ecc3b47d96261932d1333ce547faa4f4780d4 100644 |
| --- a/Source/platform/heap/Handle.h |
| +++ b/Source/platform/heap/Handle.h |
| @@ -288,6 +288,47 @@ public: |
| Persistent(const Member<U>& other) : Parent(other) { } |
| template<typename U> |
| Persistent(const RawPtr<U>& other) : Parent(other.get()) { } |
| + |
| + template<typename U> |
| + Persistent& operator=(U* other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
|
sof
2015/09/12 17:26:17
Cut&paste error - this one shouldn't be parameteri
|
| + Persistent& operator=(std::nullptr_t) |
| + { |
| + Parent::operator=(nullptr); |
| + return *this; |
| + } |
| + |
| + Persistent& operator=(const Persistent& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + Persistent& operator=(const Persistent<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + Persistent& operator=(const Member<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + Persistent& operator=(const RawPtr<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| }; |
| // WeakPersistent is a way to create a weak pointer from an off-heap object |
| @@ -316,6 +357,47 @@ public: |
| WeakPersistent(const Member<U>& other) : Parent(other) { } |
| template<typename U> |
| WeakPersistent(const RawPtr<U>& other) : Parent(other.get()) { } |
| + |
| + template<typename U> |
| + WeakPersistent& operator=(U* other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + WeakPersistent& operator=(std::nullptr_t) |
| + { |
| + Parent::operator=(nullptr); |
| + return *this; |
| + } |
| + |
| + WeakPersistent& operator=(const WeakPersistent& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + WeakPersistent& operator=(const WeakPersistent<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + WeakPersistent& operator=(const Member<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + WeakPersistent& operator=(const RawPtr<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| }; |
| // Unlike Persistent, we can destruct a CrossThreadPersistent in a thread |
| @@ -335,6 +417,47 @@ public: |
| CrossThreadPersistent(const Member<U>& other) : Parent(other) { } |
| template<typename U> |
| CrossThreadPersistent(const RawPtr<U>& other) : Parent(other.get()) { } |
| + |
| + template<typename U> |
| + CrossThreadPersistent& operator=(U* other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadPersistent& operator=(std::nullptr_t) |
| + { |
| + Parent::operator=(nullptr); |
| + return *this; |
| + } |
| + |
| + CrossThreadPersistent& operator=(const CrossThreadPersistent& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadPersistent& operator=(const CrossThreadPersistent<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadPersistent& operator=(const Member<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadPersistent& operator=(const RawPtr<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| }; |
| // Combines the behavior of CrossThreadPersistent and WeakPersistent. |
| @@ -353,6 +476,47 @@ public: |
| CrossThreadWeakPersistent(const Member<U>& other) : Parent(other) { } |
| template<typename U> |
| CrossThreadWeakPersistent(const RawPtr<U>& other) : Parent(other.get()) { } |
| + |
| + template<typename U> |
| + CrossThreadWeakPersistent& operator=(U* other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadWeakPersistent& operator=(std::nullptr_t) |
| + { |
| + Parent::operator=(nullptr); |
| + return *this; |
| + } |
| + |
| + CrossThreadWeakPersistent& operator=(const CrossThreadWeakPersistent& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadWeakPersistent& operator=(const CrossThreadWeakPersistent<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadWeakPersistent& operator=(const Member<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| + |
| + template<typename U> |
| + CrossThreadWeakPersistent& operator=(const RawPtr<U>& other) |
| + { |
| + Parent::operator=(other); |
| + return *this; |
| + } |
| }; |
| template<typename Collection> |