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

Unified Diff: mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java

Issue 728553002: Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
diff --git a/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java b/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
index 4cd74e15685acc9835da711fcec46aeb081057e3..a5b77ae9ecb4b0687c8e3d8bde7595b74ed91e8b 100644
--- a/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
+++ b/mojo/public/java/system/src/org/chromium/mojo/system/DataPipe.java
@@ -161,6 +161,7 @@ public interface DataPipe {
private static final int FLAG_NONE = 0;
private static final int FLAG_ALL_OR_NONE = 1 << 0;
private static final int FLAG_QUERY = 1 << 2;
+ private static final int FLAG_PEEK = 1 << 3;
/**
* Immutable flag with not bit set.
@@ -189,7 +190,7 @@ public interface DataPipe {
/**
* Change the query bit of this flag. If set query the number of elements available to read.
- * Mutually exclusive with |dicard| and |allOrNone| is ignored if this flag is set.
+ * Mutually exclusive with |discard| and |allOrNone| is ignored if this flag is set.
*
* @param query the new value of the query bit.
* @return this.
@@ -199,6 +200,18 @@ public interface DataPipe {
}
/**
+ * Change the peek bit of this flag. If set, read the requested number of elements, and
+ * leave those elements in the pipe. A later read will return the same data.
+ * Mutually exclusive with |discard| and |query|.
+ *
+ * @param peek the new value of the peek bit.
+ * @return this.
+ */
+ public ReadFlags peek(boolean peek) {
+ return setFlag(FLAG_PEEK, peek);
+ }
+
+ /**
* @return a flag with no bit set.
*/
public static ReadFlags none() {
« no previous file with comments | « mojo/public/java/bindings/src/org/chromium/mojo/bindings/ServiceMessage.java ('k') | mojo/public/js/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698