Index: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/FactoryClientInternal.java |
diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/FactoryClientInternal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/FactoryClientInternal.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ba18fe4468d62cc8f3723b046290095c3b550c6 |
--- /dev/null |
+++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/FactoryClientInternal.java |
@@ -0,0 +1,181 @@ |
+// 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/sample_factory.mojom |
+// |
+ |
+package org.chromium.mojo.bindings.test.mojom.sample; |
+ |
+class FactoryClientInternal { |
+ |
+ public static final org.chromium.mojo.bindings.Interface.Builder<FactoryClient, FactoryClient.Proxy> BUILDER = |
+ new org.chromium.mojo.bindings.Interface.Builder<FactoryClient, FactoryClient.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, FactoryClient impl) { |
+ return new Stub(core, impl); |
+ } |
+ |
+ public FactoryClient[] newArray(int size) { |
+ return new FactoryClient[size]; |
+ } |
+ }; |
+ |
+ private static final int DID_STUFF_ORDINAL = 0; |
+ private static final int DID_STUFF2_ORDINAL = 1; |
+ |
+ static final class Proxy extends org.chromium.mojo.bindings.Interface.BaseProxy implements FactoryClient.Proxy { |
+ |
+ Proxy(org.chromium.mojo.system.Core core, |
+ org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) { |
+ super(core, messageReceiver); |
+ } |
+ |
+ @Override |
+ public void didStuff(Response response, String text) { |
+ FactoryClientDidStuffParams message = new FactoryClientDidStuffParams(); |
+ message.response = response; |
+ message.text = text; |
+ getMessageReceiver().accept( |
+ message.serializeWithHeader( |
+ getCore(), |
+ new org.chromium.mojo.bindings.MessageHeader(DID_STUFF_ORDINAL))); |
+ } |
+ |
+ @Override |
+ public void didStuff2(String text) { |
+ FactoryClientDidStuff2Params message = new FactoryClientDidStuff2Params(); |
+ message.text = text; |
+ getMessageReceiver().accept( |
+ message.serializeWithHeader( |
+ getCore(), |
+ new org.chromium.mojo.bindings.MessageHeader(DID_STUFF2_ORDINAL))); |
+ } |
+ |
+ } |
+ |
+ static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<FactoryClient> { |
+ |
+ Stub(org.chromium.mojo.system.Core core, FactoryClient impl) { |
+ super(core, impl); |
+ } |
+ |
+ @Override |
+ public boolean accept(org.chromium.mojo.bindings.MessageWithHeader message) { |
+ try { |
+ org.chromium.mojo.bindings.MessageHeader header = message.getHeader(); |
+ switch(header.getType()) { |
+ case DID_STUFF_ORDINAL: { |
+ if (!header.validateHeader(0)) { |
+ return false; |
+ } |
+ FactoryClientDidStuffParams data = |
+ FactoryClientDidStuffParams.deserialize(message.getPayload()); |
+ getImpl().didStuff(data.response, data.text); |
+ return true; |
+ } |
+ case DID_STUFF2_ORDINAL: { |
+ if (!header.validateHeader(0)) { |
+ return false; |
+ } |
+ FactoryClientDidStuff2Params data = |
+ FactoryClientDidStuff2Params.deserialize(message.getPayload()); |
+ getImpl().didStuff2(data.text); |
+ return true; |
+ } |
+ } |
+ } catch (org.chromium.mojo.bindings.DeserializationException e) { |
+ } |
+ return false; |
+ } |
+ |
+ @Override |
+ public boolean acceptWithResponder(org.chromium.mojo.bindings.MessageWithHeader message, org.chromium.mojo.bindings.MessageReceiver receiver) { |
+ return false; |
+ } |
+ } |
+ |
+ static final class FactoryClientDidStuffParams extends org.chromium.mojo.bindings.Struct { |
+ |
+ private static final int STRUCT_SIZE = 24; |
+ private static final DataHeader DEFAULT_STRUCT_INFO = new DataHeader(STRUCT_SIZE, 2); |
+ |
+ public Response response; |
+ public String text; |
+ |
+ public FactoryClientDidStuffParams() { |
+ super(STRUCT_SIZE); |
+ } |
+ |
+ public static FactoryClientDidStuffParams deserialize(org.chromium.mojo.bindings.Message message) { |
+ return decode(new org.chromium.mojo.bindings.Decoder(message)); |
+ } |
+ |
+ public static FactoryClientDidStuffParams decode(org.chromium.mojo.bindings.Decoder decoder0) { |
+ if (decoder0 == null) { |
+ return null; |
+ } |
+ FactoryClientDidStuffParams result = new FactoryClientDidStuffParams(); |
+ DataHeader mainDataHeader = decoder0.readDataHeader(); |
+ if (mainDataHeader.numFields > 0) { |
+ org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(8); |
+ result.response = Response.decode(decoder1); |
+ } |
+ if (mainDataHeader.numFields > 1) { |
+ result.text = decoder0.readString(16); |
+ } |
+ 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(response, 8); |
+ encoder0.encode(text, 16); |
+ } |
+ } |
+ |
+ static final class FactoryClientDidStuff2Params 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 String text; |
+ |
+ public FactoryClientDidStuff2Params() { |
+ super(STRUCT_SIZE); |
+ } |
+ |
+ public static FactoryClientDidStuff2Params deserialize(org.chromium.mojo.bindings.Message message) { |
+ return decode(new org.chromium.mojo.bindings.Decoder(message)); |
+ } |
+ |
+ public static FactoryClientDidStuff2Params decode(org.chromium.mojo.bindings.Decoder decoder0) { |
+ if (decoder0 == null) { |
+ return null; |
+ } |
+ FactoryClientDidStuff2Params result = new FactoryClientDidStuff2Params(); |
+ DataHeader mainDataHeader = decoder0.readDataHeader(); |
+ if (mainDataHeader.numFields > 0) { |
+ result.text = decoder0.readString(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(text, 8); |
+ } |
+ } |
+ |
+} |
+ |