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

Side by Side Diff: third_party/WebKit/Source/core/css/RuleFeature.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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 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 Apple Inc. All 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 invalidationSet = SiblingInvalidationSet::create( 222 invalidationSet = SiblingInvalidationSet::create(
223 toDescendantInvalidationSet(descendants.get())); 223 toDescendantInvalidationSet(descendants.get()));
224 return *invalidationSet; 224 return *invalidationSet;
225 } 225 }
226 226
227 InvalidationSet& ensureInvalidationSet( 227 InvalidationSet& ensureInvalidationSet(
228 HashMap<AtomicString, RefPtr<InvalidationSet>>& map, 228 HashMap<AtomicString, RefPtr<InvalidationSet>>& map,
229 const AtomicString& key, 229 const AtomicString& key,
230 InvalidationType type) { 230 InvalidationType type) {
231 RefPtr<InvalidationSet>& invalidationSet = 231 RefPtr<InvalidationSet>& invalidationSet =
232 map.add(key, nullptr).storedValue->value; 232 map.insert(key, nullptr).storedValue->value;
233 return storedInvalidationSet(invalidationSet, type); 233 return storedInvalidationSet(invalidationSet, type);
234 } 234 }
235 235
236 InvalidationSet& ensureInvalidationSet( 236 InvalidationSet& ensureInvalidationSet(
237 HashMap<CSSSelector::PseudoType, 237 HashMap<CSSSelector::PseudoType,
238 RefPtr<InvalidationSet>, 238 RefPtr<InvalidationSet>,
239 WTF::IntHash<unsigned>, 239 WTF::IntHash<unsigned>,
240 WTF::UnsignedWithZeroKeyHashTraits<unsigned>>& map, 240 WTF::UnsignedWithZeroKeyHashTraits<unsigned>>& map,
241 CSSSelector::PseudoType key, 241 CSSSelector::PseudoType key,
242 InvalidationType type) { 242 InvalidationType type) {
243 RefPtr<InvalidationSet>& invalidationSet = 243 RefPtr<InvalidationSet>& invalidationSet =
244 map.add(key, nullptr).storedValue->value; 244 map.insert(key, nullptr).storedValue->value;
245 return storedInvalidationSet(invalidationSet, type); 245 return storedInvalidationSet(invalidationSet, type);
246 } 246 }
247 247
248 void extractInvalidationSets(InvalidationSet* invalidationSet, 248 void extractInvalidationSets(InvalidationSet* invalidationSet,
249 DescendantInvalidationSet*& descendants, 249 DescendantInvalidationSet*& descendants,
250 SiblingInvalidationSet*& siblings) { 250 SiblingInvalidationSet*& siblings) {
251 if (invalidationSet->type() == InvalidateDescendants) { 251 if (invalidationSet->type() == InvalidateDescendants) {
252 descendants = toDescendantInvalidationSet(invalidationSet); 252 descendants = toDescendantInvalidationSet(invalidationSet);
253 siblings = nullptr; 253 siblings = nullptr;
254 return; 254 return;
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() || 1173 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() ||
1174 !tagNames.isEmpty() || customPseudoElement; 1174 !tagNames.isEmpty() || customPseudoElement;
1175 } 1175 }
1176 1176
1177 bool RuleFeatureSet::InvalidationSetFeatures::hasTagIdClassOrAttribute() const { 1177 bool RuleFeatureSet::InvalidationSetFeatures::hasTagIdClassOrAttribute() const {
1178 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() || 1178 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() ||
1179 !tagNames.isEmpty(); 1179 !tagNames.isEmpty();
1180 } 1180 }
1181 1181
1182 } // namespace blink 1182 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceCache.cpp ('k') | third_party/WebKit/Source/core/css/RuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698