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

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

Issue 683583002: Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: geolocation 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
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 d97547fbeac1b6b18872bbb4279d35bb44a180c6..01cddc4880aaa6042826ae4c6d69173b118d44cf 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
@@ -110,6 +110,64 @@ public class BindingsHelper {
}
/**
+ * Returns |true| if and only if the two objects are equals, handling |null|.
+ */
+ public static boolean equals(Object o1, Object o2) {
+ if (o1 == o2) {
+ return true;
+ }
+ if (o1 == null) {
+ return false;
+ }
+ return o1.equals(o2);
+ }
+
+ /**
+ * Returns the hash code of the object, handling |null|.
+ */
+ public static int hashCode(Object o) {
+ if (o == null) {
+ return 0;
+ }
+ return o.hashCode();
+ }
+
+ /**
+ * Returns the hash code of the value.
+ */
+ public static int hashCode(boolean o) {
+ return o ? 1231 : 1237;
+ }
+
+ /**
+ * Returns the hash code of the value.
+ */
+ public static int hashCode(long o) {
+ return (int) (o ^ (o >>> 32));
+ }
+
+ /**
+ * Returns the hash code of the value.
+ */
+ public static int hashCode(float o) {
+ return Float.floatToIntBits(o);
+ }
+
+ /**
+ * Returns the hash code of the value.
+ */
+ public static int hashCode(double o) {
+ return hashCode(Double.doubleToLongBits(o));
+ }
+
+ /**
+ * Returns the hash code of the value.
+ */
+ public static int hashCode(int o) {
+ return o;
+ }
+
+ /**
* Determines if the given {@code char} value is a Unicode <i>surrogate code unit</i>. See
* {@link Character#isSurrogate}. Extracting here because the method only exists at API level
* 19.
@@ -119,8 +177,7 @@ public class BindingsHelper {
}
/**
- * Returns an {@link AsyncWaiter} to use with the given handle, or <code>null</code> if none if
- * available.
+ * Returns an {@link AsyncWaiter} to use with the given handle, or |null| if none if available.
*/
static AsyncWaiter getDefaultAsyncWaiterForHandle(Handle handle) {
if (handle.getCore() != null) {
@@ -129,5 +186,4 @@ public class BindingsHelper {
return null;
}
}
-
}

Powered by Google App Engine
This is Rietveld 408576698