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

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

Issue 228723002: Java API for mojo system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding shared handle. 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/src/org/chromium/mojo/system/SharedBufferHandle.java
diff --git a/mojo/public/java/src/org/chromium/mojo/system/SharedBufferHandle.java b/mojo/public/java/src/org/chromium/mojo/system/SharedBufferHandle.java
new file mode 100644
index 0000000000000000000000000000000000000000..bb326f8ae44da11911766498ed4807794552a60b
--- /dev/null
+++ b/mojo/public/java/src/org/chromium/mojo/system/SharedBufferHandle.java
@@ -0,0 +1,125 @@
+// 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;
+
+/**
+ * TODO(qsr): Insert description here.
+ */
+public interface SharedBufferHandle extends Handle {
+
+ /**
+ * TODO(qsr): Insert description here.
+ */
+ public static class CreateFlags extends Flags<CreateFlags> {
+ private static final int FLAG_NONE = 0;
+
+ /**
+ * Dedicated constructor.
+ *
+ * @param flags initial value of the flags.
+ */
+ protected CreateFlags(int flags) {
+ super(flags);
+ }
+
+ /**
+ * @return flags with no bit set.
+ */
+ public static CreateFlags none() {
+ return new CreateFlags(FLAG_NONE);
+ }
+
+ }
+
+ /**
+ * TODO(qsr): Insert description here.
+ */
+ public static class CreateOptions {
+ public CreateFlags flags;
bulach 2014/04/14 17:39:56 ditto
+ }
+
+ /**
+ * TODO(qsr): Insert description here.
+ */
+ public static class DuplicateFlags extends Flags<DuplicateFlags> {
+ private static final int FLAG_NONE = 0;
+
+ /**
+ * Dedicated constructor.
+ *
+ * @param flags initial value of the flags.
+ */
+ protected DuplicateFlags(int flags) {
+ super(flags);
+ }
+
+ /**
+ * @return flags with no bit set.
+ */
+ public static DuplicateFlags none() {
+ return new DuplicateFlags(FLAG_NONE);
+ }
+
+ }
+
+ /**
+ * TODO(qsr): Insert description here.
+ */
+ public static class DuplicateOptions {
+ public DuplicateFlags flags;
+ }
+
+ /**
+ * TODO(qsr): Insert description here.
+ */
+ public static class MapFlags extends Flags<MapFlags> {
+ private static final int FLAG_NONE = 0;
+
+ /**
+ * Dedicated constructor.
+ *
+ * @param flags initial value of the flags.
+ */
+ protected MapFlags(int flags) {
+ super(flags);
+ }
+
+ /**
+ * @return flags with no bit set.
+ */
+ public static MapFlags none() {
+ return new MapFlags(FLAG_NONE);
+ }
+
+ }
+
+ /**
+ * TODO(qsr):
+ *
+ * @param options
+ * @return TODO(qsr)
+ */
+ public SharedBufferHandle duplicate(DuplicateOptions options);
+
+ /**
+ * TODO(qsr):
+ *
+ * @param offset
+ * @param numBytes
+ * @param flags
+ * @return TODO(qsr)
+ */
+ public ByteBuffer map(long offset, long numBytes, MapFlags flags);
+
+ /**
+ * TODO(qsr):
+ *
+ * @param buffer
+ */
+ public void unmap(ByteBuffer buffer);
+
+}

Powered by Google App Engine
This is Rietveld 408576698