| 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);
|
| +}
|
|
|