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

Unified Diff: Source/core/inspector/DOMPatchSupport.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/html/HTMLObjectElement.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/DOMPatchSupport.cpp
diff --git a/Source/core/inspector/DOMPatchSupport.cpp b/Source/core/inspector/DOMPatchSupport.cpp
index eaaa8ed7487f2b717c3528437e4b0041af7ec6f7..39fb7cf4babb1d1d436517d57fc478843f15dbeb 100644
--- a/Source/core/inspector/DOMPatchSupport.cpp
+++ b/Source/core/inspector/DOMPatchSupport.cpp
@@ -185,8 +185,8 @@ bool DOMPatchSupport::innerPatchNode(Digest* oldDigest, Digest* newDigest, Excep
// FIXME: Create a function in Element for removing all properties. Take in account whether did/willModifyAttribute are important.
if (oldElement->hasAttributesWithoutUpdate()) {
while (oldElement->attributeCount()) {
- const Attribute* attribute = oldElement->attributeItem(0);
- if (!m_domEditor->removeAttribute(oldElement, attribute->localName(), exceptionState))
+ const Attribute& attribute = oldElement->attributeItem(0);
+ if (!m_domEditor->removeAttribute(oldElement, attribute.localName(), exceptionState))
return false;
}
}
@@ -195,8 +195,8 @@ bool DOMPatchSupport::innerPatchNode(Digest* oldDigest, Digest* newDigest, Excep
if (newElement->hasAttributesWithoutUpdate()) {
size_t numAttrs = newElement->attributeCount();
for (size_t i = 0; i < numAttrs; ++i) {
- const Attribute* attribute = newElement->attributeItem(i);
- if (!m_domEditor->setAttribute(oldElement, attribute->name().localName(), attribute->value(), exceptionState))
+ const Attribute& attribute = newElement->attributeItem(i);
+ if (!m_domEditor->setAttribute(oldElement, attribute.name().localName(), attribute.value(), exceptionState))
return false;
}
}
@@ -428,9 +428,9 @@ PassOwnPtr<DOMPatchSupport::Digest> DOMPatchSupport::createDigest(Node* node, Un
size_t numAttrs = element->attributeCount();
SHA1 attrsSHA1;
for (size_t i = 0; i < numAttrs; ++i) {
- const Attribute* attribute = element->attributeItem(i);
- addStringToSHA1(attrsSHA1, attribute->name().toString());
- addStringToSHA1(attrsSHA1, attribute->value());
+ const Attribute& attribute = element->attributeItem(i);
+ addStringToSHA1(attrsSHA1, attribute.name().toString());
+ addStringToSHA1(attrsSHA1, attribute.value());
}
Vector<uint8_t, 20> attrsHash;
attrsSHA1.computeHash(attrsHash);
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698