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

Unified Diff: mojo/public/java/org/chromium/mojo/system/Handle.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/Handle.java
diff --git a/mojo/public/java/org/chromium/mojo/system/Handle.java b/mojo/public/java/org/chromium/mojo/system/Handle.java
new file mode 100644
index 0000000000000000000000000000000000000000..8d83f7e13caf4137171d6a137ef64849a697fef7
--- /dev/null
+++ b/mojo/public/java/org/chromium/mojo/system/Handle.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;
+
+/**
+ * TODO(qsr): Insert description here.
+ */
+public interface Handle {
+
+ /**
+ * TODO(qsr):
+ */
+ public static final long DEADLINE_INFINITE = -1;
viettrungluu 2014/04/08 22:35:19 I think my preference would be to move this, WaitF
+
+ /**
+ * Flag for the wait operations on handles.
+ */
+ public static class WaitFlags extends Flags<WaitFlags> {
+ /**
+ * TODO(qsr):
+ *
+ * @param flags
+ */
+ protected WaitFlags(int flags) {
+ super(flags);
+ }
+
+ private static final int FLAG_NONE = 0;
+ private static final int FLAG_READABLE = 1 << 0;
+ private static final int FLAG_WRITABLE = 1 << 1;
+ private static final int FLAG_ALL = ~0;
+
+ /**
+ * Change the readable bit of this flag.
+ *
+ * @param readable the new value of the readable bit.
+ * @return this.
+ */
+ public WaitFlags readable(boolean readable) {
+ return setFlag(FLAG_READABLE, readable);
+ }
+
+ /**
+ * Change the writable bit of this flag.
+ *
+ * @param writable the new value of the writable bit.
+ * @return this.
+ */
+ public WaitFlags writable(boolean writable) {
+ return setFlag(FLAG_WRITABLE, writable);
+ }
+
+ /**
+ * @return a flag with no bit set.
+ */
+ public static WaitFlags none() {
+ return new WaitFlags(FLAG_NONE);
+ }
+
+ /**
+ * @return a flag with all bits set.
+ */
+ public static WaitFlags all() {
+ return new WaitFlags(FLAG_ALL);
+ }
+ }
+
+ /**
+ * TODO(qsr):
+ */
+ public void close();
+
+ /**
+ * TODO(qsr):
+ *
+ * @param flags
+ * @param deadline
+ */
+ public void wait(WaitFlags flags, long deadline);
+
+ /**
+ * TODO(qsr):
+ *
+ * @return TODO(qsr)
+ */
+ public boolean isValid();
+}
« no previous file with comments | « mojo/public/java/org/chromium/mojo/system/Flags.java ('k') | mojo/public/java/org/chromium/mojo/system/MessagePipeHandle.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698