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

Unified Diff: Source/core/dom/Node.h

Issue 54273007: Use more references in ContainerNode code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix crashes Created 7 years, 1 month 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/Document.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 44ee6c7d3ec37187e2de39f1588e487deb545d2f..fe25b609320dd08d8d336ef2693d7ed3ce95bc7a 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -500,7 +500,7 @@ public:
bool isDescendantOf(const Node*) const;
bool contains(const Node*) const;
bool containsIncludingShadowDOM(const Node*) const;
- bool containsIncludingHostElements(const Node*) const;
+ bool containsIncludingHostElements(const Node&) const;
// FIXME: Remove this when crbug.com/265716 cleans up contains semantics.
bool bindingsContains(const Node* node) const { return containsIncludingShadowDOM(node); }
@@ -921,10 +921,10 @@ inline bool operator==(const Node* a, const Node& b) { return a == &b; }
inline bool operator!=(const Node& a, const Node& b) { return !(a == b); }
inline bool operator!=(const Node& a, const Node* b) { return !(a == b); }
inline bool operator!=(const Node* a, const Node& b) { return !(a == b); }
-inline bool operator==(const RefPtr<Node>& a, const Node& b) { return a.get() == &b; }
-inline bool operator==(const Node& a, const RefPtr<Node>& b) { return &a == b.get(); }
-inline bool operator!=(const RefPtr<Node>& a, const Node& b) { return !(a == b); }
-inline bool operator!=(const Node& a, const RefPtr<Node>& b) { return !(a == b); }
+inline bool operator==(const PassRefPtr<Node>& a, const Node& b) { return a.get() == &b; }
+inline bool operator==(const Node& a, const PassRefPtr<Node>& b) { return &a == b.get(); }
+inline bool operator!=(const PassRefPtr<Node>& a, const Node& b) { return !(a == b); }
+inline bool operator!=(const Node& a, const PassRefPtr<Node>& b) { return !(a == b); }
Inactive 2013/11/01 18:43:18 This one cost me some time debugging. I was doing
adamk 2013/11/01 18:56:50 Yikes! This is why the WebKit style guide always r
Inactive 2013/11/01 19:03:57 Oh, I think we can provide both if you are worried
adamk 2013/11/01 19:07:09 I admit it seems unlikely for the cost to be notic
Inactive 2013/11/01 19:39:01 Sadly it does not build. It is ambiguous according
adamk 2013/11/01 20:10:54 I think I'd actually prefer dropping the PassRefPt
#define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698