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

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

Issue 141683004: Use more const references in HTMLCollection / LiveNodeList (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
Index: Source/core/dom/LiveNodeList.h
diff --git a/Source/core/dom/LiveNodeList.h b/Source/core/dom/LiveNodeList.h
index bd4302f90f2c91dacb592fb817ac098140ba9703..a23ccdfa8e8651888493f80c2a4517eea78b1ed1 100644
--- a/Source/core/dom/LiveNodeList.h
+++ b/Source/core/dom/LiveNodeList.h
@@ -120,11 +120,11 @@ protected:
bool shouldOnlyIncludeDirectChildren() const { return m_shouldOnlyIncludeDirectChildren; }
private:
- Node* itemBeforeOrAfterCachedItem(unsigned offset, ContainerNode* root) const;
+ Node* itemBeforeOrAfterCachedItem(unsigned offset, const ContainerNode& root) const;
bool isLastItemCloserThanLastOrCachedItem(unsigned offset) const;
bool isFirstItemCloserThanCachedItem(unsigned offset) const;
Node* iterateForPreviousNode(Node* current) const;
- Node* itemBefore(Node* previousItem) const;
+ Node* itemBefore(const Node* previousItem) const;
void invalidateIdNameCacheMaps() const;
RefPtr<Node> m_ownerNode;
@@ -176,12 +176,12 @@ public:
virtual unsigned length() const OVERRIDE FINAL { return LiveNodeListBase::length(); }
virtual Node* item(unsigned offset) const OVERRIDE FINAL { return LiveNodeListBase::item(offset); }
virtual Node* namedItem(const AtomicString&) const OVERRIDE FINAL;
- virtual bool nodeMatches(Element*) const = 0;
+ virtual bool nodeMatches(const Element&) const = 0;
// Avoid ambiguity since both NodeList and LiveNodeListBase have an ownerNode() method.
using LiveNodeListBase::ownerNode;
- Node* traverseToFirstElement(ContainerNode& root) const;
- Node* traverseForwardToOffset(unsigned offset, Node& currentNode, unsigned& currentOffset, ContainerNode* root) const;
+ Node* traverseToFirstElement(const ContainerNode& root) const;
+ Node* traverseForwardToOffset(unsigned offset, Node& currentNode, unsigned& currentOffset, const ContainerNode& root) const;
private:
virtual bool isLiveNodeList() const OVERRIDE FINAL { return true; }

Powered by Google App Engine
This is Rietveld 408576698