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

Unified Diff: Source/core/html/forms/RadioButtonGroupScope.cpp

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use nullptr Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/forms/RadioButtonGroupScope.cpp
diff --git a/Source/core/html/forms/RadioButtonGroupScope.cpp b/Source/core/html/forms/RadioButtonGroupScope.cpp
index 4e4c55a50d4bfef96213a4bceae6ebecd33ac5cb..924db86fed57e921ec967acf312729068849c536 100644
--- a/Source/core/html/forms/RadioButtonGroupScope.cpp
+++ b/Source/core/html/forms/RadioButtonGroupScope.cpp
@@ -48,7 +48,7 @@ private:
bool isValid() const;
void setCheckedButton(HTMLInputElement*);
- WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement> > m_members;
+ WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement>> m_members;
RawPtrWillBeMember<HTMLInputElement> m_checkedButton;
size_t m_requiredCount;
};
@@ -113,10 +113,8 @@ void RadioButtonGroup::updateCheckedState(HTMLInputElement* button)
}
if (wasValid != isValid())
setNeedsValidityCheckForAllButtons();
- typedef WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement> >::const_iterator Iterator;
- Iterator end = m_members.end();
- for (Iterator it = m_members.begin(); it != end; ++it) {
- (*it)->pseudoStateChanged(CSSSelector::PseudoIndeterminate);
+ for (HTMLInputElement* const inputElement : m_members) {
+ inputElement->pseudoStateChanged(CSSSelector::PseudoIndeterminate);
}
}
@@ -138,7 +136,7 @@ void RadioButtonGroup::requiredAttributeChanged(HTMLInputElement* button)
void RadioButtonGroup::remove(HTMLInputElement* button)
{
ASSERT(button->type() == InputTypeNames::radio);
- WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement> >::iterator it = m_members.find(button);
+ WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement>>::iterator it = m_members.find(button);
if (it == m_members.end())
return;
bool wasValid = isValid();
@@ -165,10 +163,7 @@ void RadioButtonGroup::remove(HTMLInputElement* button)
void RadioButtonGroup::setNeedsValidityCheckForAllButtons()
{
- typedef WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement> >::const_iterator Iterator;
- Iterator end = m_members.end();
- for (Iterator it = m_members.begin(); it != end; ++it) {
- HTMLInputElement* button = *it;
+ for (HTMLInputElement* const button : m_members) {
ASSERT(button->type() == InputTypeNames::radio);
button->setNeedsValidityCheck();
}
@@ -244,9 +239,9 @@ void RadioButtonGroupScope::requiredAttributeChanged(HTMLInputElement* element)
HTMLInputElement* RadioButtonGroupScope::checkedButtonForGroup(const AtomicString& name) const
{
if (!m_nameToGroupMap)
- return 0;
+ return nullptr;
RadioButtonGroup* group = m_nameToGroupMap->get(name);
- return group ? group->checkedButton() : 0;
+ return group ? group->checkedButton() : nullptr;
}
bool RadioButtonGroupScope::isInRequiredGroup(HTMLInputElement* element) const

Powered by Google App Engine
This is Rietveld 408576698