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

Unified Diff: mojo/public/java/bindings/src/org/chromium/mojo/bindings/Message.java

Issue 522353003: mojo: Run validation tests on java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding conformance tests. Created 6 years, 3 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/bindings/src/org/chromium/mojo/bindings/Message.java
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Message.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Message.java
index 07bd2bd2e4697516242c73ef017cb10fbe4a198b..4c302d9a0c82ff0b8fe7d9b22317d946d7358c85 100644
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Message.java
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Message.java
@@ -11,29 +11,25 @@ import java.nio.ByteBuffer;
import java.util.List;
/**
- * A raw message to be sent/received from a {@link MessagePipeHandle}.
+ * A raw message to be sent/received from a {@link MessagePipeHandle}. Note that this can contain
+ * any data, not necessarily a Mojo message with a proper header. See also {@link MessageWithHeader}
+ * and {@link SimpleMessage}.
*/
-public final class Message {
+public interface Message {
/**
- * The data of the message.
+ * The data part of the message.
*/
- public final ByteBuffer buffer;
+ public ByteBuffer getData();
/**
- * The handles of the message.
+ * The handles part of the message.
*/
- public final List<? extends Handle> handles;
+ public List<? extends Handle> getHandles();
/**
- * Constructor.
- *
- * @param buffer The buffer containing the bytes to send. This must be a direct buffer.
- * @param handles The list of handles to send.
+ * Returns the message considered as a message with a header.
*/
- public Message(ByteBuffer buffer, List<? extends Handle> handles) {
- assert buffer.isDirect();
- this.buffer = buffer;
- this.handles = handles;
- }
+ public MessageWithHeader asMojoMessage();
+
}

Powered by Google App Engine
This is Rietveld 408576698