| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
| 4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| 11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
| 12 * | 12 * |
| 13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
| 17 * | 17 * |
| 18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
| 19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
| 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
| 22 * | 22 * |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef NodeFilter_h | 25 #ifndef NodeFilter_h |
| 26 #define NodeFilter_h | 26 #define NodeFilter_h |
| 27 | 27 |
| 28 #include "bindings/v8/ScriptWrappable.h" | 28 #include "bindings/v8/ScriptWrappable.h" |
| 29 #include "core/dom/NodeFilterCondition.h" | 29 #include "core/dom/NodeFilterCondition.h" |
| 30 #include "platform/heap/Handle.h" |
| 30 #include "wtf/RefPtr.h" | 31 #include "wtf/RefPtr.h" |
| 31 | 32 |
| 32 namespace WebCore { | 33 namespace WebCore { |
| 33 | 34 |
| 34 class NodeFilter : public RefCounted<NodeFilter>, public ScriptWrappable { | 35 class NodeFilter FINAL : public RefCountedWillBeGarbageCollectedFinalized<NodeFi
lter>, public ScriptWrappable { |
| 35 public: | 36 public: |
| 36 /** | 37 /** |
| 37 * The following constants are returned by the acceptNode() | 38 * The following constants are returned by the acceptNode() |
| 38 * method: | 39 * method: |
| 39 */ | 40 */ |
| 40 enum { | 41 enum { |
| 41 FILTER_ACCEPT = 1, | 42 FILTER_ACCEPT = 1, |
| 42 FILTER_REJECT = 2, | 43 FILTER_REJECT = 2, |
| 43 FILTER_SKIP = 3 | 44 FILTER_SKIP = 3 |
| 44 }; | 45 }; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 SHOW_ENTITY_REFERENCE = 0x00000010, | 59 SHOW_ENTITY_REFERENCE = 0x00000010, |
| 59 SHOW_ENTITY = 0x00000020, | 60 SHOW_ENTITY = 0x00000020, |
| 60 SHOW_PROCESSING_INSTRUCTION = 0x00000040, | 61 SHOW_PROCESSING_INSTRUCTION = 0x00000040, |
| 61 SHOW_COMMENT = 0x00000080, | 62 SHOW_COMMENT = 0x00000080, |
| 62 SHOW_DOCUMENT = 0x00000100, | 63 SHOW_DOCUMENT = 0x00000100, |
| 63 SHOW_DOCUMENT_TYPE = 0x00000200, | 64 SHOW_DOCUMENT_TYPE = 0x00000200, |
| 64 SHOW_DOCUMENT_FRAGMENT = 0x00000400, | 65 SHOW_DOCUMENT_FRAGMENT = 0x00000400, |
| 65 SHOW_NOTATION = 0x00000800 | 66 SHOW_NOTATION = 0x00000800 |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 static PassRefPtr<NodeFilter> create(PassRefPtr<NodeFilterCondition> conditi
on) | 69 static PassRefPtrWillBeRawPtr<NodeFilter> create(PassRefPtrWillBeRawPtr<Node
FilterCondition> condition) |
| 69 { | 70 { |
| 70 return adoptRef(new NodeFilter(condition)); | 71 return adoptRefWillBeNoop(new NodeFilter(condition)); |
| 71 } | 72 } |
| 72 | 73 |
| 73 static PassRefPtr<NodeFilter> create() | 74 static PassRefPtrWillBeRawPtr<NodeFilter> create() |
| 74 { | 75 { |
| 75 return adoptRef(new NodeFilter()); | 76 return adoptRefWillBeNoop(new NodeFilter()); |
| 76 } | 77 } |
| 77 | 78 |
| 78 short acceptNode(Node*, ExceptionState&) const; | 79 short acceptNode(Node*, ExceptionState&) const; |
| 79 | 80 |
| 80 void setCondition(PassRefPtr<NodeFilterCondition> condition) | 81 void setCondition(PassRefPtrWillBeRawPtr<NodeFilterCondition> condition) |
| 81 { | 82 { |
| 82 m_condition = condition; | 83 m_condition = condition; |
| 83 } | 84 } |
| 84 | 85 |
| 86 void trace(Visitor*); |
| 87 |
| 85 private: | 88 private: |
| 86 explicit NodeFilter(PassRefPtr<NodeFilterCondition> condition) : m_condition
(condition) | 89 explicit NodeFilter(PassRefPtrWillBeRawPtr<NodeFilterCondition> condition) :
m_condition(condition) |
| 87 { | 90 { |
| 88 ScriptWrappable::init(this); | 91 ScriptWrappable::init(this); |
| 89 } | 92 } |
| 90 | 93 |
| 91 NodeFilter() | 94 NodeFilter() |
| 92 { | 95 { |
| 93 ScriptWrappable::init(this); | 96 ScriptWrappable::init(this); |
| 94 } | 97 } |
| 95 | 98 |
| 96 RefPtr<NodeFilterCondition> m_condition; | 99 RefPtrWillBeMember<NodeFilterCondition> m_condition; |
| 97 }; | 100 }; |
| 98 | 101 |
| 99 } // namespace WebCore | 102 } // namespace WebCore |
| 100 | 103 |
| 101 #endif // NodeFilter_h | 104 #endif // NodeFilter_h |
| OLD | NEW |