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

Side by Side Diff: mojo/public/java/bindings/src/org/chromium/mojo/bindings/InterfaceRequest.java

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.mojo.bindings;
6
7 import org.chromium.mojo.system.MessagePipeHandle;
8
9 /**
10 * One end of the message pipe representing a request to create an implementatio n to be bound to it.
11 * The other end of the pipe is bound to a proxy, which can be used immediately, while the
12 * InterfaceRequest is being sent.
13 * <p>
14 * InterfaceRequest are built using |Interface.Manager|.
15 *
16 * @param <P> the type of the remote interface proxy.
17 */
18 public class InterfaceRequest<P extends Interface> implements HandleOwner<Messag ePipeHandle> {
19
20 /**
21 * The handle which will be sent and will be connected to the implementation .
22 */
23 private final MessagePipeHandle mHandle;
24
25 /**
26 * Constructor.
27 *
28 * @param handle the handle which will be sent and will be connected to the implementation.
29 */
30 InterfaceRequest(MessagePipeHandle handle) {
31 mHandle = handle;
32 }
33
34 /**
35 * @see HandleOwner#passHandle()
36 */
37 @Override
38 public MessagePipeHandle passHandle() {
39 return mHandle.pass();
40 }
41
42 /**
43 * @see java.io.Closeable#close()
44 */
45 @Override
46 public void close() {
47 mHandle.close();
48 }
49
50 /**
51 * Returns an {@link InterfaceRequest} that wraps the given handle. This met hod is not type safe
52 * and should be avoided unless absolutely necessary.
53 */
54 @SuppressWarnings("rawtypes")
55 public static InterfaceRequest asInterfaceRequestUnsafe(MessagePipeHandle ha ndle) {
56 return new InterfaceRequest(handle);
57 }
58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698