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

Unified Diff: Source/core/dom/DOMStringList.h

Issue 1207793004: Add additional usage metrics for DOMStringList methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « no previous file | Source/core/dom/DOMStringList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMStringList.h
diff --git a/Source/core/dom/DOMStringList.h b/Source/core/dom/DOMStringList.h
index 1c94de5e38ee34b75088ff820fc28c04a6999b82..5692428c0a4ef8d7a75a1d62c7ace6e7c7a9d445 100644
--- a/Source/core/dom/DOMStringList.h
+++ b/Source/core/dom/DOMStringList.h
@@ -36,14 +36,22 @@
namespace blink {
+class ExecutionContext;
+
// FIXME: Some consumers of this class may benefit from lazily fetching items rather
// than creating the list statically as is currently the only option.
class CORE_EXPORT DOMStringList final : public RefCountedWillBeGarbageCollectedFinalized<DOMStringList>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- static PassRefPtrWillBeRawPtr<DOMStringList> create()
+ // We would like to remove DOMStringList from the platform if possible.
+ // Track the source of each instance so we can measure the use of methods
+ // not present on Arrays and determine the feasibility of removal and
+ // what path it should take. http://crbug.com/460726
+ enum Source { IndexedDB, Location };
+
+ static PassRefPtrWillBeRawPtr<DOMStringList> create(Source source)
{
- return adoptRefWillBeNoop(new DOMStringList());
+ return adoptRefWillBeNoop(new DOMStringList(source));
}
bool isEmpty() const { return m_strings.isEmpty(); }
@@ -53,17 +61,20 @@ public:
// Implements the IDL.
size_t length() const { return m_strings.size(); }
- String item(unsigned index) const;
- bool contains(const String& str) const;
+ String anonymousIndexedGetter(unsigned index) const;
+
+ String item(ExecutionContext*, unsigned index) const;
+ bool contains(ExecutionContext*, const String&) const;
operator const Vector<String>&() const { return m_strings; }
DEFINE_INLINE_TRACE() { }
private:
- DOMStringList() { }
+ explicit DOMStringList(Source source) : m_source(source) { }
Vector<String> m_strings;
+ Source m_source;
};
} // namespace blink
« no previous file with comments | « no previous file | Source/core/dom/DOMStringList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698