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

Unified Diff: Source/core/dom/MutationRecord.cpp

Issue 334713006: Use stricter typing for NodeLists throughout the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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/MutationRecord.h ('k') | Source/core/dom/NamedNodesCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/MutationRecord.cpp
diff --git a/Source/core/dom/MutationRecord.cpp b/Source/core/dom/MutationRecord.cpp
index 2f465d69bb3a0f9762c0ef9c881a5382b1ce8e7d..4d81e614d67d6d9379b50afaf2a9f6e1c2b550fc 100644
--- a/Source/core/dom/MutationRecord.cpp
+++ b/Source/core/dom/MutationRecord.cpp
@@ -44,7 +44,7 @@ namespace {
class ChildListRecord : public MutationRecord {
public:
- ChildListRecord(PassRefPtrWillBeRawPtr<Node> target, PassRefPtrWillBeRawPtr<NodeList> added, PassRefPtrWillBeRawPtr<NodeList> removed, PassRefPtrWillBeRawPtr<Node> previousSibling, PassRefPtrWillBeRawPtr<Node> nextSibling)
+ ChildListRecord(PassRefPtrWillBeRawPtr<Node> target, PassRefPtrWillBeRawPtr<StaticNodeList> added, PassRefPtrWillBeRawPtr<StaticNodeList> removed, PassRefPtrWillBeRawPtr<Node> previousSibling, PassRefPtrWillBeRawPtr<Node> nextSibling)
: m_target(target)
, m_addedNodes(added)
, m_removedNodes(removed)
@@ -66,14 +66,14 @@ public:
private:
virtual const AtomicString& type() OVERRIDE;
virtual Node* target() OVERRIDE { return m_target.get(); }
- virtual NodeList* addedNodes() OVERRIDE { return m_addedNodes.get(); }
- virtual NodeList* removedNodes() OVERRIDE { return m_removedNodes.get(); }
+ virtual StaticNodeList* addedNodes() OVERRIDE { return m_addedNodes.get(); }
+ virtual StaticNodeList* removedNodes() OVERRIDE { return m_removedNodes.get(); }
virtual Node* previousSibling() OVERRIDE { return m_previousSibling.get(); }
virtual Node* nextSibling() OVERRIDE { return m_nextSibling.get(); }
RefPtrWillBeMember<Node> m_target;
- RefPtrWillBeMember<NodeList> m_addedNodes;
- RefPtrWillBeMember<NodeList> m_removedNodes;
+ RefPtrWillBeMember<StaticNodeList> m_addedNodes;
+ RefPtrWillBeMember<StaticNodeList> m_removedNodes;
RefPtrWillBeMember<Node> m_previousSibling;
RefPtrWillBeMember<Node> m_nextSibling;
};
@@ -97,10 +97,10 @@ public:
private:
virtual Node* target() OVERRIDE { return m_target.get(); }
virtual String oldValue() OVERRIDE { return m_oldValue; }
- virtual NodeList* addedNodes() OVERRIDE { return lazilyInitializeEmptyNodeList(m_addedNodes); }
- virtual NodeList* removedNodes() OVERRIDE { return lazilyInitializeEmptyNodeList(m_removedNodes); }
+ virtual StaticNodeList* addedNodes() OVERRIDE { return lazilyInitializeEmptyNodeList(m_addedNodes); }
+ virtual StaticNodeList* removedNodes() OVERRIDE { return lazilyInitializeEmptyNodeList(m_removedNodes); }
- static NodeList* lazilyInitializeEmptyNodeList(RefPtrWillBeMember<NodeList>& nodeList)
+ static StaticNodeList* lazilyInitializeEmptyNodeList(RefPtrWillBeMember<StaticNodeList>& nodeList)
{
if (!nodeList)
nodeList = StaticNodeList::createEmpty();
@@ -109,8 +109,8 @@ private:
RefPtrWillBeMember<Node> m_target;
String m_oldValue;
- RefPtrWillBeMember<NodeList> m_addedNodes;
- RefPtrWillBeMember<NodeList> m_removedNodes;
+ RefPtrWillBeMember<StaticNodeList> m_addedNodes;
+ RefPtrWillBeMember<StaticNodeList> m_removedNodes;
};
class AttributesRecord : public RecordWithEmptyNodeLists {
@@ -158,8 +158,8 @@ public:
private:
virtual const AtomicString& type() OVERRIDE { return m_record->type(); }
virtual Node* target() OVERRIDE { return m_record->target(); }
- virtual NodeList* addedNodes() OVERRIDE { return m_record->addedNodes(); }
- virtual NodeList* removedNodes() OVERRIDE { return m_record->removedNodes(); }
+ virtual StaticNodeList* addedNodes() OVERRIDE { return m_record->addedNodes(); }
+ virtual StaticNodeList* removedNodes() OVERRIDE { return m_record->removedNodes(); }
virtual Node* previousSibling() OVERRIDE { return m_record->previousSibling(); }
virtual Node* nextSibling() OVERRIDE { return m_record->nextSibling(); }
virtual const AtomicString& attributeName() OVERRIDE { return m_record->attributeName(); }
@@ -190,7 +190,7 @@ const AtomicString& CharacterDataRecord::type()
} // namespace
-PassRefPtrWillBeRawPtr<MutationRecord> MutationRecord::createChildList(PassRefPtrWillBeRawPtr<Node> target, PassRefPtrWillBeRawPtr<NodeList> added, PassRefPtrWillBeRawPtr<NodeList> removed, PassRefPtrWillBeRawPtr<Node> previousSibling, PassRefPtrWillBeRawPtr<Node> nextSibling)
+PassRefPtrWillBeRawPtr<MutationRecord> MutationRecord::createChildList(PassRefPtrWillBeRawPtr<Node> target, PassRefPtrWillBeRawPtr<StaticNodeList> added, PassRefPtrWillBeRawPtr<StaticNodeList> removed, PassRefPtrWillBeRawPtr<Node> previousSibling, PassRefPtrWillBeRawPtr<Node> nextSibling)
{
return adoptRefWillBeNoop(new ChildListRecord(target, added, removed, previousSibling, nextSibling));
}
« no previous file with comments | « Source/core/dom/MutationRecord.h ('k') | Source/core/dom/NamedNodesCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698