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

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

Issue 411913002: mojo: generate Proxies and Stubs for java bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow 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/sample/ServiceClientInternal.java
diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceClientInternal.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceClientInternal.java
new file mode 100644
index 0000000000000000000000000000000000000000..c5f4a5a103581bcbf952309b24d5c63e7c919120
--- /dev/null
+++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/ServiceClientInternal.java
@@ -0,0 +1,122 @@
+// 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 ServiceClientInternal {
+
+ public static final org.chromium.mojo.bindings.Interface.Manager<ServiceClient, ServiceClient.Proxy> MANAGER =
+ new org.chromium.mojo.bindings.Interface.Manager<ServiceClient, ServiceClient.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, ServiceClient impl) {
+ return new Stub(core, impl);
+ }
+
+ public ServiceClient[] buildArray(int size) {
+ return new ServiceClient[size];
+ }
+ };
+
+ private static final int DID_FROBINATE_ORDINAL = 0;
+
+ static final class Proxy extends org.chromium.mojo.bindings.Interface.AbstractProxy implements ServiceClient.Proxy {
+
+ Proxy(org.chromium.mojo.system.Core core,
+ org.chromium.mojo.bindings.MessageReceiverWithResponder messageReceiver) {
+ super(core, messageReceiver);
+ }
+
+ @Override
+ public void didFrobinate(int result) {
+ ServiceClientDidFrobinateParams message = new ServiceClientDidFrobinateParams();
+ message.result = result;
+ getMessageReceiver().accept(
+ message.serializeWithHeader(
+ getCore(),
+ new org.chromium.mojo.bindings.MessageHeader(DID_FROBINATE_ORDINAL)));
+ }
+
+ }
+
+ static final class Stub extends org.chromium.mojo.bindings.Interface.Stub<ServiceClient> {
+
+ Stub(org.chromium.mojo.system.Core core, ServiceClient impl) {
+ super(core, impl);
+ }
+
+ @Override
+ public boolean accept(org.chromium.mojo.bindings.MessageWithHeader message) {
+ try {
+ org.chromium.mojo.bindings.MessageHeader header = message.getHeader();
+ if (!header.validateHeader(org.chromium.mojo.bindings.MessageHeader.NO_FLAG)) {
+ return false;
+ }
+ switch(header.getType()) {
+ case DID_FROBINATE_ORDINAL: {
+ ServiceClientDidFrobinateParams data =
+ ServiceClientDidFrobinateParams.deserialize(message.getPayload());
+ getImpl().didFrobinate(data.result);
+ return true;
+ }
+ default:
+ return false;
+ }
+ } 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 ServiceClientDidFrobinateParams 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 int result;
+
+ public ServiceClientDidFrobinateParams() {
+ super(STRUCT_SIZE);
+ }
+
+ public static ServiceClientDidFrobinateParams deserialize(org.chromium.mojo.bindings.Message message) {
+ return decode(new org.chromium.mojo.bindings.Decoder(message));
+ }
+
+ public static ServiceClientDidFrobinateParams decode(org.chromium.mojo.bindings.Decoder decoder0) {
+ if (decoder0 == null) {
+ return null;
+ }
+ ServiceClientDidFrobinateParams result = new ServiceClientDidFrobinateParams();
+ DataHeader mainDataHeader = decoder0.readDataHeader();
+ if (mainDataHeader.numFields > 0) {
+ result.result = decoder0.readInt(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(result, 8);
+ }
+ }
+
+}
+

Powered by Google App Engine
This is Rietveld 408576698