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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.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) 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 void RadioButtonGroup::remove(HTMLInputElement* button) { 146 void RadioButtonGroup::remove(HTMLInputElement* button) {
147 DCHECK_EQ(button->type(), InputTypeNames::radio); 147 DCHECK_EQ(button->type(), InputTypeNames::radio);
148 auto it = m_members.find(button); 148 auto it = m_members.find(button);
149 if (it == m_members.end()) 149 if (it == m_members.end())
150 return; 150 return;
151 bool wasValid = isValid(); 151 bool wasValid = isValid();
152 DCHECK_EQ(it->value, button->isRequired()); 152 DCHECK_EQ(it->value, button->isRequired());
153 updateRequiredButton(*it, false); 153 updateRequiredButton(*it, false);
154 m_members.remove(it); 154 m_members.erase(it);
155 if (m_checkedButton == button) 155 if (m_checkedButton == button)
156 m_checkedButton = nullptr; 156 m_checkedButton = nullptr;
157 157
158 if (m_members.isEmpty()) { 158 if (m_members.isEmpty()) {
159 DCHECK(!m_requiredCount); 159 DCHECK(!m_requiredCount);
160 DCHECK(!m_checkedButton); 160 DCHECK(!m_checkedButton);
161 } else if (wasValid != isValid()) { 161 } else if (wasValid != isValid()) {
162 setNeedsValidityCheckForAllButtons(); 162 setNeedsValidityCheckForAllButtons();
163 } 163 }
164 if (!wasValid) { 164 if (!wasValid) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 DCHECK(!group->isRequired()); 292 DCHECK(!group->isRequired());
293 SECURITY_DCHECK(!group->checkedButton()); 293 SECURITY_DCHECK(!group->checkedButton());
294 } 294 }
295 } 295 }
296 296
297 DEFINE_TRACE(RadioButtonGroupScope) { 297 DEFINE_TRACE(RadioButtonGroupScope) {
298 visitor->trace(m_nameToGroupMap); 298 visitor->trace(m_nameToGroupMap);
299 } 299 }
300 300
301 } // namespace blink 301 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698