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 d94796831b0e28de4c8995435671adbba586b5a1..ef4d0e96642d10e18c479763708ea2d81b387c30 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 |
@@ -36,6 +36,29 @@ public class BindingsHelper { |
} |
/** |
+ * Passed as |arrayNullability| when neither the array nor its elements are nullable. |
+ */ |
+ public static final int NOTHING_NULLABLE = 0; |
+ |
+ /** |
+ * "Array bit" of |arrayNullability| is set iff the array itself is nullable. |
+ */ |
+ public static final int ARRAY_NULLABLE = (1 << 0); |
+ |
+ /** |
+ * "Element bit" of |arrayNullability| is set iff the array elements are nullable. |
+ */ |
+ public static final int ELEMENT_NULLABLE = (1 << 1); |
+ |
+ public static boolean isArrayNullable(int arrayNullability) { |
+ return (arrayNullability & ARRAY_NULLABLE) > 0; |
+ } |
+ |
+ public static boolean isElementNullable(int arrayNullability) { |
+ return (arrayNullability & ELEMENT_NULLABLE) > 0; |
+ } |
+ |
+ /** |
* Compute the size in bytes of the given string encoded as utf8. |
*/ |
public static int utf8StringSizeInBytes(String s) { |