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

Unified Diff: base/android/java/src/org/chromium/base/RewindableIterator.java

Issue 786933005: [Android] Add proxy for Java-based WebContentsObservers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 5 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
Index: base/android/java/src/org/chromium/base/RewindableIterator.java
diff --git a/base/android/java/src/org/chromium/base/RewindableIterator.java b/base/android/java/src/org/chromium/base/RewindableIterator.java
new file mode 100644
index 0000000000000000000000000000000000000000..7f07b7240f1ef4feb535827d08dc160f302f89f9
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/RewindableIterator.java
@@ -0,0 +1,22 @@
+// 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.
+
+package org.chromium.base;
+
+import java.util.Iterator;
+
+/**
+ * Extended iterator interface that provides rewind functionality.
+ *
+ * @param <E> The iterated type.
+ */
+public interface RewindableIterator<E> extends Iterator<E> {
+ /**
+ * Rewind the iterator back to the beginning.
+ *
+ * If we need to iterate multiple times, we can avoid iterator object reallocation by using
+ * this method.
+ */
+ public void rewind();
+}

Powered by Google App Engine
This is Rietveld 408576698