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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.mojo.bindings; 5 package org.chromium.mojo.bindings;
6 6
7 import org.chromium.mojo.system.Handle; 7 import org.chromium.mojo.system.Handle;
8 import org.chromium.mojo.system.MessagePipeHandle; 8 import org.chromium.mojo.system.MessagePipeHandle;
9 9
10 import java.nio.ByteBuffer; 10 import java.nio.ByteBuffer;
11 import java.util.List; 11 import java.util.List;
12 12
13 /** 13 /**
14 * A raw message to be sent/received from a {@link MessagePipeHandle}. 14 * A raw message to be sent/received from a {@link MessagePipeHandle}. Note that this can contain
15 * any data, not necessarily a Mojo message with a proper header. See also {@lin k MessageWithHeader}
16 * and {@link SimpleMessage}.
15 */ 17 */
16 public final class Message { 18 public interface Message {
17 19
18 /** 20 /**
19 * The data of the message. 21 * The data part of the message.
20 */ 22 */
21 public final ByteBuffer buffer; 23 public ByteBuffer getData();
22 24
23 /** 25 /**
24 * The handles of the message. 26 * The handles part of the message.
25 */ 27 */
26 public final List<? extends Handle> handles; 28 public List<? extends Handle> getHandles();
27 29
28 /** 30 /**
29 * Constructor. 31 * Returns the message considered as a message with a header.
30 *
31 * @param buffer The buffer containing the bytes to send. This must be a dir ect buffer.
32 * @param handles The list of handles to send.
33 */ 32 */
34 public Message(ByteBuffer buffer, List<? extends Handle> handles) { 33 public MessageWithHeader asMojoMessage();
35 assert buffer.isDirect(); 34
36 this.buffer = buffer;
37 this.handles = handles;
38 }
39 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698