Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: Source/platform/heap/Handle.h

Issue 1335303002: Add (back) assignment operator overloads over Persistent<> types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove erroneous parameterization of operator=(std::nullptr_t)s Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.h
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
index 8902360b60d262d265766f7dff6d8ea862c1be04..33adc3bf1032d653afcba8a7788575e7bc4a7fb0 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -288,6 +288,46 @@ 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;
+ }
+
+ 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 +356,46 @@ 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;
+ }
+
+ 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 +415,46 @@ 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;
+ }
+
+ 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 +473,46 @@ 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;
+ }
+
+ 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>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698