OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 PassRefPtr<Node> nextNode() | 292 PassRefPtr<Node> nextNode() |
293 { | 293 { |
294 if (LIKELY(!hasSnapshot())) { | 294 if (LIKELY(!hasSnapshot())) { |
295 RefPtr<Node> node = m_currentNode; | 295 RefPtr<Node> node = m_currentNode; |
296 if (node) | 296 if (node) |
297 m_currentNode = node->nextSibling(); | 297 m_currentNode = node->nextSibling(); |
298 return node.release(); | 298 return node.release(); |
299 } | 299 } |
300 Vector<RefPtr<Node> >& nodeVector = *m_childNodes; | 300 Vector<RefPtr<Node> >& nodeVector = *m_childNodes; |
301 if (m_currentIndex >= nodeVector.size()) | 301 if (m_currentIndex >= nodeVector.size()) |
302 return 0; | 302 return nullptr; |
303 return nodeVector[m_currentIndex++]; | 303 return nodeVector[m_currentIndex++]; |
304 } | 304 } |
305 | 305 |
306 void takeSnapshot() | 306 void takeSnapshot() |
307 { | 307 { |
308 if (hasSnapshot()) | 308 if (hasSnapshot()) |
309 return; | 309 return; |
310 m_childNodes = adoptPtr(new Vector<RefPtr<Node> >()); | 310 m_childNodes = adoptPtr(new Vector<RefPtr<Node> >()); |
311 Node* node = m_currentNode.get(); | 311 Node* node = m_currentNode.get(); |
312 while (node) { | 312 while (node) { |
(...skipping 19 matching lines...) Expand all Loading... |
332 | 332 |
333 RefPtr<Node> m_currentNode; | 333 RefPtr<Node> m_currentNode; |
334 unsigned m_currentIndex; | 334 unsigned m_currentIndex; |
335 OwnPtr<Vector<RefPtr<Node> > > m_childNodes; // Lazily instantiated. | 335 OwnPtr<Vector<RefPtr<Node> > > m_childNodes; // Lazily instantiated. |
336 ChildNodesLazySnapshot* m_nextSnapshot; | 336 ChildNodesLazySnapshot* m_nextSnapshot; |
337 }; | 337 }; |
338 | 338 |
339 } // namespace WebCore | 339 } // namespace WebCore |
340 | 340 |
341 #endif // ContainerNode_h | 341 #endif // ContainerNode_h |
OLD | NEW |