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

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

Issue 483163003: Introduce ES6 iterator for DOM objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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/core.gypi ('k') | Source/core/dom/Iterator.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Iterator.h
diff --git a/Source/core/dom/Iterator.h b/Source/core/dom/Iterator.h
new file mode 100644
index 0000000000000000000000000000000000000000..27f9125ae9739a13a9cd91a5fea7a0afec57cbec
--- /dev/null
+++ b/Source/core/dom/Iterator.h
@@ -0,0 +1,32 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef Iterator_h
+#define Iterator_h
+
+#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class ExceptionState;
+
+class Iterator : public GarbageCollectedFinalized<Iterator>, public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ Iterator() { ScriptWrappable::init(this); }
+ virtual ~Iterator() { }
+
+ virtual ScriptValue next(ScriptState*, ExceptionState&) = 0;
+ virtual ScriptValue next(ScriptState*, ScriptValue /* value */, ExceptionState&) = 0;
+ Iterator* iterator(ScriptState*, ExceptionState&) { return this; }
+
+ virtual void trace(Visitor*) { }
+};
+
+} // namespace blink
+
+#endif
+
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Iterator.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698