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

Unified Diff: Source/core/frame/Frame.h

Issue 309083003: Add macros to define comparison operators to compare by reference or pointer interchangeably (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
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Frame.h
diff --git a/Source/core/frame/Frame.h b/Source/core/frame/Frame.h
index 72d5afda33fa7a5a756f3d5a2bae599e43eee36a..ba6b672098e8335ca7ac71e172f878066a257bf2 100644
--- a/Source/core/frame/Frame.h
+++ b/Source/core/frame/Frame.h
@@ -143,16 +143,7 @@ inline FrameTree& Frame::tree() const
}
// Allow equality comparisons of Frames by reference or pointer, interchangeably.
-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); }
+DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
} // namespace WebCore
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698