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

Unified Diff: mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/math/CalculatorUiInternal.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/math/CalculatorUiInternal.java
diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/math/CalculatorUiInternal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/math/CalculatorUiInternal.java
new file mode 100644
index 0000000000000000000000000000000000000000..f968bd04d61e327aec5fd1acc4a52316fad2e214
--- /dev/null
+++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/math/CalculatorUiInternal.java
@@ -0,0 +1,120 @@
+// 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/math_calculator.mojom
+//
+
+package org.chromium.mojo.bindings.test.mojom.math;
+
+class CalculatorUiInternal {
+
+ public static final org.chromium.mojo.bindings.Interface.Builder<CalculatorUi, CalculatorUi.Proxy> BUILDER =
+ new org.chromium.mojo.bindings.Interface.Builder<CalculatorUi, CalculatorUi.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, CalculatorUi impl) {
+ return new Stub(core, impl);
+ }
+
+ public CalculatorUi[] newArray(int size) {
+ return new CalculatorUi[size];
+ }
+ };
+
+ private static final int OUTPUT_ORDINAL = 0;
+
+ static final class Proxy extends org.chromium.mojo.bindings.Interface.BaseProxy implements CalculatorUi.Proxy {
+
+ Proxy(org.chromium.mojo.system.Core core,
+ org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) {
+ super(core, messageReceiver);
+ }
+
+ @Override
+ public void output(double value) {
+ CalculatorUiOutputParams message = new CalculatorUiOutputParams();
+ message.value = value;
+ getMessageReceiver().accept(
+ message.serializeWithHeader(
+ getCore(),
+ new org.chromium.mojo.bindings.MessageHeader(OUTPUT_ORDINAL)));
+ }
+
+ }
+
+ static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<CalculatorUi> {
+
+ Stub(org.chromium.mojo.system.Core core, CalculatorUi 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 OUTPUT_ORDINAL: {
+ if (!header.validateHeader(0)) {
+ return false;
+ }
+ CalculatorUiOutputParams data =
+ CalculatorUiOutputParams.deserialize(message.getPayload());
+ getImpl().output(data.value);
+ 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 CalculatorUiOutputParams 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 double value;
+
+ public CalculatorUiOutputParams() {
+ super(STRUCT_SIZE);
+ }
+
+ public static CalculatorUiOutputParams deserialize(org.chromium.mojo.bindings.Message message) {
+ return decode(new org.chromium.mojo.bindings.Decoder(message));
+ }
+
+ public static CalculatorUiOutputParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
+ if (decoder0 == null) {
+ return null;
+ }
+ CalculatorUiOutputParams result = new CalculatorUiOutputParams();
+ DataHeader mainDataHeader = decoder0.readDataHeader();
+ if (mainDataHeader.numFields > 0) {
+ result.value = decoder0.readDouble(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(value, 8);
+ }
+ }
+
+}
+

Powered by Google App Engine
This is Rietveld 408576698