Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: Source/core/dom/NodeRareData.cpp

Issue 390043003: Move NodeListsNodeData class out of NodeRareData.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 namespace WebCore { 38 namespace WebCore {
39 39
40 struct SameSizeAsNodeRareData { 40 struct SameSizeAsNodeRareData {
41 void* m_pointer[2]; 41 void* m_pointer[2];
42 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData; 42 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData;
43 unsigned m_bitfields; 43 unsigned m_bitfields;
44 }; 44 };
45 45
46 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall); 46 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall);
47 47
48 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
49 {
50 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end();
51 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi n(); it != atomicNameCacheEnd; ++it)
52 it->value->invalidateCacheForAttribute(attrName);
53
54 if (attrName)
55 return;
56
57 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end();
58 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it)
59 it->value->invalidateCache();
60 }
61
62 void NodeListsNodeData::trace(Visitor* visitor)
63 {
64 visitor->trace(m_childNodeList);
65 visitor->trace(m_atomicNameCaches);
66 visitor->trace(m_tagCollectionCacheNS);
67 }
68
69 void NodeRareData::traceAfterDispatch(Visitor* visitor) 48 void NodeRareData::traceAfterDispatch(Visitor* visitor)
70 { 49 {
71 visitor->trace(m_mutationObserverData); 50 visitor->trace(m_mutationObserverData);
72 // Do not keep empty NodeListsNodeData objects around. 51 // Do not keep empty NodeListsNodeData objects around.
73 if (m_nodeLists && m_nodeLists->isEmpty()) 52 if (m_nodeLists && m_nodeLists->isEmpty())
74 m_nodeLists.clear(); 53 m_nodeLists.clear();
75 else 54 else
76 visitor->trace(m_nodeLists); 55 visitor->trace(m_nodeLists);
77 } 56 }
78 57
(...skipping 11 matching lines...) Expand all
90 if (m_isElementRareData) 69 if (m_isElementRareData)
91 static_cast<ElementRareData*>(this)->~ElementRareData(); 70 static_cast<ElementRareData*>(this)->~ElementRareData();
92 else 71 else
93 this->~NodeRareData(); 72 this->~NodeRareData();
94 } 73 }
95 74
96 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow 75 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
97 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count); 76 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count);
98 77
99 } // namespace WebCore 78 } // namespace WebCore
OLDNEW
« Source/core/dom/NodeListsNodeData.cpp ('K') | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698