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

Unified Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 180723006: Have ElementData::attributeItem() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index 2bed6b174c071c531f756e7356d6e32a9a6d4936..2fc805ddefc45f5d3cb27c69a5dd5213e7a3ba19 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -724,12 +724,12 @@ void InspectorDOMAgent::setAttributesAsText(ErrorString* errorString, int elemen
unsigned numAttrs = parsedElement->attributeCount();
for (unsigned i = 0; i < numAttrs; ++i) {
// Add attribute pair
- const Attribute* attribute = parsedElement->attributeItem(i);
- String attributeName = attribute->name().toString();
+ const Attribute& attribute = parsedElement->attributeItem(i);
+ String attributeName = attribute.name().toString();
if (shouldIgnoreCase)
attributeName = attributeName.lower();
foundOriginalAttribute |= name && attributeName == caseAdjustedName;
- if (!m_domEditor->setAttribute(element, attributeName, attribute->value(), errorString))
+ if (!m_domEditor->setAttribute(element, attributeName, attribute.value(), errorString))
return;
}
@@ -984,14 +984,14 @@ void InspectorDOMAgent::performSearch(ErrorString*, const String& whitespaceTrim
unsigned numAttrs = element->attributeCount();
for (unsigned i = 0; i < numAttrs; ++i) {
// Add attribute pair
- const Attribute* attribute = element->attributeItem(i);
- if (attribute->localName().find(whitespaceTrimmedQuery, 0, false) != kNotFound) {
+ const Attribute& attribute = element->attributeItem(i);
+ if (attribute.localName().find(whitespaceTrimmedQuery, 0, false) != kNotFound) {
resultCollector.add(node);
break;
}
- size_t foundPosition = attribute->value().find(attributeQuery, 0, false);
+ size_t foundPosition = attribute.value().find(attributeQuery, 0, false);
if (foundPosition != kNotFound) {
- if (!exactAttributeMatch || (!foundPosition && attribute->value().length() == attributeQuery.length())) {
+ if (!exactAttributeMatch || (!foundPosition && attribute.value().length() == attributeQuery.length())) {
resultCollector.add(node);
break;
}
@@ -1580,9 +1580,9 @@ PassRefPtr<TypeBuilder::Array<String> > InspectorDOMAgent::buildArrayForElementA
unsigned numAttrs = element->attributeCount();
for (unsigned i = 0; i < numAttrs; ++i) {
// Add attribute pair
- const Attribute* attribute = element->attributeItem(i);
- attributesValue->addItem(attribute->name().toString());
- attributesValue->addItem(attribute->value());
+ const Attribute& attribute = element->attributeItem(i);
+ attributesValue->addItem(attribute.name().toString());
+ attributesValue->addItem(attribute.value());
}
return attributesValue.release();
}
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698