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

Unified Diff: Source/wtf/RefPtr.h

Issue 267303004: Oilpan: cleanup based on review comments after removal of TreeShared. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« Source/core/svg/SVGElement.cpp ('K') | « Source/wtf/PassRefPtr.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/RefPtr.h
diff --git a/Source/wtf/RefPtr.h b/Source/wtf/RefPtr.h
index f640a7713070a8d5afe9dfd7513025056ce8cba7..e8e9940e28ac52e9735573e5bb938c7378d9e739 100644
--- a/Source/wtf/RefPtr.h
+++ b/Source/wtf/RefPtr.h
@@ -163,6 +163,16 @@ namespace WTF {
return a == b.get();
}
+ template<typename T, typename U> inline bool operator==(const RefPtr<T>& a, const U& b)
Mikhail 2014/05/07 12:34:28 I would not like us to implicitly compare RefPtr w
Mads Ager (chromium) 2014/05/07 12:40:09 It will not (compile-time error because of ambigui
tkent 2014/05/07 14:11:05 I also have a concern about adding the generic ver
+ {
+ return a.get() == &b;
+ }
+
+ template<typename T, typename U> inline bool operator==(const T& a, const RefPtr<U>& b)
+ {
+ return &a == b.get();
+ }
+
template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b)
{
return a.get() != b.get();
@@ -178,6 +188,16 @@ namespace WTF {
return a != b.get();
}
+ template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const U& b)
+ {
+ return a.get() != &b;
+ }
+
+ template<typename T, typename U> inline bool operator!=(const T& a, const RefPtr<U>& b)
+ {
+ return &a != b.get();
+ }
+
template<typename T, typename U> inline RefPtr<T> static_pointer_cast(const RefPtr<U>& p)
{
return RefPtr<T>(static_cast<T*>(p.get()));
« Source/core/svg/SVGElement.cpp ('K') | « Source/wtf/PassRefPtr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698