Chromium Code Reviews| Index: mojo/public/java/bindings/src/org/chromium/mojo/bindings/InterfaceRequest.java |
| diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/InterfaceRequest.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/InterfaceRequest.java |
| index b07a0ee86261eee90197b82282eb2937771b2676..67de0bdcf33627ae72eae1cd63a0514574494e08 100644 |
| --- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/InterfaceRequest.java |
| +++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/InterfaceRequest.java |
| @@ -4,12 +4,46 @@ |
| package org.chromium.mojo.bindings; |
| +import org.chromium.mojo.system.MessagePipeHandle; |
| + |
| /** |
| * Used in methods that return instances of remote objects. Allows to start using the remote object |
| * immediately, while sending the handle that will be bind to the implementation. |
| + * <p> |
| + * InterfaceRequest are built using |Interface.Builder|. |
| * |
| - * @param <I> the type of the remote interface. |
| + * @param <P> the type of the remote interface proxy. |
| */ |
| -public final class InterfaceRequest<I extends Interface> { |
| +public class InterfaceRequest<P extends Interface.Proxy> implements HandleOwner<MessagePipeHandle> { |
|
ppi
2014/08/21 14:47:14
I wonder if this would be more intuitive to use if
qsr
2014/08/22 08:11:18
Done.
|
| + |
| + /** |
| + * The handle to send away that will be connected to the implementation. |
| + */ |
| + private final MessagePipeHandle mHandle; |
| + |
| + /** |
| + * Constructor. |
| + * |
| + * @param handle the handle to send away that will be connected to the implementation. |
| + */ |
| + InterfaceRequest(MessagePipeHandle handle) { |
| + mHandle = handle; |
| + } |
| + |
| + /** |
| + * @see HandleOwner#passHandle() |
| + */ |
| + @Override |
| + public MessagePipeHandle passHandle() { |
| + return mHandle.pass(); |
| + } |
| + |
| + /** |
| + * @see java.io.Closeable#close() |
| + */ |
| + @Override |
| + public void close() { |
| + mHandle.close(); |
| + } |
| } |