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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/V0CustomElementUpgradeCandidateMap.cpp

Issue 2759703002: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: rebase, fix one platform-specific reference 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void V0CustomElementUpgradeCandidateMap::elementWasDestroyed(Element* element) { 64 void V0CustomElementUpgradeCandidateMap::elementWasDestroyed(Element* element) {
65 V0CustomElementObserver::elementWasDestroyed(element); 65 V0CustomElementObserver::elementWasDestroyed(element);
66 UpgradeCandidateMap::iterator candidate = m_upgradeCandidates.find(element); 66 UpgradeCandidateMap::iterator candidate = m_upgradeCandidates.find(element);
67 SECURITY_DCHECK(candidate != m_upgradeCandidates.end()); 67 SECURITY_DCHECK(candidate != m_upgradeCandidates.end());
68 68
69 UnresolvedDefinitionMap::iterator elements = 69 UnresolvedDefinitionMap::iterator elements =
70 m_unresolvedDefinitions.find(candidate->value); 70 m_unresolvedDefinitions.find(candidate->value);
71 SECURITY_DCHECK(elements != m_unresolvedDefinitions.end()); 71 SECURITY_DCHECK(elements != m_unresolvedDefinitions.end());
72 elements->value->erase(element); 72 elements->value->erase(element);
73 m_upgradeCandidates.remove(candidate); 73 m_upgradeCandidates.erase(candidate);
74 } 74 }
75 75
76 V0CustomElementUpgradeCandidateMap::ElementSet* 76 V0CustomElementUpgradeCandidateMap::ElementSet*
77 V0CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor( 77 V0CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor(
78 const V0CustomElementDescriptor& descriptor) { 78 const V0CustomElementDescriptor& descriptor) {
79 ElementSet* candidates = m_unresolvedDefinitions.take(descriptor); 79 ElementSet* candidates = m_unresolvedDefinitions.take(descriptor);
80 80
81 if (!candidates) 81 if (!candidates)
82 return nullptr; 82 return nullptr;
83 83
84 for (const auto& candidate : *candidates) { 84 for (const auto& candidate : *candidates) {
85 unobserve(candidate); 85 unobserve(candidate);
86 m_upgradeCandidates.erase(candidate); 86 m_upgradeCandidates.erase(candidate);
87 } 87 }
88 return candidates; 88 return candidates;
89 } 89 }
90 90
91 DEFINE_TRACE(V0CustomElementUpgradeCandidateMap) { 91 DEFINE_TRACE(V0CustomElementUpgradeCandidateMap) {
92 visitor->trace(m_upgradeCandidates); 92 visitor->trace(m_upgradeCandidates);
93 visitor->trace(m_unresolvedDefinitions); 93 visitor->trace(m_unresolvedDefinitions);
94 V0CustomElementObserver::trace(visitor); 94 V0CustomElementObserver::trace(visitor);
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698