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

Unified Diff: Source/wtf/RawPtr.h

Issue 166443003: Move CSSCalcExpressionNode and subclasses to the oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback Created 6 years, 10 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 | « Source/core/css/CSSCalculationValueTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/RawPtr.h
diff --git a/Source/wtf/RawPtr.h b/Source/wtf/RawPtr.h
index 8c111eafeaad4086755b00e3211ba56de2f67afa..92ed528412176cf40e8611d91501c36c7b7bbaab 100644
--- a/Source/wtf/RawPtr.h
+++ b/Source/wtf/RawPtr.h
@@ -45,9 +45,12 @@ class RawPtr {
public:
RawPtr() : m_ptr(0) { }
RawPtr(T* ptr) : m_ptr(ptr) { }
-
+ RawPtr(const RawPtr& other)
+ : m_ptr(other.get())
+ {
+ }
template<typename U>
- explicit RawPtr(const RawPtr<U>& other)
+ RawPtr(const RawPtr<U>& other)
: m_ptr(other.get())
{
}
@@ -68,12 +71,20 @@ public:
return ptr;
}
- RawPtr& operator=(T* ptr)
+ template<typename U>
+ RawPtr& operator=(U* ptr)
{
m_ptr = ptr;
return *this;
}
+ template<typename U>
+ RawPtr& operator=(RawPtr<U> ptr)
+ {
+ m_ptr = ptr.get();
+ return *this;
+ }
+
operator T*() const { return m_ptr; }
T& operator*() const { return *m_ptr; }
T* operator->() const { return m_ptr; }
« no previous file with comments | « Source/core/css/CSSCalculationValueTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698