Chromium Code Reviews| Index: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/imported/ImportedInterfaceInternal.java |
| diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/imported/ImportedInterfaceInternal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/imported/ImportedInterfaceInternal.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..02785dfbc6b905c165a88576961ed757c937d2a4 |
| --- /dev/null |
| +++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/imported/ImportedInterfaceInternal.java |
| @@ -0,0 +1,112 @@ |
| +// 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_import.mojom |
| +// |
| + |
| +package org.chromium.mojo.bindings.test.mojom.imported; |
| + |
| +class ImportedInterfaceInternal { |
| + |
| + public static final org.chromium.mojo.bindings.Interface.Builder<ImportedInterface, ImportedInterface.Proxy> BUILDER = |
| + new org.chromium.mojo.bindings.Interface.Builder<ImportedInterface, ImportedInterface.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, ImportedInterface impl) { |
| + return new Stub(core, impl); |
| + } |
| + |
| + public ImportedInterface[] newArray(int size) { |
| + return new ImportedInterface[size]; |
| + } |
| + }; |
| + |
| + private static final int DO_SOMETHING_ORDINAL = 0; |
| + |
| + static final class Proxy extends org.chromium.mojo.bindings.Interface.BaseProxy implements ImportedInterface.Proxy { |
| + |
| + Proxy(org.chromium.mojo.system.Core core, |
| + org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) { |
| + super(core, messageReceiver); |
| + } |
| + |
| + @Override |
| + public void doSomething() { |
| + ImportedInterfaceDoSomethingParams message = new ImportedInterfaceDoSomethingParams(); |
| + getMessageReceiver().accept( |
| + message.serializeWithHeader( |
| + getCore(), |
| + new org.chromium.mojo.bindings.MessageHeader(DO_SOMETHING_ORDINAL))); |
| + } |
| + |
| + } |
| + |
| + static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<ImportedInterface> { |
| + |
| + Stub(org.chromium.mojo.system.Core core, ImportedInterface 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 DO_SOMETHING_ORDINAL: { |
| + if (!header.validateHeader(0)) { |
|
rmcilroy
2014/08/21 14:43:52
nit - only a single indent here.
rmcilroy
2014/08/21 14:43:52
Please add a NO_FLAGS constant to MessageHeader an
qsr
2014/08/22 08:11:18
Done.
qsr
2014/08/22 08:11:18
Done.
|
| + return false; |
| + } |
| + ImportedInterfaceDoSomethingParams.deserialize(message.getPayload()); |
| + getImpl().doSomething(); |
| + return true; |
| + } |
| + } |
| + } catch (org.chromium.mojo.bindings.DeserializationException e) { |
| + } |
| + return false; |
|
rmcilroy
2014/08/21 14:43:52
move the "return false" into the catch block and a
qsr
2014/08/22 08:11:18
Done.
|
| + } |
| + |
| + @Override |
| + public boolean acceptWithResponder(org.chromium.mojo.bindings.MessageWithHeader message, org.chromium.mojo.bindings.MessageReceiver receiver) { |
| + return false; |
| + } |
| + } |
| + |
| + static final class ImportedInterfaceDoSomethingParams 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 ImportedInterfaceDoSomethingParams() { |
| + super(STRUCT_SIZE); |
| + } |
| + |
| + public static ImportedInterfaceDoSomethingParams deserialize(org.chromium.mojo.bindings.Message message) { |
| + return decode(new org.chromium.mojo.bindings.Decoder(message)); |
| + } |
| + |
| + public static ImportedInterfaceDoSomethingParams decode(org.chromium.mojo.bindings.Decoder decoder0) { |
| + if (decoder0 == null) { |
| + return null; |
| + } |
| + ImportedInterfaceDoSomethingParams result = new ImportedInterfaceDoSomethingParams(); |
| + decoder0.readDataHeader(); |
| + return result; |
| + } |
| + |
| + @Override |
| + protected final void encode(org.chromium.mojo.bindings.Encoder encoder) { |
| + encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO); |
| + } |
| + } |
| + |
| +} |
| + |