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

Unified Diff: mojo/public/java/bindings/src/org/chromium/mojo/bindings/BindingsHelper.java

Issue 648683003: mojo: Add maps to java bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Follow review Created 6 years, 2 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
« no previous file with comments | « no previous file | mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698