| Index: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Foo.java
|
| diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Foo.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Foo.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..15cb8f1d5d880c9c71b2e0538cc671a92a40ec49
|
| --- /dev/null
|
| +++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Foo.java
|
| @@ -0,0 +1,203 @@
|
| +// 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_service.mojom
|
| +//
|
| +
|
| +package org.chromium.mojo.bindings.test.mojom.sample;
|
| +
|
| +public final class Foo extends org.chromium.mojo.bindings.Struct {
|
| +
|
| + private static final int STRUCT_SIZE = 96;
|
| + private static final DataHeader DEFAULT_STRUCT_INFO = new DataHeader(STRUCT_SIZE, 15);
|
| +
|
| + public static final String FOOBY = (String) "Fooby";
|
| +
|
| + public String name;
|
| + public int x;
|
| + public int y;
|
| + public boolean a;
|
| + public boolean b;
|
| + public boolean c;
|
| + public Bar bar;
|
| + public Bar[] extraBars;
|
| + public byte[] data;
|
| + public org.chromium.mojo.system.MessagePipeHandle source;
|
| + public org.chromium.mojo.system.DataPipe.ConsumerHandle[] inputStreams;
|
| + public org.chromium.mojo.system.DataPipe.ProducerHandle[] outputStreams;
|
| + public boolean[][] arrayOfArrayOfBools;
|
| + public String[][][] multiArrayOfStrings;
|
| + public boolean[] arrayOfBools;
|
| +
|
| + public Foo() {
|
| + super(STRUCT_SIZE);
|
| + name = (String) Foo.FOOBY;
|
| + a = (boolean) true;
|
| + source = org.chromium.mojo.system.InvalidHandle.INSTANCE;
|
| + }
|
| +
|
| + public static Foo deserialize(org.chromium.mojo.bindings.Message message) {
|
| + return decode(new org.chromium.mojo.bindings.Decoder(message));
|
| + }
|
| +
|
| + public static Foo decode(org.chromium.mojo.bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + Foo result = new Foo();
|
| + DataHeader mainDataHeader = decoder0.readDataHeader();
|
| + if (mainDataHeader.numFields > 0) {
|
| + result.x = decoder0.readInt(8);
|
| + }
|
| + if (mainDataHeader.numFields > 1) {
|
| + result.y = decoder0.readInt(12);
|
| + }
|
| + if (mainDataHeader.numFields > 2) {
|
| + result.a = decoder0.readBoolean(16, 0);
|
| + }
|
| + if (mainDataHeader.numFields > 3) {
|
| + result.b = decoder0.readBoolean(16, 1);
|
| + }
|
| + if (mainDataHeader.numFields > 4) {
|
| + result.c = decoder0.readBoolean(16, 2);
|
| + }
|
| + if (mainDataHeader.numFields > 9) {
|
| + result.source = decoder0.readMessagePipeHandle(20);
|
| + }
|
| + if (mainDataHeader.numFields > 5) {
|
| + org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(24);
|
| + result.bar = Bar.decode(decoder1);
|
| + }
|
| + if (mainDataHeader.numFields > 6) {
|
| + result.data = decoder0.readBytes(32);
|
| + }
|
| + if (mainDataHeader.numFields > 7) {
|
| + org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(40);
|
| + if (decoder1 == null) {
|
| + result.extraBars = null;
|
| + } else {
|
| + DataHeader si1 = decoder1.readDataHeader();
|
| + result.extraBars = new Bar[si1.numFields];
|
| + for (int i1 = 0; i1 < si1.numFields; ++i1) {
|
| + org.chromium.mojo.bindings.Decoder decoder2 = decoder1.readPointer(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i1);
|
| + result.extraBars[i1] = Bar.decode(decoder2);
|
| + }
|
| + }
|
| + }
|
| + if (mainDataHeader.numFields > 8) {
|
| + result.name = decoder0.readString(48);
|
| + }
|
| + if (mainDataHeader.numFields > 10) {
|
| + result.inputStreams = decoder0.readConsumerHandles(56);
|
| + }
|
| + if (mainDataHeader.numFields > 11) {
|
| + result.outputStreams = decoder0.readProducerHandles(64);
|
| + }
|
| + if (mainDataHeader.numFields > 12) {
|
| + org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(72);
|
| + if (decoder1 == null) {
|
| + result.arrayOfArrayOfBools = null;
|
| + } else {
|
| + DataHeader si1 = decoder1.readDataHeader();
|
| + result.arrayOfArrayOfBools = new boolean[si1.numFields][];
|
| + for (int i1 = 0; i1 < si1.numFields; ++i1) {
|
| + result.arrayOfArrayOfBools[i1] = decoder1.readBooleans(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i1);
|
| + }
|
| + }
|
| + }
|
| + if (mainDataHeader.numFields > 13) {
|
| + org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(80);
|
| + if (decoder1 == null) {
|
| + result.multiArrayOfStrings = null;
|
| + } else {
|
| + DataHeader si1 = decoder1.readDataHeader();
|
| + result.multiArrayOfStrings = new String[si1.numFields][][];
|
| + for (int i1 = 0; i1 < si1.numFields; ++i1) {
|
| + org.chromium.mojo.bindings.Decoder decoder2 = decoder1.readPointer(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i1);
|
| + if (decoder2 == null) {
|
| + result.multiArrayOfStrings[i1] = null;
|
| + } else {
|
| + DataHeader si2 = decoder2.readDataHeader();
|
| + result.multiArrayOfStrings[i1] = new String[si2.numFields][];
|
| + for (int i2 = 0; i2 < si2.numFields; ++i2) {
|
| + org.chromium.mojo.bindings.Decoder decoder3 = decoder2.readPointer(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i2);
|
| + if (decoder3 == null) {
|
| + result.multiArrayOfStrings[i1][i2] = null;
|
| + } else {
|
| + DataHeader si3 = decoder3.readDataHeader();
|
| + result.multiArrayOfStrings[i1][i2] = new String[si3.numFields];
|
| + for (int i3 = 0; i3 < si3.numFields; ++i3) {
|
| + result.multiArrayOfStrings[i1][i2][i3] = decoder3.readString(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i3);
|
| + }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + if (mainDataHeader.numFields > 14) {
|
| + result.arrayOfBools = decoder0.readBooleans(88);
|
| + }
|
| + 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(x, 8);
|
| + encoder0.encode(y, 12);
|
| + encoder0.encode(a, 16, 0);
|
| + encoder0.encode(b, 16, 1);
|
| + encoder0.encode(c, 16, 2);
|
| + encoder0.encode(source, 20);
|
| + encoder0.encode(bar, 24);
|
| + encoder0.encode(data, 32);
|
| + if (extraBars == null) {
|
| + encoder0.encodeNullPointer(40);
|
| + } else {
|
| + org.chromium.mojo.bindings.Encoder encoder1 = encoder0.encodePointerArray(extraBars.length, 40);
|
| + for (int i0 = 0; i0 < extraBars.length; ++i0) {
|
| + encoder1.encode(extraBars[i0], DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i0);
|
| + }
|
| + }
|
| + encoder0.encode(name, 48);
|
| + encoder0.encode(inputStreams, 56);
|
| + encoder0.encode(outputStreams, 64);
|
| + if (arrayOfArrayOfBools == null) {
|
| + encoder0.encodeNullPointer(72);
|
| + } else {
|
| + org.chromium.mojo.bindings.Encoder encoder1 = encoder0.encodePointerArray(arrayOfArrayOfBools.length, 72);
|
| + for (int i0 = 0; i0 < arrayOfArrayOfBools.length; ++i0) {
|
| + encoder1.encode(arrayOfArrayOfBools[i0], DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i0);
|
| + }
|
| + }
|
| + if (multiArrayOfStrings == null) {
|
| + encoder0.encodeNullPointer(80);
|
| + } else {
|
| + org.chromium.mojo.bindings.Encoder encoder1 = encoder0.encodePointerArray(multiArrayOfStrings.length, 80);
|
| + for (int i0 = 0; i0 < multiArrayOfStrings.length; ++i0) {
|
| + if (multiArrayOfStrings[i0] == null) {
|
| + encoder1.encodeNullPointer(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i0);
|
| + } else {
|
| + org.chromium.mojo.bindings.Encoder encoder2 = encoder1.encodePointerArray(multiArrayOfStrings[i0].length, DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i0);
|
| + for (int i1 = 0; i1 < multiArrayOfStrings[i0].length; ++i1) {
|
| + if (multiArrayOfStrings[i0][i1] == null) {
|
| + encoder2.encodeNullPointer(DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i1);
|
| + } else {
|
| + org.chromium.mojo.bindings.Encoder encoder3 = encoder2.encodePointerArray(multiArrayOfStrings[i0][i1].length, DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i1);
|
| + for (int i2 = 0; i2 < multiArrayOfStrings[i0][i1].length; ++i2) {
|
| + encoder3.encode(multiArrayOfStrings[i0][i1][i2], DataHeader.HEADER_SIZE + org.chromium.mojo.bindings.BindingsHelper.POINTER_SIZE * i2);
|
| + }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + }
|
| + encoder0.encode(arrayOfBools, 88);
|
| + }
|
| +}
|
| +
|
|
|