| 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, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 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 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 protected: | 101 protected: |
| 102 NodeRareDataBase(RenderObject* renderer) | 102 NodeRareDataBase(RenderObject* renderer) |
| 103 : m_renderer(renderer) | 103 : m_renderer(renderer) |
| 104 { } | 104 { } |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 RenderObject* m_renderer; | 107 RenderObject* m_renderer; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 class Node : public EventTarget, public ScriptWrappable, public TreeSharedWillBe
RefCountedGarbageCollected<Node> { | 110 #if ENABLE(OILPAN) |
| 111 #define NODE_BASE_CLASSES public GarbageCollectedFinalized<Node>, public EventTa
rget, public ScriptWrappable |
| 112 #else |
| 113 // TreeShared should be the last to pack TreeShared::m_refCount and |
| 114 // Node::m_nodeFlags on 64bit platforms. |
| 115 #define NODE_BASE_CLASSES public EventTarget, public ScriptWrappable, public Tre
eShared<Node> |
| 116 #endif |
| 117 |
| 118 class Node : NODE_BASE_CLASSES { |
| 111 friend class Document; | 119 friend class Document; |
| 112 friend class TreeScope; | 120 friend class TreeScope; |
| 113 friend class TreeScopeAdopter; | 121 friend class TreeScopeAdopter; |
| 114 | 122 |
| 115 DEFINE_EVENT_TARGET_REFCOUNTING(TreeSharedWillBeRefCountedGarbageCollected<N
ode>); | 123 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(TreeShared<Node>); |
| 116 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Node); | 124 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Node); |
| 117 public: | 125 public: |
| 118 enum NodeType { | 126 enum NodeType { |
| 119 ELEMENT_NODE = 1, | 127 ELEMENT_NODE = 1, |
| 120 ATTRIBUTE_NODE = 2, | 128 ATTRIBUTE_NODE = 2, |
| 121 TEXT_NODE = 3, | 129 TEXT_NODE = 3, |
| 122 CDATA_SECTION_NODE = 4, | 130 CDATA_SECTION_NODE = 4, |
| 123 PROCESSING_INSTRUCTION_NODE = 7, | 131 PROCESSING_INSTRUCTION_NODE = 7, |
| 124 COMMENT_NODE = 8, | 132 COMMENT_NODE = 8, |
| 125 DOCUMENT_NODE = 9, | 133 DOCUMENT_NODE = 9, |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 // This requires isClassName(const Node&). | 894 // This requires isClassName(const Node&). |
| 887 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 895 #define DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| 888 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ | 896 template<typename T> inline thisType* to##thisType(const RefPtr<T>& node) {
return to##thisType(node.get()); } \ |
| 889 DEFINE_TYPE_CASTS(thisType, Node, node, is##thisType(*node), is##thisType(no
de)) | 897 DEFINE_TYPE_CASTS(thisType, Node, node, is##thisType(*node), is##thisType(no
de)) |
| 890 | 898 |
| 891 #define DECLARE_NODE_FACTORY(T) \ | 899 #define DECLARE_NODE_FACTORY(T) \ |
| 892 static PassRefPtrWillBeRawPtr<T> create(Document&) | 900 static PassRefPtrWillBeRawPtr<T> create(Document&) |
| 893 #define DEFINE_NODE_FACTORY(T) \ | 901 #define DEFINE_NODE_FACTORY(T) \ |
| 894 PassRefPtrWillBeRawPtr<T> T::create(Document& document) \ | 902 PassRefPtrWillBeRawPtr<T> T::create(Document& document) \ |
| 895 { \ | 903 { \ |
| 896 return adoptRefWillBeRefCountedGarbageCollected(new T(document)); \ | 904 return adoptRefWillBeNoop(new T(document)); \ |
| 897 } | 905 } |
| 898 | 906 |
| 899 } // namespace WebCore | 907 } // namespace WebCore |
| 900 | 908 |
| 901 #ifndef NDEBUG | 909 #ifndef NDEBUG |
| 902 // Outside the WebCore namespace for ease of invocation from gdb. | 910 // Outside the WebCore namespace for ease of invocation from gdb. |
| 903 void showNode(const WebCore::Node*); | 911 void showNode(const WebCore::Node*); |
| 904 void showTree(const WebCore::Node*); | 912 void showTree(const WebCore::Node*); |
| 905 void showNodePath(const WebCore::Node*); | 913 void showNodePath(const WebCore::Node*); |
| 906 #endif | 914 #endif |
| 907 | 915 |
| 908 #endif | 916 #endif |
| OLD | NEW |