OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> | 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "wtf/PassOwnPtr.h" | 35 #include "wtf/PassOwnPtr.h" |
36 #include "wtf/text/AtomicString.h" | 36 #include "wtf/text/AtomicString.h" |
37 #include "wtf/text/StringHash.h" | 37 #include "wtf/text/StringHash.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 class LabelsNodeList; | 41 class LabelsNodeList; |
42 class RadioNodeList; | 42 class RadioNodeList; |
43 class TreeScope; | 43 class TreeScope; |
44 | 44 |
45 class NodeListsNodeData { | 45 class NodeListsNodeData FINAL : public NoBaseWillBeGarbageCollectedFinalized<Nod eListsNodeData> { |
46 WTF_MAKE_NONCOPYABLE(NodeListsNodeData); WTF_MAKE_FAST_ALLOCATED; | 46 WTF_MAKE_NONCOPYABLE(NodeListsNodeData); |
47 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | |
47 public: | 48 public: |
48 void clearChildNodeListCache() | 49 void clearChildNodeListCache() |
49 { | 50 { |
50 if (m_childNodeList && m_childNodeList->isChildNodeList()) | 51 if (m_childNodeList && m_childNodeList->isChildNodeList()) |
51 toChildNodeList(m_childNodeList)->invalidateCache(); | 52 toChildNodeList(m_childNodeList)->invalidateCache(); |
52 } | 53 } |
53 | 54 |
54 PassRefPtr<ChildNodeList> ensureChildNodeList(ContainerNode& node) | 55 PassRefPtrWillBeRawPtr<ChildNodeList> ensureChildNodeList(ContainerNode& nod e) |
55 { | 56 { |
56 if (m_childNodeList) | 57 if (m_childNodeList) |
57 return toChildNodeList(m_childNodeList); | 58 return toChildNodeList(m_childNodeList); |
58 RefPtr<ChildNodeList> list = ChildNodeList::create(node); | 59 RefPtrWillBeRawPtr<ChildNodeList> list = ChildNodeList::create(node); |
59 m_childNodeList = list.get(); | 60 m_childNodeList = list.get(); |
60 return list.release(); | 61 return list.release(); |
61 } | 62 } |
62 | 63 |
63 PassRefPtr<EmptyNodeList> ensureEmptyChildNodeList(Node& node) | 64 PassRefPtrWillBeRawPtr<EmptyNodeList> ensureEmptyChildNodeList(Node& node) |
64 { | 65 { |
65 if (m_childNodeList) | 66 if (m_childNodeList) |
66 return toEmptyNodeList(m_childNodeList); | 67 return toEmptyNodeList(m_childNodeList); |
67 RefPtr<EmptyNodeList> list = EmptyNodeList::create(node); | 68 RefPtrWillBeRawPtr<EmptyNodeList> list = EmptyNodeList::create(node); |
68 m_childNodeList = list.get(); | 69 m_childNodeList = list.get(); |
69 return list.release(); | 70 return list.release(); |
70 } | 71 } |
71 | 72 |
73 #if !ENABLE(OILPAN) | |
72 void removeChildNodeList(ChildNodeList* list) | 74 void removeChildNodeList(ChildNodeList* list) |
73 { | 75 { |
74 ASSERT(m_childNodeList == list); | 76 ASSERT(m_childNodeList == list); |
75 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) | 77 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) |
76 return; | 78 return; |
77 m_childNodeList = 0; | 79 m_childNodeList = nullptr; |
78 } | 80 } |
79 | 81 |
80 void removeEmptyChildNodeList(EmptyNodeList* list) | 82 void removeEmptyChildNodeList(EmptyNodeList* list) |
81 { | 83 { |
82 ASSERT(m_childNodeList == list); | 84 ASSERT(m_childNodeList == list); |
83 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) | 85 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) |
84 return; | 86 return; |
85 m_childNodeList = 0; | 87 m_childNodeList = nullptr; |
86 } | 88 } |
89 #endif | |
87 | 90 |
88 struct NodeListAtomicCacheMapEntryHash { | 91 struct NodeListAtomicCacheMapEntryHash { |
89 static unsigned hash(const std::pair<unsigned char, StringImpl*>& entry) | 92 static unsigned hash(const std::pair<unsigned char, StringImpl*>& entry) |
90 { | 93 { |
91 return DefaultHash<StringImpl*>::Hash::hash(entry.second) + entry.fi rst; | 94 return DefaultHash<StringImpl*>::Hash::hash(entry.second) + entry.fi rst; |
92 } | 95 } |
93 static bool equal(const std::pair<unsigned char, StringImpl*>& a, const std::pair<unsigned char, StringImpl*>& b) { return a == b; } | 96 static bool equal(const std::pair<unsigned char, StringImpl*>& a, const std::pair<unsigned char, StringImpl*>& b) { return a == b; } |
94 static const bool safeToCompareToEmptyOrDeleted = DefaultHash<StringImpl *>::Hash::safeToCompareToEmptyOrDeleted; | 97 static const bool safeToCompareToEmptyOrDeleted = DefaultHash<StringImpl *>::Hash::safeToCompareToEmptyOrDeleted; |
95 }; | 98 }; |
96 | 99 |
97 typedef HashMap<std::pair<unsigned char, StringImpl*>, LiveNodeListBase*, No deListAtomicCacheMapEntryHash> NodeListAtomicNameCacheMap; | 100 // Oilpan: keep a weak reference to the collection objects. |
98 typedef HashMap<QualifiedName, TagCollection*> TagCollectionCacheNS; | 101 // Explicit object unregistration in a non-Oilpan setting |
102 // on object destruction is replaced by the garbage collector | |
103 // clearing out their weak reference. | |
104 typedef WillBeHeapHashMap<std::pair<unsigned char, StringImpl*>, RawPtrWillB eWeakMember<LiveNodeListBase>, NodeListAtomicCacheMapEntryHash> NodeListAtomicNa meCacheMap; | |
105 typedef WillBeHeapHashMap<QualifiedName, RawPtrWillBeWeakMember<TagCollectio n> > TagCollectionCacheNS; | |
99 | 106 |
100 template<typename T> | 107 template<typename T> |
101 PassRefPtr<T> addCache(ContainerNode& node, CollectionType collectionType, c onst AtomicString& name) | 108 PassRefPtrWillBeRawPtr<T> addCache(ContainerNode& node, CollectionType colle ctionType, const AtomicString& name) |
102 { | 109 { |
103 NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(na medNodeListKey(collectionType, name), 0); | 110 NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(na medNodeListKey(collectionType, name), nullptr); |
104 if (!result.isNewEntry) | 111 if (!result.isNewEntry) |
105 return static_cast<T*>(result.storedValue->value); | 112 return static_cast<T*>(result.storedValue->value.get()); |
106 | 113 |
107 RefPtr<T> list = T::create(node, collectionType, name); | 114 RefPtrWillBeRawPtr<T> list = T::create(node, collectionType, name); |
108 result.storedValue->value = list.get(); | 115 result.storedValue->value = list.get(); |
109 return list.release(); | 116 return list.release(); |
110 } | 117 } |
111 | 118 |
112 template<typename T> | 119 template<typename T> |
113 PassRefPtr<T> addCache(ContainerNode& node, CollectionType collectionType) | 120 PassRefPtrWillBeRawPtr<T> addCache(ContainerNode& node, CollectionType colle ctionType) |
114 { | 121 { |
115 NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(na medNodeListKey(collectionType, starAtom), 0); | 122 NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(na medNodeListKey(collectionType, starAtom), nullptr); |
116 if (!result.isNewEntry) | 123 if (!result.isNewEntry) |
117 return static_cast<T*>(result.storedValue->value); | 124 return static_cast<T*>(result.storedValue->value.get()); |
118 | 125 |
119 RefPtr<T> list = T::create(node, collectionType); | 126 RefPtrWillBeRawPtr<T> list = T::create(node, collectionType); |
120 result.storedValue->value = list.get(); | 127 result.storedValue->value = list.get(); |
121 return list.release(); | 128 return list.release(); |
122 } | 129 } |
123 | 130 |
124 template<typename T> | 131 template<typename T> |
125 T* cached(CollectionType collectionType) | 132 T* cached(CollectionType collectionType) |
126 { | 133 { |
134 #if ENABLE(OILPAN) | |
135 // FIXME: Oilpan: unify, if possible. The lookup resolves to a T& with O ilpan, | |
136 // whereas non-Oilpan resolves to RawPtr<T>. | |
127 return static_cast<T*>(m_atomicNameCaches.get(namedNodeListKey(collectio nType, starAtom))); | 137 return static_cast<T*>(m_atomicNameCaches.get(namedNodeListKey(collectio nType, starAtom))); |
138 #else | |
139 return static_cast<T*>(m_atomicNameCaches.get(namedNodeListKey(collectio nType, starAtom)).get()); | |
140 #endif | |
128 } | 141 } |
129 | 142 |
130 PassRefPtr<TagCollection> addCache(ContainerNode& node, const AtomicString& namespaceURI, const AtomicString& localName) | 143 PassRefPtrWillBeRawPtr<TagCollection> addCache(ContainerNode& node, const At omicString& namespaceURI, const AtomicString& localName) |
131 { | 144 { |
132 QualifiedName name(nullAtom, localName, namespaceURI); | 145 QualifiedName name(nullAtom, localName, namespaceURI); |
133 TagCollectionCacheNS::AddResult result = m_tagCollectionCacheNS.add(name , 0); | 146 TagCollectionCacheNS::AddResult result = m_tagCollectionCacheNS.add(name , nullptr); |
134 if (!result.isNewEntry) | 147 if (!result.isNewEntry) |
135 return result.storedValue->value; | 148 return result.storedValue->value; |
136 | 149 |
137 RefPtr<TagCollection> list = TagCollection::create(node, namespaceURI, l ocalName); | 150 RefPtrWillBeRawPtr<TagCollection> list = TagCollection::create(node, nam espaceURI, localName); |
138 result.storedValue->value = list.get(); | 151 result.storedValue->value = list.get(); |
139 return list.release(); | 152 return list.release(); |
140 } | 153 } |
141 | 154 |
155 #if !ENABLE(OILPAN) | |
142 void removeCache(LiveNodeListBase* list, CollectionType collectionType, cons t AtomicString& name = starAtom) | 156 void removeCache(LiveNodeListBase* list, CollectionType collectionType, cons t AtomicString& name = starAtom) |
143 { | 157 { |
144 ASSERT(list == m_atomicNameCaches.get(namedNodeListKey(collectionType, n ame))); | 158 ASSERT(list == m_atomicNameCaches.get(namedNodeListKey(collectionType, n ame))); |
145 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) | 159 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) |
146 return; | 160 return; |
147 m_atomicNameCaches.remove(namedNodeListKey(collectionType, name)); | 161 m_atomicNameCaches.remove(namedNodeListKey(collectionType, name)); |
148 } | 162 } |
149 | 163 |
150 void removeCache(LiveNodeListBase* list, const AtomicString& namespaceURI, c onst AtomicString& localName) | 164 void removeCache(LiveNodeListBase* list, const AtomicString& namespaceURI, c onst AtomicString& localName) |
151 { | 165 { |
152 QualifiedName name(nullAtom, localName, namespaceURI); | 166 QualifiedName name(nullAtom, localName, namespaceURI); |
153 ASSERT(list == m_tagCollectionCacheNS.get(name)); | 167 ASSERT(list == m_tagCollectionCacheNS.get(name)); |
154 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) | 168 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) |
155 return; | 169 return; |
156 m_tagCollectionCacheNS.remove(name); | 170 m_tagCollectionCacheNS.remove(name); |
157 } | 171 } |
172 #endif | |
158 | 173 |
159 static PassOwnPtr<NodeListsNodeData> create() | 174 #if ENABLE(OILPAN) |
175 static PassOwnPtrWillBeRawPtr<NodeListsNodeData> create(NodeRareData* owner) | |
Mads Ager (chromium)
2014/05/20 06:58:57
Since we have the #if around the entire definition
sof
2014/05/20 08:27:49
Done.
| |
160 { | 176 { |
161 return adoptPtr(new NodeListsNodeData); | 177 return adoptPtrWillBeNoop(new NodeListsNodeData(owner)); |
162 } | 178 } |
179 #else | |
180 static PassOwnPtrWillBeRawPtr<NodeListsNodeData> create() | |
181 { | |
182 return adoptPtrWillBeNoop(new NodeListsNodeData); | |
183 } | |
184 #endif | |
163 | 185 |
164 void invalidateCaches(const QualifiedName* attrName = 0); | 186 void invalidateCaches(const QualifiedName* attrName = 0); |
165 bool isEmpty() const | 187 bool isEmpty() const |
166 { | 188 { |
167 return m_atomicNameCaches.isEmpty() && m_tagCollectionCacheNS.isEmpty(); | 189 return m_atomicNameCaches.isEmpty() && m_tagCollectionCacheNS.isEmpty(); |
168 } | 190 } |
169 | 191 |
170 void adoptTreeScope() | 192 void adoptTreeScope() |
171 { | 193 { |
172 invalidateCaches(); | 194 invalidateCaches(); |
(...skipping 10 matching lines...) Expand all Loading... | |
183 } | 205 } |
184 | 206 |
185 TagCollectionCacheNS::const_iterator tagEnd = m_tagCollectionCacheNS.end (); | 207 TagCollectionCacheNS::const_iterator tagEnd = m_tagCollectionCacheNS.end (); |
186 for (TagCollectionCacheNS::const_iterator it = m_tagCollectionCacheNS.be gin(); it != tagEnd; ++it) { | 208 for (TagCollectionCacheNS::const_iterator it = m_tagCollectionCacheNS.be gin(); it != tagEnd; ++it) { |
187 LiveNodeListBase* list = it->value; | 209 LiveNodeListBase* list = it->value; |
188 ASSERT(!list->isRootedAtDocument()); | 210 ASSERT(!list->isRootedAtDocument()); |
189 list->didMoveToDocument(oldDocument, newDocument); | 211 list->didMoveToDocument(oldDocument, newDocument); |
190 } | 212 } |
191 } | 213 } |
192 | 214 |
215 #if ENABLE(OILPAN) | |
Mads Ager (chromium)
2014/05/20 06:58:57
Nit: For Document and friends I have not used #if
sof
2014/05/20 08:27:49
I will leave it out for non-Oilpan for now, unpret
| |
216 void clearWeakMembers(Visitor*); | |
217 #endif | |
218 | |
219 void trace(Visitor* visitor) | |
220 { | |
221 visitor->trace(m_childNodeList); | |
222 visitor->trace(m_atomicNameCaches); | |
223 visitor->trace(m_tagCollectionCacheNS); | |
224 #if ENABLE(OILPAN) | |
Mads Ager (chromium)
2014/05/20 06:58:57
Nit: Maybe we should just #if out the entire body
sof
2014/05/20 08:27:49
Done.
| |
225 visitor->trace(m_owner); | |
sof
2014/05/19 21:40:49
Not sure about this trace() call (and the one for
Erik Corry
2014/05/19 21:45:01
I think you just have to mention the fields in the
zerny-chromium
2014/05/20 06:07:43
This is fine as is. The plugin will/should identif
sof
2014/05/20 06:23:59
Oh, that sounds encouraging. I used isAlive() over
zerny-chromium
2014/05/20 07:58:00
I think it is. The plugin checks trace methods eve
sof
2014/05/20 08:27:49
You're quite right, not reported as trace() proble
| |
226 visitor->registerWeakMembers<NodeListsNodeData, &NodeListsNodeData::clea rWeakMembers>(this); | |
227 #endif | |
228 } | |
229 | |
193 private: | 230 private: |
231 #if ENABLE(OILPAN) | |
232 NodeListsNodeData(NodeRareData* owner) | |
Mads Ager (chromium)
2014/05/20 06:58:57
explicit
sof
2014/05/20 08:27:49
Done.
| |
233 #else | |
194 NodeListsNodeData() | 234 NodeListsNodeData() |
195 : m_childNodeList(0) | 235 #endif |
236 : m_childNodeList(nullptr) | |
237 #if ENABLE(OILPAN) | |
238 , m_owner(owner) | |
239 #endif | |
196 { } | 240 { } |
197 | 241 |
198 std::pair<unsigned char, StringImpl*> namedNodeListKey(CollectionType type, const AtomicString& name) | 242 std::pair<unsigned char, StringImpl*> namedNodeListKey(CollectionType type, const AtomicString& name) |
199 { | 243 { |
200 // Holding the raw StringImpl is safe because |name| is retained by the NodeList and the NodeList | 244 // Holding the raw StringImpl is safe because |name| is retained by the NodeList and the NodeList |
201 // is reponsible for removing itself from the cache on deletion. | 245 // is reponsible for removing itself from the cache on deletion. |
202 return std::pair<unsigned char, StringImpl*>(type, name.impl()); | 246 return std::pair<unsigned char, StringImpl*>(type, name.impl()); |
203 } | 247 } |
204 | 248 |
249 #if !ENABLE(OILPAN) | |
205 bool deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(Node&); | 250 bool deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(Node&); |
251 #endif | |
206 | 252 |
207 // Can be a ChildNodeList or an EmptyNodeList. | 253 // Can be a ChildNodeList or an EmptyNodeList. |
208 NodeList* m_childNodeList; | 254 RawPtrWillBeWeakMember<NodeList> m_childNodeList; |
209 NodeListAtomicNameCacheMap m_atomicNameCaches; | 255 NodeListAtomicNameCacheMap m_atomicNameCaches; |
210 TagCollectionCacheNS m_tagCollectionCacheNS; | 256 TagCollectionCacheNS m_tagCollectionCacheNS; |
257 #if ENABLE(OILPAN) | |
258 WeakMember<NodeRareData> m_owner; | |
Mads Ager (chromium)
2014/05/20 06:58:57
The NodeRareData owns the NodeListNodeData and the
sof
2014/05/20 08:27:49
thanks for bringing clarity; that makes good sense
| |
259 #endif | |
211 }; | 260 }; |
212 | 261 |
213 class NodeMutationObserverData FINAL : public NoBaseWillBeGarbageCollected<NodeM utationObserverData> { | 262 class NodeMutationObserverData FINAL : public NoBaseWillBeGarbageCollected<NodeM utationObserverData> { |
214 WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); | 263 WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); |
215 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 264 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
216 public: | 265 public: |
217 WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> > registry ; | 266 WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> > registry ; |
218 WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration> > transie ntRegistry; | 267 WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration> > transie ntRegistry; |
219 | 268 |
220 static PassOwnPtrWillBeRawPtr<NodeMutationObserverData> create() | 269 static PassOwnPtrWillBeRawPtr<NodeMutationObserverData> create() |
(...skipping 17 matching lines...) Expand all Loading... | |
238 public: | 287 public: |
239 static NodeRareData* create(RenderObject* renderer) | 288 static NodeRareData* create(RenderObject* renderer) |
240 { | 289 { |
241 return new NodeRareData(renderer); | 290 return new NodeRareData(renderer); |
242 } | 291 } |
243 | 292 |
244 void clearNodeLists() { m_nodeLists.clear(); } | 293 void clearNodeLists() { m_nodeLists.clear(); } |
245 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } | 294 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } |
246 NodeListsNodeData& ensureNodeLists() | 295 NodeListsNodeData& ensureNodeLists() |
247 { | 296 { |
248 if (!m_nodeLists) | 297 if (!m_nodeLists) { |
298 #if ENABLE(OILPAN) | |
299 m_nodeLists = NodeListsNodeData::create(this); | |
300 #else | |
249 m_nodeLists = NodeListsNodeData::create(); | 301 m_nodeLists = NodeListsNodeData::create(); |
302 #endif | |
303 } | |
250 return *m_nodeLists; | 304 return *m_nodeLists; |
251 } | 305 } |
252 | 306 |
253 NodeMutationObserverData* mutationObserverData() { return m_mutationObserver Data.get(); } | 307 NodeMutationObserverData* mutationObserverData() { return m_mutationObserver Data.get(); } |
254 NodeMutationObserverData& ensureMutationObserverData() | 308 NodeMutationObserverData& ensureMutationObserverData() |
255 { | 309 { |
256 if (!m_mutationObserverData) | 310 if (!m_mutationObserverData) |
257 m_mutationObserverData = NodeMutationObserverData::create(); | 311 m_mutationObserverData = NodeMutationObserverData::create(); |
258 return *m_mutationObserverData; | 312 return *m_mutationObserverData; |
259 } | 313 } |
(...skipping 22 matching lines...) Expand all Loading... | |
282 enum { | 336 enum { |
283 ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames. | 337 ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames. |
284 }; | 338 }; |
285 | 339 |
286 void trace(Visitor*); | 340 void trace(Visitor*); |
287 | 341 |
288 void traceAfterDispatch(Visitor*); | 342 void traceAfterDispatch(Visitor*); |
289 void finalizeGarbageCollectedObject(); | 343 void finalizeGarbageCollectedObject(); |
290 | 344 |
291 protected: | 345 protected: |
292 NodeRareData(RenderObject* renderer) | 346 explicit NodeRareData(RenderObject* renderer) |
293 : NodeRareDataBase(renderer) | 347 : NodeRareDataBase(renderer) |
294 , m_connectedFrameCount(0) | 348 , m_connectedFrameCount(0) |
295 , m_elementFlags(0) | 349 , m_elementFlags(0) |
296 , m_restyleFlags(0) | 350 , m_restyleFlags(0) |
297 , m_isElementRareData(false) | 351 , m_isElementRareData(false) |
298 { } | 352 { } |
299 | 353 |
300 private: | 354 private: |
301 OwnPtr<NodeListsNodeData> m_nodeLists; | 355 OwnPtrWillBeMember<NodeListsNodeData> m_nodeLists; |
302 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData; | 356 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData; |
303 | 357 |
304 unsigned m_connectedFrameCount : ConnectedFrameCountBits; | 358 unsigned m_connectedFrameCount : ConnectedFrameCountBits; |
305 unsigned m_elementFlags : NumberOfElementFlags; | 359 unsigned m_elementFlags : NumberOfElementFlags; |
306 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; | 360 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; |
307 protected: | 361 protected: |
308 unsigned m_isElementRareData : 1; | 362 unsigned m_isElementRareData : 1; |
309 }; | 363 }; |
310 | 364 |
365 #if !ENABLE(OILPAN) | |
311 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas tList(Node& ownerNode) | 366 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas tList(Node& ownerNode) |
312 { | 367 { |
313 ASSERT(ownerNode.nodeLists() == this); | 368 ASSERT(ownerNode.nodeLists() == this); |
314 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC acheNS.size() != 1) | 369 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC acheNS.size() != 1) |
315 return false; | 370 return false; |
316 ownerNode.clearNodeLists(); | 371 ownerNode.clearNodeLists(); |
317 return true; | 372 return true; |
318 } | 373 } |
374 #endif | |
319 | 375 |
320 } // namespace WebCore | 376 } // namespace WebCore |
321 | 377 |
322 #endif // NodeRareData_h | 378 #endif // NodeRareData_h |
OLD | NEW |