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

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

Issue 236653002: Oilpan: move mutation observers to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adjust dispose() methods a bit Created 6 years, 8 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
« Source/core/dom/Node.cpp ('K') | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13 matching lines...) Expand all
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[2];
40 OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
39 unsigned m_bitfields; 41 unsigned m_bitfields;
40 }; 42 };
41 43
42 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall); 44 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall);
43 45
44 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) 46 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
45 { 47 {
46 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end(); 48 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end();
47 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi n(); it != atomicNameCacheEnd; ++it) 49 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi n(); it != atomicNameCacheEnd; ++it)
48 it->value->invalidateCache(attrName); 50 it->value->invalidateCache(attrName);
49 51
50 if (attrName) 52 if (attrName)
51 return; 53 return;
52 54
53 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); 55 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end();
54 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it) 56 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it)
55 it->value->invalidateCache(); 57 it->value->invalidateCache();
56 } 58 }
57 59
60 void NodeRareData::dispose()
61 {
62 #if ENABLE(OILPAN)
haraken 2014/04/21 06:00:34 Ditto.
sof 2014/04/21 07:34:05 Hmm, is it feasible to dispose early in the non-Oi
sof 2014/04/21 12:45:16 ..as we have identified all the places where we ha
63 if (m_mutationObserverData) {
64 for (unsigned i = 0; i < m_mutationObserverData->registry.size(); i++)
65 m_mutationObserverData->registry.at(i)->dispose();
66 m_mutationObserverData.clear();
67 }
68 #endif
69 }
70
58 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow 71 // 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); 72 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count);
60 73
61 } // namespace WebCore 74 } // namespace WebCore
OLDNEW
« Source/core/dom/Node.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