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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 395933002: Use Dequeue::removeLast() in StyleResolver::addToStyleSharingList() (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
« 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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 void StyleResolver::addToStyleSharingList(Element& element) 316 void StyleResolver::addToStyleSharingList(Element& element)
317 { 317 {
318 // Never add elements to the style sharing list if we're not in a recalcStyl e, 318 // Never add elements to the style sharing list if we're not in a recalcStyl e,
319 // otherwise we could leave stale pointers in there. 319 // otherwise we could leave stale pointers in there.
320 if (!document().inStyleRecalc()) 320 if (!document().inStyleRecalc())
321 return; 321 return;
322 INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates); 322 INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates);
323 StyleSharingList& list = styleSharingList(); 323 StyleSharingList& list = styleSharingList();
324 if (list.size() >= styleSharingListSize) 324 if (list.size() >= styleSharingListSize)
325 list.remove(--list.end()); 325 list.removeLast();
326 list.prepend(&element); 326 list.prepend(&element);
327 } 327 }
328 328
329 StyleSharingList& StyleResolver::styleSharingList() 329 StyleSharingList& StyleResolver::styleSharingList()
330 { 330 {
331 m_styleSharingLists.resize(styleSharingMaxDepth); 331 m_styleSharingLists.resize(styleSharingMaxDepth);
332 332
333 // We never put things at depth 0 into the list since that's only the <html> element 333 // We never put things at depth 0 into the list since that's only the <html> element
334 // and it has no siblings or cousins to share with. 334 // and it has no siblings or cousins to share with.
335 unsigned depth = std::max(std::min(m_styleSharingDepth, styleSharingMaxDepth ), 1u) - 1u; 335 unsigned depth = std::max(std::min(m_styleSharingDepth, styleSharingMaxDepth ), 1u) - 1u;
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 visitor->trace(m_viewportStyleResolver); 1564 visitor->trace(m_viewportStyleResolver);
1565 visitor->trace(m_features); 1565 visitor->trace(m_features);
1566 visitor->trace(m_siblingRuleSet); 1566 visitor->trace(m_siblingRuleSet);
1567 visitor->trace(m_uncommonAttributeRuleSet); 1567 visitor->trace(m_uncommonAttributeRuleSet);
1568 visitor->trace(m_watchedSelectorsRules); 1568 visitor->trace(m_watchedSelectorsRules);
1569 visitor->trace(m_treeBoundaryCrossingRules); 1569 visitor->trace(m_treeBoundaryCrossingRules);
1570 visitor->trace(m_pendingStyleSheets); 1570 visitor->trace(m_pendingStyleSheets);
1571 } 1571 }
1572 1572
1573 } // namespace WebCore 1573 } // 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