Index: Source/core/frame/Frame.h |
diff --git a/Source/core/frame/Frame.h b/Source/core/frame/Frame.h |
index 5a78fa5477528314f7001e22b8fd6b7ee17469ce..72d5afda33fa7a5a756f3d5a2bae599e43eee36a 100644 |
--- a/Source/core/frame/Frame.h |
+++ b/Source/core/frame/Frame.h |
@@ -142,6 +142,18 @@ inline FrameTree& Frame::tree() const |
return m_treeNode; |
} |
+// Allow equality comparisons of Frames by reference or pointer, interchangeably. |
eseidel
2014/06/02 05:20:27
Can we make this a macro? Seems silly to have to
Inactive
2014/06/02 12:16:37
Makes sense. We already duplicate this for several
|
+inline bool operator==(const Frame& a, const Frame& b) { return &a == &b; } |
+inline bool operator==(const Frame& a, const Frame* b) { return &a == b; } |
+inline bool operator==(const Frame* a, const Frame& b) { return a == &b; } |
+inline bool operator!=(const Frame& a, const Frame& b) { return !(a == b); } |
+inline bool operator!=(const Frame& a, const Frame* b) { return !(a == b); } |
+inline bool operator!=(const Frame* a, const Frame& b) { return !(a == b); } |
+inline bool operator==(const PassRefPtr<Frame>& a, const Frame& b) { return a.get() == &b; } |
+inline bool operator==(const Frame& a, const PassRefPtr<Frame>& b) { return &a == b.get(); } |
+inline bool operator!=(const PassRefPtr<Frame>& a, const Frame& b) { return !(a == b); } |
+inline bool operator!=(const Frame& a, const PassRefPtr<Frame>& b) { return !(a == b); } |
+ |
} // namespace WebCore |
#endif // Frame_h |