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

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

Issue 296133014: Revert shouldInvalidateNodeListCaches() back to template-unrolled version. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5651 matching lines...) Expand 10 before | Expand all | Expand 10 after
5662 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) 5662 if (!page->focusController().isActive() || !page->focusController().isFocuse d())
5663 return false; 5663 return false;
5664 Frame* focusedFrame = page->focusController().focusedFrame(); 5664 Frame* focusedFrame = page->focusController().focusedFrame();
5665 if (focusedFrame && focusedFrame->isLocalFrame()) { 5665 if (focusedFrame && focusedFrame->isLocalFrame()) {
5666 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame())) 5666 if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame()))
5667 return true; 5667 return true;
5668 } 5668 }
5669 return false; 5669 return false;
5670 } 5670 }
5671 5671
5672 #if ENABLE(OILPAN)
5673 template<unsigned type>
5674 bool shouldInvalidateNodeListCachesForAttr(const HeapHashSet<WeakMember<const Li veNodeListBase> > nodeLists[], const QualifiedName& attrName)
5675 {
5676 if (!nodeLists[type].isEmpty() && LiveNodeListBase::shouldInvalidateTypeOnAt tributeChange(static_cast<NodeListInvalidationType>(type), attrName))
5677 return true;
5678 return shouldInvalidateNodeListCachesForAttr<type + 1>(nodeLists, attrName);
5679 }
5680
5681 template<>
5682 bool shouldInvalidateNodeListCachesForAttr<numNodeListInvalidationTypes>(const H eapHashSet<WeakMember<const LiveNodeListBase> >[], const QualifiedName&)
5683 {
5684 return false;
5685 }
5686 #else
5687 template<unsigned type>
5688 bool shouldInvalidateNodeListCachesForAttr(const unsigned nodeListCounts[], cons t QualifiedName& attrName)
5689 {
5690 if (nodeListCounts[type] && LiveNodeListBase::shouldInvalidateTypeOnAttribut eChange(static_cast<NodeListInvalidationType>(type), attrName))
5691 return true;
5692 return shouldInvalidateNodeListCachesForAttr<type + 1>(nodeListCounts, attrN ame);
5693 }
5694
5695 template<>
5696 bool shouldInvalidateNodeListCachesForAttr<numNodeListInvalidationTypes>(const u nsigned[], const QualifiedName&)
5697 {
5698 return false;
5699 }
5700 #endif
5701
5672 bool Document::shouldInvalidateNodeListCaches(const QualifiedName* attrName) con st 5702 bool Document::shouldInvalidateNodeListCaches(const QualifiedName* attrName) con st
5673 { 5703 {
5674 if (attrName) { 5704 if (attrName) {
5675 for (int type = 1; type < numNodeListInvalidationTypes; ++type) {
5676 #if ENABLE(OILPAN) 5705 #if ENABLE(OILPAN)
5677 if (m_nodeLists[type].isEmpty()) { 5706 return shouldInvalidateNodeListCachesForAttr<DoNotInvalidateOnAttributeC hanges + 1>(m_nodeLists, *attrName);
5678 #else 5707 #else
5679 if (!m_nodeListCounts[type]) { 5708 return shouldInvalidateNodeListCachesForAttr<DoNotInvalidateOnAttributeC hanges + 1>(m_nodeListCounts, *attrName);
5680 #endif 5709 #endif
5681 continue;
5682 }
5683
5684 if (LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(static_c ast<NodeListInvalidationType>(type), *attrName))
5685 return true;
5686 }
5687 } 5710 }
5688 5711
5689 for (int type = 0; type < numNodeListInvalidationTypes; ++type) { 5712 for (int type = 0; type < numNodeListInvalidationTypes; ++type) {
5690 #if ENABLE(OILPAN) 5713 #if ENABLE(OILPAN)
5691 if (!m_nodeLists[type].isEmpty()) 5714 if (!m_nodeLists[type].isEmpty())
5692 #else 5715 #else
5693 if (m_nodeListCounts[type]) 5716 if (m_nodeListCounts[type])
5694 #endif 5717 #endif
5695 return true; 5718 return true;
5696 } 5719 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
5759 visitor->trace(m_timeline); 5782 visitor->trace(m_timeline);
5760 visitor->trace(m_compositorPendingAnimations); 5783 visitor->trace(m_compositorPendingAnimations);
5761 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5784 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5762 DocumentSupplementable::trace(visitor); 5785 DocumentSupplementable::trace(visitor);
5763 TreeScope::trace(visitor); 5786 TreeScope::trace(visitor);
5764 ContainerNode::trace(visitor); 5787 ContainerNode::trace(visitor);
5765 ExecutionContext::trace(visitor); 5788 ExecutionContext::trace(visitor);
5766 } 5789 }
5767 5790
5768 } // namespace WebCore 5791 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698