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

Side by Side Diff: Source/core/dom/DatasetDOMStringMap.cpp

Issue 448043003: Drop const_iterator for AttributeCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/AttributeCollection.h ('k') | Source/core/dom/Element.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) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 void DatasetDOMStringMap::deref() 149 void DatasetDOMStringMap::deref()
150 { 150 {
151 m_element->deref(); 151 m_element->deref();
152 } 152 }
153 #endif 153 #endif
154 154
155 void DatasetDOMStringMap::getNames(Vector<String>& names) 155 void DatasetDOMStringMap::getNames(Vector<String>& names)
156 { 156 {
157 AttributeCollection attributes = m_element->attributes(); 157 AttributeCollection attributes = m_element->attributes();
158 AttributeCollection::const_iterator end = attributes.end(); 158 AttributeCollection::iterator end = attributes.end();
159 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) { 159 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
160 if (isValidAttributeName(it->localName())) 160 if (isValidAttributeName(it->localName()))
161 names.append(convertAttributeNameToPropertyName(it->localName())); 161 names.append(convertAttributeNameToPropertyName(it->localName()));
162 } 162 }
163 } 163 }
164 164
165 String DatasetDOMStringMap::item(const String& name) 165 String DatasetDOMStringMap::item(const String& name)
166 { 166 {
167 AttributeCollection attributes = m_element->attributes(); 167 AttributeCollection attributes = m_element->attributes();
168 AttributeCollection::const_iterator end = attributes.end(); 168 AttributeCollection::iterator end = attributes.end();
169 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) { 169 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
170 if (propertyNameMatchesAttributeName(name, it->localName())) 170 if (propertyNameMatchesAttributeName(name, it->localName()))
171 return it->value(); 171 return it->value();
172 } 172 }
173 173
174 return String(); 174 return String();
175 } 175 }
176 176
177 bool DatasetDOMStringMap::contains(const String& name) 177 bool DatasetDOMStringMap::contains(const String& name)
178 { 178 {
179 AttributeCollection attributes = m_element->attributes(); 179 AttributeCollection attributes = m_element->attributes();
180 AttributeCollection::const_iterator end = attributes.end(); 180 AttributeCollection::iterator end = attributes.end();
181 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) { 181 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
182 if (propertyNameMatchesAttributeName(name, it->localName())) 182 if (propertyNameMatchesAttributeName(name, it->localName()))
183 return true; 183 return true;
184 } 184 }
185 return false; 185 return false;
186 } 186 }
187 187
188 void DatasetDOMStringMap::setItem(const String& name, const String& value, Excep tionState& exceptionState) 188 void DatasetDOMStringMap::setItem(const String& name, const String& value, Excep tionState& exceptionState)
189 { 189 {
190 if (!isValidPropertyName(name)) { 190 if (!isValidPropertyName(name)) {
191 exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a v alid property name."); 191 exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a v alid property name.");
(...skipping 15 matching lines...) Expand all
207 return false; 207 return false;
208 } 208 }
209 209
210 void DatasetDOMStringMap::trace(Visitor* visitor) 210 void DatasetDOMStringMap::trace(Visitor* visitor)
211 { 211 {
212 visitor->trace(m_element); 212 visitor->trace(m_element);
213 DOMStringMap::trace(visitor); 213 DOMStringMap::trace(visitor);
214 } 214 }
215 215
216 } // namespace blink 216 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/AttributeCollection.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698