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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2722413005: Migrate WTF::LinkedHashSet/ListHashSet::first() to ::front() (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 } 519 }
520 520
521 void CanvasRenderingContext2D::pruneLocalFontCache(size_t targetSize) { 521 void CanvasRenderingContext2D::pruneLocalFontCache(size_t targetSize) {
522 if (targetSize == 0) { 522 if (targetSize == 0) {
523 // Short cut: LRU does not matter when evicting everything 523 // Short cut: LRU does not matter when evicting everything
524 m_fontLRUList.clear(); 524 m_fontLRUList.clear();
525 m_fontsResolvedUsingCurrentStyle.clear(); 525 m_fontsResolvedUsingCurrentStyle.clear();
526 return; 526 return;
527 } 527 }
528 while (m_fontLRUList.size() > targetSize) { 528 while (m_fontLRUList.size() > targetSize) {
529 m_fontsResolvedUsingCurrentStyle.erase(m_fontLRUList.first()); 529 m_fontsResolvedUsingCurrentStyle.erase(m_fontLRUList.front());
530 m_fontLRUList.removeFirst(); 530 m_fontLRUList.removeFirst();
531 } 531 }
532 } 532 }
533 533
534 void CanvasRenderingContext2D::styleDidChange(const ComputedStyle* oldStyle, 534 void CanvasRenderingContext2D::styleDidChange(const ComputedStyle* oldStyle,
535 const ComputedStyle& newStyle) { 535 const ComputedStyle& newStyle) {
536 if (oldStyle && oldStyle->font() == newStyle.font()) 536 if (oldStyle && oldStyle->font() == newStyle.font())
537 return; 537 return;
538 pruneLocalFontCache(0); 538 pruneLocalFontCache(0);
539 } 539 }
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 } 1159 }
1160 return true; 1160 return true;
1161 } 1161 }
1162 1162
1163 void CanvasRenderingContext2D::resetUsageTracking() { 1163 void CanvasRenderingContext2D::resetUsageTracking() {
1164 UsageCounters newCounters; 1164 UsageCounters newCounters;
1165 m_usageCounters = newCounters; 1165 m_usageCounters = newCounters;
1166 } 1166 }
1167 1167
1168 } // namespace blink 1168 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698