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

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

Issue 247263008: LiveNodeListBase code should not need to worry about id/name cache invalidation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bug fix 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/LiveNodeListBase.cpp ('k') | Source/core/html/CollectionType.h » ('j') | 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 29 matching lines...) Expand all
40 OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData; 40 OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
41 unsigned m_bitfields; 41 unsigned m_bitfields;
42 }; 42 };
43 43
44 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall); 44 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall);
45 45
46 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) 46 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
47 { 47 {
48 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end(); 48 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName Caches.end();
49 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)
50 it->value->invalidateCache(attrName); 50 it->value->invalidateCacheForAttribute(attrName);
51 51
52 if (attrName) 52 if (attrName)
53 return; 53 return;
54 54
55 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); 55 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end();
56 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it) 56 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it)
57 it->value->invalidateCache(); 57 it->value->invalidateCache();
58 } 58 }
59 59
60 void NodeRareData::dispose() 60 void NodeRareData::dispose()
61 { 61 {
62 if (m_mutationObserverData) { 62 if (m_mutationObserverData) {
63 for (unsigned i = 0; i < m_mutationObserverData->registry.size(); i++) 63 for (unsigned i = 0; i < m_mutationObserverData->registry.size(); i++)
64 m_mutationObserverData->registry.at(i)->dispose(); 64 m_mutationObserverData->registry.at(i)->dispose();
65 m_mutationObserverData.clear(); 65 m_mutationObserverData.clear();
66 } 66 }
67 } 67 }
68 68
69 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow 69 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
70 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count); 70 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count);
71 71
72 } // namespace WebCore 72 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/LiveNodeListBase.cpp ('k') | Source/core/html/CollectionType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698