Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1410)

Unified Diff: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface1Internal.java

Issue 411913002: mojo: generate Proxies and Stubs for java bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow first pass review. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface1Internal.java
diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface1Internal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface1Internal.java
new file mode 100644
index 0000000000000000000000000000000000000000..3d78cf3483bd51b8d12a298ec5686609ca00a5e0
--- /dev/null
+++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/mojo/IntegrationTestInterface1Internal.java
@@ -0,0 +1,125 @@
+// 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 IntegrationTestInterface1Internal {
+
+ public static final org.chromium.mojo.bindings.InterfaceWithClient.Builder<IntegrationTestInterface2, IntegrationTestInterface1, IntegrationTestInterface1.Proxy> BUILDER =
+ new org.chromium.mojo.bindings.InterfaceWithClient.Builder<IntegrationTestInterface2, IntegrationTestInterface1, IntegrationTestInterface1.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, IntegrationTestInterface1 impl) {
+ return new Stub(core, impl);
+ }
+
+ public IntegrationTestInterface1[] newArray(int size) {
+ return new IntegrationTestInterface1[size];
+ }
+
+ protected org.chromium.mojo.bindings.Interface.Builder<IntegrationTestInterface2, ?> getClientBuilder() {
+ return IntegrationTestInterface2.BUILDER;
+ }
+ };
+
+ private static final int METHOD0_ORDINAL = 0;
+
+ static final class Proxy extends org.chromium.mojo.bindings.InterfaceWithClient.BaseProxy<IntegrationTestInterface2> implements IntegrationTestInterface1.Proxy {
+
+ Proxy(org.chromium.mojo.system.Core core,
+ org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) {
+ super(core, messageReceiver);
+ }
+
+ @Override
+ public void method0(BasicStruct param0) {
+ IntegrationTestInterface1Method0Params message = new IntegrationTestInterface1Method0Params();
+ message.param0 = param0;
+ getMessageReceiver().accept(
+ message.serializeWithHeader(
+ getCore(),
+ new org.chromium.mojo.bindings.MessageHeader(METHOD0_ORDINAL)));
+ }
+
+ }
+
+ static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<IntegrationTestInterface1> {
+
+ Stub(org.chromium.mojo.system.Core core, IntegrationTestInterface1 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 METHOD0_ORDINAL: {
+ if (!header.validateHeader(0)) {
+ return false;
+ }
+ IntegrationTestInterface1Method0Params data =
+ IntegrationTestInterface1Method0Params.deserialize(message.getPayload());
+ getImpl().method0(data.param0);
+ 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 IntegrationTestInterface1Method0Params 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 BasicStruct param0;
+
+ public IntegrationTestInterface1Method0Params() {
+ super(STRUCT_SIZE);
+ }
+
+ public static IntegrationTestInterface1Method0Params deserialize(org.chromium.mojo.bindings.Message message) {
+ return decode(new org.chromium.mojo.bindings.Decoder(message));
+ }
+
+ public static IntegrationTestInterface1Method0Params decode(org.chromium.mojo.bindings.Decoder decoder0) {
+ if (decoder0 == null) {
+ return null;
+ }
+ IntegrationTestInterface1Method0Params result = new IntegrationTestInterface1Method0Params();
+ DataHeader mainDataHeader = decoder0.readDataHeader();
+ if (mainDataHeader.numFields > 0) {
+ org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(8);
+ result.param0 = BasicStruct.decode(decoder1);
+ }
+ 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);
+ }
+ }
+
+}
+

Powered by Google App Engine
This is Rietveld 408576698