Index: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface2Internal.java |
diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface2Internal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface2Internal.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..61c9ca902466d74b59884ce659920effbd357702 |
--- /dev/null |
+++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface2Internal.java |
@@ -0,0 +1,209 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// This file is autogenerated by: |
+// mojo/public/tools/bindings/mojom_bindings_generator.py |
+// For: |
+// mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom |
+// |
+ |
+package org.chromium.mojo.bindings.test.mojom.mojo; |
+ |
+class IntegrationTestInterface2Internal { |
+ |
+ public static final org.chromium.mojo.bindings.InterfaceWithClient.Builder<IntegrationTestInterface1, IntegrationTestInterface2, IntegrationTestInterface2.Proxy> BUILDER = |
+ new org.chromium.mojo.bindings.InterfaceWithClient.Builder<IntegrationTestInterface1, IntegrationTestInterface2, IntegrationTestInterface2.Proxy>() { |
+ |
+ public Proxy buildProxy(org.chromium.mojo.system.Core core, |
+ org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) { |
+ return new Proxy(core, messageReceiver); |
+ } |
+ |
+ public Stub buildStub(org.chromium.mojo.system.Core core, IntegrationTestInterface2 impl) { |
+ return new Stub(core, impl); |
+ } |
+ |
+ public IntegrationTestInterface2[] newArray(int size) { |
+ return new IntegrationTestInterface2[size]; |
+ } |
+ |
+ protected org.chromium.mojo.bindings.Interface.Builder<IntegrationTestInterface1, ?> getClientBuilder() { |
+ return IntegrationTestInterface1.BUILDER; |
+ } |
+ }; |
+ |
+ private static final int METHOD0_ORDINAL = 0; |
+ |
+ static final class Proxy extends org.chromium.mojo.bindings.InterfaceWithClient.BaseProxy<IntegrationTestInterface1> implements IntegrationTestInterface2.Proxy { |
+ |
+ Proxy(org.chromium.mojo.system.Core core, |
+ org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) { |
+ super(core, messageReceiver); |
+ } |
+ |
+ @Override |
+ public void method0(Method0Response callback) { |
+ IntegrationTestInterface2Method0Params message = new IntegrationTestInterface2Method0Params(); |
+ getMessageReceiver().acceptWithResponder( |
+ message.serializeWithHeader( |
+ getCore(), |
+ new org.chromium.mojo.bindings.MessageHeader( |
+ METHOD0_ORDINAL, |
+ org.chromium.mojo.bindings.MessageHeader.MESSAGE_EXPECTS_RESPONSE_FLAG, |
+ 0)), |
+ new IntegrationTestInterface2Method0ResponseParamsForwardToCallback(callback)); |
+ } |
+ |
+ } |
+ |
+ static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<IntegrationTestInterface2> { |
+ |
+ Stub(org.chromium.mojo.system.Core core, IntegrationTestInterface2 impl) { |
+ super(core, impl); |
+ } |
+ |
+ @Override |
+ public boolean accept(org.chromium.mojo.bindings.MessageWithHeader message) { |
+ return false; |
+ } |
+ |
+ @Override |
+ public boolean acceptWithResponder(org.chromium.mojo.bindings.MessageWithHeader message, org.chromium.mojo.bindings.MessageReceiver receiver) { |
+ try { |
+ org.chromium.mojo.bindings.MessageHeader header = message.getHeader(); |
+ switch(header.getType()) { |
+ case METHOD0_ORDINAL: { |
+ if (!header.validateHeader(org.chromium.mojo.bindings.MessageHeader.MESSAGE_EXPECTS_RESPONSE_FLAG)) { |
+ return false; |
+ } |
+ IntegrationTestInterface2Method0Params.deserialize(message.getPayload()); |
+ getImpl().method0(new IntegrationTestInterface2Method0ResponseParamsProxyToResponder(getCore(), receiver, header.getRequestId())); |
+ return true; |
+ } |
+ } |
+ } catch (org.chromium.mojo.bindings.DeserializationException e) { |
+ } |
+ return false; |
+ } |
+ } |
+ |
+ static final class IntegrationTestInterface2Method0Params extends org.chromium.mojo.bindings.Struct { |
+ |
+ private static final int STRUCT_SIZE = 8; |
+ private static final DataHeader DEFAULT_STRUCT_INFO = new DataHeader(STRUCT_SIZE, 0); |
+ |
+ public IntegrationTestInterface2Method0Params() { |
+ super(STRUCT_SIZE); |
+ } |
+ |
+ public static IntegrationTestInterface2Method0Params deserialize(org.chromium.mojo.bindings.Message message) { |
+ return decode(new org.chromium.mojo.bindings.Decoder(message)); |
+ } |
+ |
+ public static IntegrationTestInterface2Method0Params decode(org.chromium.mojo.bindings.Decoder decoder0) { |
+ if (decoder0 == null) { |
+ return null; |
+ } |
+ IntegrationTestInterface2Method0Params result = new IntegrationTestInterface2Method0Params(); |
+ decoder0.readDataHeader(); |
+ return result; |
+ } |
+ |
+ @Override |
+ protected final void encode(org.chromium.mojo.bindings.Encoder encoder) { |
+ encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO); |
+ } |
+ } |
+ |
+ static final class IntegrationTestInterface2Method0ResponseParams extends org.chromium.mojo.bindings.Struct { |
+ |
+ private static final int STRUCT_SIZE = 16; |
+ private static final DataHeader DEFAULT_STRUCT_INFO = new DataHeader(STRUCT_SIZE, 1); |
+ |
+ public byte[] param0; |
+ |
+ public IntegrationTestInterface2Method0ResponseParams() { |
+ super(STRUCT_SIZE); |
+ } |
+ |
+ public static IntegrationTestInterface2Method0ResponseParams deserialize(org.chromium.mojo.bindings.Message message) { |
+ return decode(new org.chromium.mojo.bindings.Decoder(message)); |
+ } |
+ |
+ public static IntegrationTestInterface2Method0ResponseParams decode(org.chromium.mojo.bindings.Decoder decoder0) { |
+ if (decoder0 == null) { |
+ return null; |
+ } |
+ IntegrationTestInterface2Method0ResponseParams result = new IntegrationTestInterface2Method0ResponseParams(); |
+ DataHeader mainDataHeader = decoder0.readDataHeader(); |
+ if (mainDataHeader.numFields > 0) { |
+ result.param0 = decoder0.readBytes(8); |
+ } |
+ return result; |
+ } |
+ |
+ @Override |
+ protected final void encode(org.chromium.mojo.bindings.Encoder encoder) { |
+ org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO); |
+ encoder0.encode(param0, 8); |
+ } |
+ } |
+ |
+ static class IntegrationTestInterface2Method0ResponseParamsForwardToCallback extends org.chromium.mojo.bindings.SideEffectFreeCloseable |
+ implements org.chromium.mojo.bindings.MessageReceiver { |
+ private final IntegrationTestInterface2.Method0Response mCallback; |
+ |
+ IntegrationTestInterface2Method0ResponseParamsForwardToCallback(IntegrationTestInterface2.Method0Response callback) { |
+ this.mCallback = callback; |
+ } |
+ |
+ @Override |
+ public boolean accept(org.chromium.mojo.bindings.MessageWithHeader message) { |
+ try { |
+ org.chromium.mojo.bindings.MessageHeader header = message.getHeader(); |
+ if (!header.validateHeader(METHOD0_ORDINAL, |
+ org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG)) { |
+ return false; |
+ } |
+ IntegrationTestInterface2Method0ResponseParams response = IntegrationTestInterface2Method0ResponseParams.deserialize(message.getPayload()); |
+ mCallback.call(response.param0); |
+ return true; |
+ } catch (org.chromium.mojo.bindings.DeserializationException e) { |
+ return false; |
+ } |
+ } |
+ } |
+ |
+ static class IntegrationTestInterface2Method0ResponseParamsProxyToResponder implements IntegrationTestInterface2.Method0Response { |
+ |
+ private final org.chromium.mojo.system.Core mCore; |
+ private final org.chromium.mojo.bindings.MessageReceiver mMessageReceiver; |
+ private final long mRequestId; |
+ |
+ IntegrationTestInterface2Method0ResponseParamsProxyToResponder( |
+ org.chromium.mojo.system.Core core, |
+ org.chromium.mojo.bindings.MessageReceiver messageReceiver, |
+ long requestId) { |
+ mCore = core; |
+ mMessageReceiver = messageReceiver; |
+ mRequestId = requestId; |
+ } |
+ |
+ @Override |
+ public void call(byte[] param0) { |
+ IntegrationTestInterface2Method0ResponseParams response = new IntegrationTestInterface2Method0ResponseParams(); |
+ response.param0 = param0; |
+ org.chromium.mojo.bindings.MessageWithHeader message = |
+ response.serializeWithHeader( |
+ mCore, |
+ new org.chromium.mojo.bindings.MessageHeader( |
+ METHOD0_ORDINAL, |
+ org.chromium.mojo.bindings.MessageHeader.MESSAGE_IS_RESPONSE_FLAG, |
+ mRequestId)); |
+ mMessageReceiver.accept(message); |
+ } |
+ } |
+ |
+} |
+ |