Index: mojo/bindings/java/src/org/chromium/mojo/bindings/InterfaceRequest.java |
diff --git a/mojo/bindings/java/src/org/chromium/mojo/bindings/InterfaceRequest.java b/mojo/bindings/java/src/org/chromium/mojo/bindings/InterfaceRequest.java |
index b07a0ee86261eee90197b82282eb2937771b2676..b1c1639c3f8ca01b0ed66892157269e2bf3a629e 100644 |
--- a/mojo/bindings/java/src/org/chromium/mojo/bindings/InterfaceRequest.java |
+++ b/mojo/bindings/java/src/org/chromium/mojo/bindings/InterfaceRequest.java |
@@ -4,12 +4,49 @@ |
package org.chromium.mojo.bindings; |
+import org.chromium.mojo.system.MessagePipeHandle; |
+ |
+import java.io.IOException; |
+ |
/** |
* 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. |
* |
* @param <I> the type of the remote interface. |
*/ |
-public final class InterfaceRequest<I extends Interface> { |
+public class InterfaceRequest<I extends Interface> implements HandleOwner<MessagePipeHandle> { |
+ |
+ /** |
+ * TODO(qsr) |
+ */ |
+ private final MessagePipeHandle mHandle; |
+ |
+ /** |
+ * TODO(qsr): |
+ * |
+ * @param core |
+ * @param builder |
+ */ |
+ InterfaceRequest(MessagePipeHandle stubHandle) { |
+ mHandle = stubHandle; |
+ } |
+ |
+ /** |
+ * TODO(qsr): |
+ * |
+ * @return |
+ */ |
+ @Override |
+ public MessagePipeHandle passHandle() { |
+ return mHandle.toUntypedHandle().toMessagePipeHandle(); |
+ } |
+ |
+ /** |
+ * @see java.io.Closeable#close() |
+ */ |
+ @Override |
+ public void close() throws IOException { |
+ mHandle.close(); |
+ } |
} |