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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase 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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 std::unique_ptr<CounterDirectiveMap>& map = 1555 std::unique_ptr<CounterDirectiveMap>& map =
1556 m_rareNonInheritedData.access()->m_counterDirectives; 1556 m_rareNonInheritedData.access()->m_counterDirectives;
1557 if (!map) 1557 if (!map)
1558 map = WTF::wrapUnique(new CounterDirectiveMap); 1558 map = WTF::wrapUnique(new CounterDirectiveMap);
1559 return *map; 1559 return *map;
1560 } 1560 }
1561 1561
1562 const CounterDirectives ComputedStyle::getCounterDirectives( 1562 const CounterDirectives ComputedStyle::getCounterDirectives(
1563 const AtomicString& identifier) const { 1563 const AtomicString& identifier) const {
1564 if (const CounterDirectiveMap* directives = counterDirectives()) 1564 if (const CounterDirectiveMap* directives = counterDirectives())
1565 return directives->get(identifier); 1565 return directives->at(identifier);
1566 return CounterDirectives(); 1566 return CounterDirectives();
1567 } 1567 }
1568 1568
1569 void ComputedStyle::clearIncrementDirectives() { 1569 void ComputedStyle::clearIncrementDirectives() {
1570 if (!counterDirectives()) 1570 if (!counterDirectives())
1571 return; 1571 return;
1572 1572
1573 // This makes us copy even if we may not be removing any items. 1573 // This makes us copy even if we may not be removing any items.
1574 CounterDirectiveMap& map = accessCounterDirectives(); 1574 CounterDirectiveMap& map = accessCounterDirectives();
1575 typedef CounterDirectiveMap::iterator Iterator; 1575 typedef CounterDirectiveMap::iterator Iterator;
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2491 if (value < 0) 2491 if (value < 0)
2492 fvalue -= 0.5f; 2492 fvalue -= 0.5f;
2493 else 2493 else
2494 fvalue += 0.5f; 2494 fvalue += 0.5f;
2495 } 2495 }
2496 2496
2497 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2497 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2498 } 2498 }
2499 2499
2500 } // namespace blink 2500 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698