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

Unified Diff: Source/core/dom/Attr.cpp

Issue 203193010: Add UseCounters for the Attr.value getter and setter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/dom/Attr.h ('k') | Source/core/dom/Attr.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Attr.cpp
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index c6454fa4d863a4b31b85635fc15e37d60db963f3..b6ca3b55de050250483078445aa38b99e5b95670 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -28,6 +28,7 @@
#include "core/dom/Element.h"
#include "core/dom/Text.h"
#include "core/events/ScopedEventQueue.h"
+#include "core/frame/UseCounter.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/StringBuilder.h"
@@ -102,7 +103,7 @@ void Attr::setValue(const AtomicString& value)
invalidateNodeListCachesInAncestors(&m_name, m_element);
}
-void Attr::setValue(const AtomicString& value, ExceptionState&)
+void Attr::setValueInternal(const AtomicString& value)
{
if (m_element)
m_element->willModifyAttribute(qualifiedName(), this->value(), value);
@@ -113,11 +114,23 @@ void Attr::setValue(const AtomicString& value, ExceptionState&)
m_element->didModifyAttribute(qualifiedName(), value);
}
+const AtomicString& Attr::valueForBindings() const
+{
+ UseCounter::count(document(), UseCounter::AttrGetValue);
+ return value();
+}
+
+void Attr::setValueForBindings(const AtomicString& value)
+{
+ UseCounter::count(document(), UseCounter::AttrSetValue);
+ setValueInternal(value);
+}
+
void Attr::setNodeValue(const String& v)
{
// Attr uses AtomicString type for its value to save memory as there
// is duplication among Elements' attributes values.
- setValue(AtomicString(v), IGNORE_EXCEPTION);
+ setValueInternal(AtomicString(v));
}
PassRefPtr<Node> Attr::cloneNode(bool /*deep*/)
« no previous file with comments | « Source/core/dom/Attr.h ('k') | Source/core/dom/Attr.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698