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

Unified Diff: mojo/public/java/org/chromium/mojo/system/MessagePipeHandle.java

Issue 228723002: Java API for mojo system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to system namespace. Created 6 years, 8 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: mojo/public/java/org/chromium/mojo/system/MessagePipeHandle.java
diff --git a/mojo/public/java/org/chromium/mojo/system/MessagePipeHandle.java b/mojo/public/java/org/chromium/mojo/system/MessagePipeHandle.java
new file mode 100644
index 0000000000000000000000000000000000000000..50623361edebaaf6dfd192ad433c2ce7275fe1ef
--- /dev/null
+++ b/mojo/public/java/org/chromium/mojo/system/MessagePipeHandle.java
@@ -0,0 +1,89 @@
+// 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.mojo.system;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+
+/**
+ * TODO(qsr): Insert description here.
+ */
+public interface MessagePipeHandle extends Handle {
+ /**
+ * Flag for the write operations on MessagePipeHandle .
+ */
+ public static class WriteFlags extends Flags<WriteFlags> {
+ private static final int FLAG_NONE = 0;
+
+ /**
+ * Dedicated constructor.
+ *
+ * @param flags initial value of the flag.
+ */
+ private WriteFlags(int flags) {
+ super(flags);
+ }
+
+ /**
+ * @return a flag with no bit set.
+ */
+ public static WriteFlags none() {
+ return new WriteFlags(FLAG_NONE);
+ }
+ }
+
+ /**
+ * Flag for the read operations on MessagePipeHandle.
+ */
+ public static class ReadFlags extends Flags<ReadFlags> {
+ private static final int FLAG_NONE = 0;
+ private static final int FLAG_MAY_DISCARD = 1 << 0;
+
+ /**
+ * Dedicated constructor.
+ *
+ * @param flags initial value of the flag.
+ */
+ private ReadFlags(int flags) {
+ super(flags);
+ }
+
+ /**
+ * Change the may-discard bit of this flag.
+ *
+ * @param mayDiscard the new value of the may-discard bit.
+ * @return this.
+ */
+ public ReadFlags mayDiscard(boolean mayDiscard) {
+ return setFlag(FLAG_MAY_DISCARD, mayDiscard);
+ }
+
+ /**
+ * @return a flag with no bit set.
+ */
+ public static ReadFlags none() {
+ return new ReadFlags(FLAG_NONE);
+ }
+
+ }
+
+ /**
+ * TODO(qsr):
+ *
+ * @param bytes
+ * @param handles
+ * @param flags
+ */
+ void writeMessage(ByteBuffer bytes, List<Handle> handles, WriteFlags flags);
+
+ /**
+ * TODO(qsr):
+ *
+ * @param bytes
+ * @param handles
+ * @param flags
+ */
+ void readMessage(ByteBuffer bytes, List<Handle> handles, ReadFlags flags);
+}

Powered by Google App Engine
This is Rietveld 408576698