| Index: mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
|
| diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
|
| index b18e5c54c5b0fef01f1bc2ef1b4b8fc81f0e2fd9..d97547fbeac1b6b18872bbb4279d35bb44a180c6 100644
|
| --- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
|
| +++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java
|
| @@ -4,6 +4,7 @@
|
|
|
| package org.chromium.mojo.bindings;
|
|
|
| +import org.chromium.mojo.bindings.Struct.DataHeader;
|
| import org.chromium.mojo.system.AsyncWaiter;
|
| import org.chromium.mojo.system.Handle;
|
|
|
| @@ -29,16 +30,14 @@ public class BindingsHelper {
|
| public static final int POINTER_SIZE = 8;
|
|
|
| /**
|
| - * The value used for the expected length of a non-fixed size array.
|
| + * The header for a serialized map element.
|
| */
|
| - public static final int UNSPECIFIED_ARRAY_LENGTH = -1;
|
| + public static final DataHeader MAP_STRUCT_HEADER = new DataHeader(24, 2);
|
|
|
| /**
|
| - * Align |size| on {@link BindingsHelper#ALIGNMENT}.
|
| + * The value used for the expected length of a non-fixed size array.
|
| */
|
| - public static int align(int size) {
|
| - return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
|
| - }
|
| + public static final int UNSPECIFIED_ARRAY_LENGTH = -1;
|
|
|
| /**
|
| * Passed as |arrayNullability| when neither the array nor its elements are nullable.
|
| @@ -66,6 +65,13 @@ public class BindingsHelper {
|
| /**
|
| * Align |size| on {@link BindingsHelper#ALIGNMENT}.
|
| */
|
| + public static int align(int size) {
|
| + return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
|
| + }
|
| +
|
| + /**
|
| + * Align |size| on {@link BindingsHelper#ALIGNMENT}.
|
| + */
|
| public static long align(long size) {
|
| return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
|
| }
|
|
|