Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/dom/NodeRareData.h" | 32 #include "core/dom/NodeRareData.h" |
| 33 #include "core/dom/Element.h" | 33 #include "core/dom/Element.h" |
| 34 #include "platform/heap/Handle.h" | |
| 34 | 35 |
| 35 namespace WebCore { | 36 namespace WebCore { |
| 36 | 37 |
| 37 struct SameSizeAsNodeRareData { | 38 struct SameSizeAsNodeRareData { |
| 38 void* m_pointer[3]; | 39 void* m_pointer[3]; |
| 40 #if ENABLE(OILPAN) | |
| 41 // FIXME: Oilpan: when the persistent reference to NodeMutationObserverData goes, | |
| 42 // this can be removed. | |
| 43 void* m_extraOilpanPersistentPointers[sizeof(Persistent<NodeMutationObserver Data>) / sizeof(void*) - 1]; | |
| 44 #endif | |
|
haraken
2014/04/15 02:33:25
Can you simple write:
OwnPtrWillBePersistent<No
sof
2014/04/15 22:00:53
That's a good suggestion.
And as m_nodeLists is a
| |
| 39 unsigned m_bitfields; | 45 unsigned m_bitfields; |
| 40 }; | 46 }; |
| 41 | 47 |
| 42 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall); | 48 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall); |
| 43 | 49 |
| 44 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) | 50 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) |
| 45 { | 51 { |
| 46 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end(); | 52 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end(); |
| 47 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi n(); it != atomicNameCacheEnd; ++it) | 53 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi n(); it != atomicNameCacheEnd; ++it) |
| 48 it->value->invalidateCache(attrName); | 54 it->value->invalidateCache(attrName); |
| 49 | 55 |
| 50 if (attrName) | 56 if (attrName) |
| 51 return; | 57 return; |
| 52 | 58 |
| 53 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); | 59 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); |
| 54 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it) | 60 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it) |
| 55 it->value->invalidateCache(); | 61 it->value->invalidateCache(); |
| 56 } | 62 } |
| 57 | 63 |
| 64 #if ENABLE(OILPAN) | |
| 65 void NodeRareData::dispose() | |
| 66 { | |
| 67 if (m_mutationObserverData) { | |
| 68 for (unsigned i = 0; i < m_mutationObserverData->registry.size(); i++) | |
| 69 m_mutationObserverData->registry.at(i)->dispose(); | |
| 70 m_mutationObserverData.clear(); | |
| 71 } | |
| 72 } | |
| 73 #endif | |
| 74 | |
| 58 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow | 75 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow |
| 59 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); |
| 60 | 77 |
| 61 } // namespace WebCore | 78 } // namespace WebCore |
| OLD | NEW |