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

Unified Diff: Source/core/rendering/RenderObject.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/frame/Frame.h ('k') | Source/wtf/Assertions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index e696a29c813d8c98b9258575c86151668ffe76d7..a3122d838fb44c7d72e9545d9f86881477f1dcc1 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -1289,13 +1289,8 @@ private:
TemporaryChange<bool> m_disabler;
};
-// Allow equality comparisons of RenderObject's by reference or pointer, interchangeably.
-inline bool operator==(const RenderObject& a, const RenderObject& b) { return &a == &b; }
-inline bool operator==(const RenderObject& a, const RenderObject* b) { return &a == b; }
-inline bool operator==(const RenderObject* a, const RenderObject& b) { return a == &b; }
-inline bool operator!=(const RenderObject& a, const RenderObject& b) { return !(a == b); }
-inline bool operator!=(const RenderObject& a, const RenderObject* b) { return !(a == b); }
-inline bool operator!=(const RenderObject* a, const RenderObject& b) { return !(a == b); }
+// Allow equality comparisons of RenderObjects by reference or pointer, interchangeably.
+DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(RenderObject)
inline bool RenderObject::documentBeingDestroyed() const
{
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/wtf/Assertions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698