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

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

Issue 966843002: Mark DOMStringList.contains() as deprecated, add console warning. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add more detailed use counters 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
Index: Source/core/dom/DOMStringList.h
diff --git a/Source/core/dom/DOMStringList.h b/Source/core/dom/DOMStringList.h
index 1c94de5e38ee34b75088ff820fc28c04a6999b82..36fbc64bce96b87757e32a16c32f1dce3a7c3ac8 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() { }
+ DOMStringList(Source source) : m_source(source) { }
Vector<String> m_strings;
+ Source m_source;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698