OLD | NEW |
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; |
(...skipping 11 matching lines...) Expand all Loading... |
22 private final ByteBuffer mBuffer; | 22 private final ByteBuffer mBuffer; |
23 | 23 |
24 /** | 24 /** |
25 * The handles of the message. | 25 * The handles of the message. |
26 */ | 26 */ |
27 private final List<? extends Handle> mHandle; | 27 private final List<? extends Handle> mHandle; |
28 | 28 |
29 /** | 29 /** |
30 * This message interpreted as a message for a mojo service with an appropri
ate header. | 30 * This message interpreted as a message for a mojo service with an appropri
ate header. |
31 */ | 31 */ |
32 private ServiceMessage mWithHeader = null; | 32 private ServiceMessage mWithHeader; |
33 | 33 |
34 /** | 34 /** |
35 * Constructor. | 35 * Constructor. |
36 * | 36 * |
37 * @param buffer The buffer containing the bytes to send. This must be a dir
ect buffer. | 37 * @param buffer The buffer containing the bytes to send. This must be a dir
ect buffer. |
38 * @param handles The list of handles to send. | 38 * @param handles The list of handles to send. |
39 */ | 39 */ |
40 public Message(ByteBuffer buffer, List<? extends Handle> handles) { | 40 public Message(ByteBuffer buffer, List<? extends Handle> handles) { |
41 assert buffer.isDirect(); | 41 assert buffer.isDirect(); |
42 mBuffer = buffer; | 42 mBuffer = buffer; |
(...skipping 17 matching lines...) Expand all Loading... |
60 /** | 60 /** |
61 * Returns the message interpreted as a message for a mojo service. | 61 * Returns the message interpreted as a message for a mojo service. |
62 */ | 62 */ |
63 public ServiceMessage asServiceMessage() { | 63 public ServiceMessage asServiceMessage() { |
64 if (mWithHeader == null) { | 64 if (mWithHeader == null) { |
65 mWithHeader = new ServiceMessage(this); | 65 mWithHeader = new ServiceMessage(this); |
66 } | 66 } |
67 return mWithHeader; | 67 return mWithHeader; |
68 } | 68 } |
69 } | 69 } |
OLD | NEW |