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

Side by Side Diff: Source/core/html/HTMLFormElement.cpp

Issue 90363003: Get rid of useless calls to AtomicString::impl() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/forms/FormController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 hasInvalidControls = true; 718 hasInvalidControls = true;
719 } 719 }
720 } 720 }
721 return hasInvalidControls; 721 return hasInvalidControls;
722 } 722 }
723 723
724 Node* HTMLFormElement::elementFromPastNamesMap(const AtomicString& pastName) con st 724 Node* HTMLFormElement::elementFromPastNamesMap(const AtomicString& pastName) con st
725 { 725 {
726 if (pastName.isEmpty() || !m_pastNamesMap) 726 if (pastName.isEmpty() || !m_pastNamesMap)
727 return 0; 727 return 0;
728 Node* node = m_pastNamesMap->get(pastName.impl()); 728 Node* node = m_pastNamesMap->get(pastName);
729 #if !ASSERT_DISABLED 729 #if !ASSERT_DISABLED
730 if (!node) 730 if (!node)
731 return 0; 731 return 0;
732 ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(node)->form() == this); 732 ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(node)->form() == this);
733 if (node->hasTagName(imgTag)) { 733 if (node->hasTagName(imgTag)) {
734 ASSERT_WITH_SECURITY_IMPLICATION(m_imageElements.find(node) != kNotFound ); 734 ASSERT_WITH_SECURITY_IMPLICATION(m_imageElements.find(node) != kNotFound );
735 } else if (node->hasTagName(objectTag)) { 735 } else if (node->hasTagName(objectTag)) {
736 ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLObjectE lement(node)) != kNotFound); 736 ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLObjectE lement(node)) != kNotFound);
737 } else { 737 } else {
738 ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLFormCon trolElement(node)) != kNotFound); 738 ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLFormCon trolElement(node)) != kNotFound);
739 } 739 }
740 #endif 740 #endif
741 return node; 741 return node;
742 } 742 }
743 743
744 void HTMLFormElement::addToPastNamesMap(Node* element, const AtomicString& pastN ame) 744 void HTMLFormElement::addToPastNamesMap(Node* element, const AtomicString& pastN ame)
745 { 745 {
746 if (pastName.isEmpty()) 746 if (pastName.isEmpty())
747 return; 747 return;
748 if (!m_pastNamesMap) 748 if (!m_pastNamesMap)
749 m_pastNamesMap = adoptPtr(new PastNamesMap); 749 m_pastNamesMap = adoptPtr(new PastNamesMap);
750 m_pastNamesMap->set(pastName.impl(), element); 750 m_pastNamesMap->set(pastName, element);
751 } 751 }
752 752
753 void HTMLFormElement::removeFromPastNamesMap(HTMLElement& element) 753 void HTMLFormElement::removeFromPastNamesMap(HTMLElement& element)
754 { 754 {
755 if (!m_pastNamesMap) 755 if (!m_pastNamesMap)
756 return; 756 return;
757 PastNamesMap::iterator end = m_pastNamesMap->end(); 757 PastNamesMap::iterator end = m_pastNamesMap->end();
758 for (PastNamesMap::iterator it = m_pastNamesMap->begin(); it != end; ++it) { 758 for (PastNamesMap::iterator it = m_pastNamesMap->begin(); it != end; ++it) {
759 if (it->value.get() == &element) { 759 if (it->value.get() == &element) {
760 it->value = 0; 760 it->value = 0;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 821 }
822 822
823 void HTMLFormElement::setDemoted(bool demoted) 823 void HTMLFormElement::setDemoted(bool demoted)
824 { 824 {
825 if (demoted) 825 if (demoted)
826 UseCounter::count(document(), UseCounter::DemotedFormElement); 826 UseCounter::count(document(), UseCounter::DemotedFormElement);
827 m_wasDemoted = demoted; 827 m_wasDemoted = demoted;
828 } 828 }
829 829
830 } // namespace 830 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/forms/FormController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698