OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
34 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
35 #include "wtf/Vector.h" | 35 #include "wtf/Vector.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 class Node; | 39 class Node; |
40 | 40 |
41 class StaticNodeList FINAL : public NodeList { | 41 class StaticNodeList FINAL : public NodeList { |
42 public: | 42 public: |
43 static PassRefPtr<StaticNodeList> adopt(Vector<RefPtr<Node> >& nodes) | 43 static PassRefPtr<StaticNodeList> adopt(Vector<RefPtr<Node> >&); |
44 { | |
45 RefPtr<StaticNodeList> nodeList = adoptRef(new StaticNodeList); | |
46 nodeList->m_nodes.swap(nodes); | |
47 return nodeList.release(); | |
48 } | |
49 | 44 |
50 static PassRefPtr<StaticNodeList> createEmpty() | 45 static PassRefPtr<StaticNodeList> createEmpty() |
51 { | 46 { |
52 return adoptRef(new StaticNodeList); | 47 return adoptRef(new StaticNodeList); |
53 } | 48 } |
54 | 49 |
| 50 virtual ~StaticNodeList(); |
| 51 |
55 virtual unsigned length() const OVERRIDE; | 52 virtual unsigned length() const OVERRIDE; |
56 virtual Node* item(unsigned index) const OVERRIDE; | 53 virtual Node* item(unsigned index) const OVERRIDE; |
57 virtual Node* namedItem(const AtomicString&) const OVERRIDE; | 54 virtual Node* namedItem(const AtomicString&) const OVERRIDE; |
58 | 55 |
59 private: | 56 private: |
60 Vector<RefPtr<Node> > m_nodes; | 57 Vector<RefPtr<Node> > m_nodes; |
61 }; | 58 }; |
62 | 59 |
63 } // namespace WebCore | 60 } // namespace WebCore |
64 | 61 |
65 #endif // StaticNodeList_h | 62 #endif // StaticNodeList_h |
OLD | NEW |