| Index: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceInternal.java
|
| diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceInternal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceInternal.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8fe97feed640dc52e676ecb00f8fb370501d6031
|
| --- /dev/null
|
| +++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceInternal.java
|
| @@ -0,0 +1,191 @@
|
| +// 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;
|
| +
|
| +class ServiceInternal {
|
| +
|
| + public static final org.chromium.mojo.bindings.InterfaceWithClient.Builder<ServiceClient, Service, Service.Proxy> BUILDER =
|
| + new org.chromium.mojo.bindings.InterfaceWithClient.Builder<ServiceClient, Service, Service.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, Service impl) {
|
| + return new Stub(core, impl);
|
| + }
|
| +
|
| + public Service[] newArray(int size) {
|
| + return new Service[size];
|
| + }
|
| +
|
| + protected org.chromium.mojo.bindings.Interface.Builder<ServiceClient, ?> getClientBuilder() {
|
| + return ServiceClient.BUILDER;
|
| + }
|
| + };
|
| +
|
| + private static final int FROBINATE_ORDINAL = 0;
|
| + private static final int GET_PORT_ORDINAL = 1;
|
| +
|
| + static final class Proxy extends org.chromium.mojo.bindings.InterfaceWithClient.BaseProxy<ServiceClient> implements Service.Proxy {
|
| +
|
| + Proxy(org.chromium.mojo.system.Core core,
|
| + org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) {
|
| + super(core, messageReceiver);
|
| + }
|
| +
|
| + @Override
|
| + public void frobinate(Foo foo, int baz, Port port) {
|
| + ServiceFrobinateParams message = new ServiceFrobinateParams();
|
| + message.foo = foo;
|
| + message.baz = baz;
|
| + message.port = port;
|
| + getMessageReceiver().accept(
|
| + message.serializeWithHeader(
|
| + getCore(),
|
| + new org.chromium.mojo.bindings.MessageHeader(FROBINATE_ORDINAL)));
|
| + }
|
| +
|
| + @Override
|
| + public void getPort(org.chromium.mojo.bindings.InterfaceRequest<Port.Proxy> port) {
|
| + ServiceGetPortParams message = new ServiceGetPortParams();
|
| + message.port = port;
|
| + getMessageReceiver().accept(
|
| + message.serializeWithHeader(
|
| + getCore(),
|
| + new org.chromium.mojo.bindings.MessageHeader(GET_PORT_ORDINAL)));
|
| + }
|
| +
|
| + }
|
| +
|
| + static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<Service> {
|
| +
|
| + Stub(org.chromium.mojo.system.Core core, Service 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 FROBINATE_ORDINAL: {
|
| + if (!header.validateHeader(0)) {
|
| + return false;
|
| + }
|
| + ServiceFrobinateParams data =
|
| + ServiceFrobinateParams.deserialize(message.getPayload());
|
| + getImpl().frobinate(data.foo, data.baz, data.port);
|
| + return true;
|
| + }
|
| + case GET_PORT_ORDINAL: {
|
| + if (!header.validateHeader(0)) {
|
| + return false;
|
| + }
|
| + ServiceGetPortParams data =
|
| + ServiceGetPortParams.deserialize(message.getPayload());
|
| + getImpl().getPort(data.port);
|
| + 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 ServiceFrobinateParams extends org.chromium.mojo.bindings.Struct {
|
| +
|
| + private static final int STRUCT_SIZE = 24;
|
| + private static final DataHeader DEFAULT_STRUCT_INFO = new DataHeader(STRUCT_SIZE, 3);
|
| +
|
| + public Foo foo;
|
| + public int baz;
|
| + public Port port;
|
| +
|
| + public ServiceFrobinateParams() {
|
| + super(STRUCT_SIZE);
|
| + }
|
| +
|
| + public static ServiceFrobinateParams deserialize(org.chromium.mojo.bindings.Message message) {
|
| + return decode(new org.chromium.mojo.bindings.Decoder(message));
|
| + }
|
| +
|
| + public static ServiceFrobinateParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + ServiceFrobinateParams result = new ServiceFrobinateParams();
|
| + DataHeader mainDataHeader = decoder0.readDataHeader();
|
| + if (mainDataHeader.numFields > 0) {
|
| + org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(8);
|
| + result.foo = Foo.decode(decoder1);
|
| + }
|
| + if (mainDataHeader.numFields > 1) {
|
| + result.baz = decoder0.readInt(16);
|
| + }
|
| + if (mainDataHeader.numFields > 2) {
|
| + result.port = decoder0.readServiceInterface(20, Port.BUILDER);
|
| + }
|
| + 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(foo, 8);
|
| + encoder0.encode(baz, 16);
|
| + encoder0.encode(port, 20, Port.BUILDER);
|
| + }
|
| + }
|
| +
|
| + static final class ServiceGetPortParams 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 org.chromium.mojo.bindings.InterfaceRequest<Port.Proxy> port;
|
| +
|
| + public ServiceGetPortParams() {
|
| + super(STRUCT_SIZE);
|
| + }
|
| +
|
| + public static ServiceGetPortParams deserialize(org.chromium.mojo.bindings.Message message) {
|
| + return decode(new org.chromium.mojo.bindings.Decoder(message));
|
| + }
|
| +
|
| + public static ServiceGetPortParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + ServiceGetPortParams result = new ServiceGetPortParams();
|
| + DataHeader mainDataHeader = decoder0.readDataHeader();
|
| + if (mainDataHeader.numFields > 0) {
|
| + result.port = decoder0.readInterfaceRequest(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(port, 8);
|
| + }
|
| + }
|
| +
|
| +}
|
| +
|
|
|