| Index: mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
|
| diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
|
| index 52a9cbd8c5be90167d2054d42aba0827ad531a7b..9ec2cb248e0bb8cc5e697a29cdec93f84398bbf8 100644
|
| --- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
|
| +++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Encoder.java
|
| @@ -7,8 +7,6 @@
|
| import org.chromium.mojo.bindings.Struct.DataHeader;
|
| import org.chromium.mojo.system.Core;
|
| import org.chromium.mojo.system.Handle;
|
| -import org.chromium.mojo.system.MessagePipeHandle;
|
| -import org.chromium.mojo.system.Pair;
|
|
|
| import java.nio.ByteBuffer;
|
| import java.nio.ByteOrder;
|
| @@ -141,6 +139,7 @@
|
| Encoder result = new Encoder(mEncoderState);
|
| result.encode(dataHeader);
|
| return result;
|
| +
|
| }
|
|
|
| /**
|
| @@ -244,43 +243,25 @@
|
| /**
|
| * Encode an {@link Interface}.
|
| */
|
| - public <T extends Interface> void encode(T v, int offset, Interface.Manager<T, ?> manager) {
|
| - if (v == null) {
|
| - encode(-1, offset);
|
| - return;
|
| - }
|
| + public <T extends Interface> void encode(T v, int offset, Object builder) {
|
| if (mEncoderState.core == null) {
|
| throw new UnsupportedOperationException(
|
| "The encoder has been created without a Core. It can't encode an interface.");
|
| }
|
| - // If the instance is a proxy, pass the proxy's handle instead of creating a new stub.
|
| - if (v instanceof Interface.AbstractProxy) {
|
| - Interface.AbstractProxy proxy = (Interface.AbstractProxy) v;
|
| - if (proxy.getMessageReceiver() instanceof HandleOwner) {
|
| - encode(((HandleOwner<?>) proxy.getMessageReceiver()).passHandle(), offset);
|
| - return;
|
| - }
|
| - // If the proxy is not over a message pipe, the default case applies.
|
| - }
|
| - Pair<MessagePipeHandle, MessagePipeHandle> handles =
|
| - mEncoderState.core.createMessagePipe(null);
|
| - manager.bind(v, handles.first);
|
| - encode(handles.second, offset);
|
| + // TODO(qsr): To be implemented when interfaces proxy and stubs are implemented.
|
| + throw new UnsupportedOperationException("Unimplemented operation");
|
| }
|
|
|
| /**
|
| * Encode an {@link InterfaceRequest}.
|
| */
|
| - public <I extends Interface> void encode(InterfaceRequest<I> v, int offset) {
|
| - if (v == null) {
|
| - encode(-1, offset);
|
| - return;
|
| - }
|
| + public <T extends Interface> void encode(InterfaceRequest<T> v, int offset) {
|
| if (mEncoderState.core == null) {
|
| throw new UnsupportedOperationException(
|
| "The encoder has been created without a Core. It can't encode an interface.");
|
| }
|
| - encode(v.passHandle(), offset);
|
| + // TODO(qsr): To be implemented when interfaces proxy and stubs are implemented.
|
| + throw new UnsupportedOperationException("Unimplemented operation");
|
| }
|
|
|
| /**
|
| @@ -393,8 +374,7 @@
|
| /**
|
| * Encodes an array of {@link Interface}.
|
| */
|
| - public <T extends Interface> void encode(T[] v, int offset,
|
| - Interface.Manager<T, ?> manager) {
|
| + public <T extends Interface> void encode(T[] v, int offset, Object builder) {
|
| if (v == null) {
|
| encodeNullPointer(offset);
|
| return;
|
| @@ -402,14 +382,14 @@
|
| Encoder e = encoderForArray(BindingsHelper.SERIALIZED_HANDLE_SIZE, v.length, offset);
|
| for (int i = 0; i < v.length; ++i) {
|
| e.encode(v[i], DataHeader.HEADER_SIZE + BindingsHelper.SERIALIZED_HANDLE_SIZE * i,
|
| - manager);
|
| - }
|
| - }
|
| -
|
| - /**
|
| - * Encodes an array of {@link InterfaceRequest}.
|
| - */
|
| - public <I extends Interface> void encode(InterfaceRequest<I>[] v, int offset) {
|
| + builder);
|
| + }
|
| + }
|
| +
|
| + /**
|
| + * Encodes an array of {@link Interface}.
|
| + */
|
| + public <T extends Interface> void encode(InterfaceRequest<T>[] v, int offset) {
|
| if (v == null) {
|
| encodeNullPointer(offset);
|
| return;
|
|
|