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

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

Issue 317273006: Add serialization/deserialization of structs for mojo java bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review Created 6 years, 6 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/Request.java
diff --git a/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Request.java b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Request.java
new file mode 100644
index 0000000000000000000000000000000000000000..d29be51c361bb0c14478542857a9b2e2104321aa
--- /dev/null
+++ b/mojo/not-to-commit/mojo_public_test_interfaces/src/org/chromium/mojo/bindings/test/mojom/sample/Request.java
@@ -0,0 +1,54 @@
+// 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_factory.mojom
+//
+
+package org.chromium.mojo.bindings.test.mojom.sample;
+
+public final class Request 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 int x;
+ public org.chromium.mojo.system.MessagePipeHandle pipe;
+ public org.chromium.mojo.system.MessagePipeHandle[] morePipes;
+
+ public Request() {
+ super(STRUCT_SIZE);
+ pipe = org.chromium.mojo.system.InvalidHandle.INSTANCE;
+ }
+
+ public static Request deserialize(org.chromium.mojo.bindings.Message message) {
+ return decode(new org.chromium.mojo.bindings.Decoder(message));
+ }
+
+ public static Request decode(org.chromium.mojo.bindings.Decoder decoder0) {
+ Request result = new Request();
+ DataHeader mainDataHeader = decoder0.readDataHeader();
+ if (0 < mainDataHeader.numFields) {
+ result.x = decoder0.readInt(8);
+ }
+ if (1 < mainDataHeader.numFields) {
+ result.pipe = decoder0.readMessagePipeHandle(12);
+ }
+ if (2 < mainDataHeader.numFields) {
+ result.morePipes = decoder0.readMessagePipeHandles(16);
+ }
+ 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(x, 8);
+ encoder0.encode(pipe, 12);
+ encoder0.encode(morePipes, 16);
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698